M: Add prefetching for auth
This commit is contained in:
parent
69243dee0b
commit
33e73dfb47
|
@ -33,8 +33,6 @@ function ApplicationLayout() {
|
||||||
const noNavigation = useAppLayoutStore(state => state.noNavigation);
|
const noNavigation = useAppLayoutStore(state => state.noNavigation);
|
||||||
const noFooter = useAppLayoutStore(state => state.noFooter);
|
const noFooter = useAppLayoutStore(state => state.noFooter);
|
||||||
|
|
||||||
// TODO: prefetch data
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ErrorBoundary FallbackComponent={ErrorFallback} onError={logError} onReset={resetState}>
|
<ErrorBoundary FallbackComponent={ErrorFallback} onError={logError} onReset={resetState}>
|
||||||
<NavigationState>
|
<NavigationState>
|
||||||
|
|
|
@ -4,6 +4,11 @@ import { createRoot } from 'react-dom/client';
|
||||||
|
|
||||||
import App from './app';
|
import App from './app';
|
||||||
import GlobalProviders from './app/GlobalProviders';
|
import GlobalProviders from './app/GlobalProviders';
|
||||||
|
import { authApi } from './backend/auth/api';
|
||||||
|
import { queryClient } from './backend/queryClient';
|
||||||
|
|
||||||
|
// Prefetch auth data
|
||||||
|
queryClient.prefetchQuery(authApi.getAuthQueryOptions()).catch(console.error);
|
||||||
|
|
||||||
createRoot(document.getElementById('root')!).render(
|
createRoot(document.getElementById('root')!).render(
|
||||||
<GlobalProviders>
|
<GlobalProviders>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user