M: Add prefetching for auth
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run

This commit is contained in:
Ivan 2025-01-29 21:41:40 +03:00
parent 570b2e8468
commit bb8824d2c3
2 changed files with 5 additions and 2 deletions

View File

@ -33,8 +33,6 @@ function ApplicationLayout() {
const noNavigation = useAppLayoutStore(state => state.noNavigation);
const noFooter = useAppLayoutStore(state => state.noFooter);
// TODO: prefetch data
return (
<ErrorBoundary FallbackComponent={ErrorFallback} onError={logError} onReset={resetState}>
<NavigationState>

View File

@ -4,6 +4,11 @@ import { createRoot } from 'react-dom/client';
import App from './app';
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(
<GlobalProviders>