diff --git a/web/app/(shareLayout)/layout.tsx b/web/app/(shareLayout)/layout.tsx index 7de5d51edb..78b8835009 100644 --- a/web/app/(shareLayout)/layout.tsx +++ b/web/app/(shareLayout)/layout.tsx @@ -19,7 +19,7 @@ const Layout: FC<{ const [isLoading, setIsLoading] = useState(true) useEffect(() => { (async () => { - if (!systemFeatures.webapp_auth.enabled) { + if (!isGlobalPending && !systemFeatures.webapp_auth.enabled) { setIsLoading(false) return } @@ -37,7 +37,7 @@ const Layout: FC<{ setWebAppAccessMode(ret?.accessMode || AccessMode.PUBLIC) setIsLoading(false) })() - }, [pathname, redirectUrl, setWebAppAccessMode]) + }, [pathname, redirectUrl, setWebAppAccessMode, isGlobalPending, systemFeatures.webapp_auth.enabled]) if (isLoading || isGlobalPending) { return