Fix dashboard auth loading state on split UI branch

This commit is contained in:
Evan Yang
2026-03-07 18:16:29 +08:00
parent 326a0086b7
commit 88f7ee734f
+3 -6
View File
@@ -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();