fix refresh issue

This commit is contained in:
yohlo
2025-09-24 12:20:36 -05:00
parent 36f3bb77d4
commit 81329e4354
7 changed files with 74 additions and 87 deletions

View File

@@ -83,12 +83,20 @@ export const Route = createRootRouteWithContext<{
return {};
}
// https://github.com/TanStack/router/discussions/3531
const auth = await ensureServerQueryData(
context.queryClient,
playerQueries.auth()
);
return { auth };
if (location.pathname === '/login' || location.pathname === '/logout') {
return {};
}
try {
// https://github.com/TanStack/router/discussions/3531
const auth = await ensureServerQueryData(
context.queryClient,
playerQueries.auth()
);
return { auth };
} catch (error) {
return {};
}
},
pendingComponent: () => <Providers><FullScreenLoader /></Providers>,
});