From d3a22c9a950d1388b961b45048136cd0566c8711 Mon Sep 17 00:00:00 2001 From: Macktireh Date: Fri, 2 Aug 2024 18:04:29 +0200 Subject: [PATCH] fix loanding time --- src/App.tsx | 2 +- src/helper/AuthProvider.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 8866316..42f6bb0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -21,7 +21,7 @@ const App: React.FC = ({ getCurrentUserAction }) => { if (!flag.current) { (async () => { await getCurrentUserAction(); - setTimeout(() => setLoading(false), 800); + setTimeout(() => setLoading(false), 2500); flag.current = true; })(); } diff --git a/src/helper/AuthProvider.tsx b/src/helper/AuthProvider.tsx index 5a351dd..b967e14 100644 --- a/src/helper/AuthProvider.tsx +++ b/src/helper/AuthProvider.tsx @@ -19,11 +19,11 @@ const AuthProvider: React.FC = ({ isPublic, isAuthenticated, children, g let [searchParams, setSearchParams] = useSearchParams(); React.useEffect(() => { - const code = searchParams.get("code") - if (code && isAuthenticated === false || isAuthenticated === null) { + const code = searchParams.get("code") + if (code && (isAuthenticated === false || isAuthenticated === null)) { (async () => { await googleLoginAction( code ); - setTimeout(() => setLoading(false), 800); + setTimeout(() => setLoading(false), 1000); })(); } else if (isAuthenticated !== null) setLoading(false); }, [loading, isAuthenticated]);