From 88f7ee734fe67f648ae1bb3873574b47574d705f Mon Sep 17 00:00:00 2001 From: Evan Yang Date: Sat, 7 Mar 2026 18:16:29 +0800 Subject: [PATCH] Fix dashboard auth loading state on split UI branch --- ui/app/page.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ui/app/page.tsx b/ui/app/page.tsx index 24ebfd7e..26534ed3 100644 --- a/ui/app/page.tsx +++ b/ui/app/page.tsx @@ -438,12 +438,8 @@ export default function DashboardPage() { const [activeChartId, setActiveChartId] = useState('revenue'); const isMobile = useIsMobile(); const { displayUnit } = useCurrencyStore(); - const [isAuthenticated, setIsAuthenticated] = useState(() => { - if (typeof window === 'undefined') { - return false; - } - return ConfigurationService.isTokenValid(); - }); + const [isAuthenticated, setIsAuthenticated] = useState(false); + const [isAuthResolved, setIsAuthResolved] = useState(false); useEffect(() => { if (typeof window === 'undefined') { @@ -452,6 +448,7 @@ export default function DashboardPage() { const syncAuthState = (): void => { setIsAuthenticated(ConfigurationService.isTokenValid()); + setIsAuthResolved(true); }; syncAuthState();