mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-09 02:54:37 +00:00
Fix dashboard auth loading state on split UI branch
This commit is contained in:
+3
-6
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user