completionId: cgen-d71b8bd4ae9349989ba06645cb602a3e
cgen-d71b8bd4ae9349989ba06645cb602a3e
This commit is contained in:
parent
3b7a8b3e3e
commit
476cd0d390
1 changed files with 4 additions and 3 deletions
|
|
@ -20,11 +20,12 @@ import { useNavigate } from "react-router-dom";
|
|||
import { useEffect, useState, useRef } from "react";
|
||||
import { useAuth } from "@/contexts/AuthContext";
|
||||
import LoadingScreen from "@/components/LoadingScreen";
|
||||
import { aethexToast } from "@/lib/aethex-toast";
|
||||
import { useArmToast } from "@/hooks/use-arm-toast";
|
||||
|
||||
export default function Staff() {
|
||||
const navigate = useNavigate();
|
||||
const { user, loading } = useAuth();
|
||||
const armToast = useArmToast();
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const toastShownRef = useRef(false);
|
||||
|
||||
|
|
@ -40,13 +41,13 @@ export default function Staff() {
|
|||
const timer = setTimeout(() => {
|
||||
setIsLoading(false);
|
||||
if (!toastShownRef.current) {
|
||||
aethexToast.system("Staff operations portal initialized");
|
||||
armToast.system("Staff operations portal initialized");
|
||||
toastShownRef.current = true;
|
||||
}
|
||||
}, 900);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
}, [armToast]);
|
||||
|
||||
// Show loading screen while checking authentication
|
||||
if (isLoading || loading) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue