u
This commit is contained in:
@@ -4,9 +4,9 @@ import Box from '@mui/material/Box';
|
|||||||
import CircularProgress from '@mui/material/CircularProgress';
|
import CircularProgress from '@mui/material/CircularProgress';
|
||||||
import authAutomat from './automats/authAutomat';
|
import authAutomat from './automats/authAutomat';
|
||||||
import LoginPage from './components/LoginPage';
|
import LoginPage from './components/LoginPage';
|
||||||
|
import AppRouter from './appRouter';
|
||||||
|
|
||||||
const CompanySetupDialog = lazy(() => import('./components/CompanySetupDialog'));
|
const CompanySetupDialog = lazy(() => import('./components/CompanySetupDialog'));
|
||||||
const AppRouter = lazy(() => import('./appRouter'));
|
|
||||||
const OAuthAuthorizePage = lazy(() => import('./routes/oauth/OAuthAuthorizePage'));
|
const OAuthAuthorizePage = lazy(() => import('./routes/oauth/OAuthAuthorizePage'));
|
||||||
const SseMonitor = import.meta.env.DEV
|
const SseMonitor = import.meta.env.DEV
|
||||||
? lazy(() => import('./devtools/SseMonitor'))
|
? lazy(() => import('./devtools/SseMonitor'))
|
||||||
|
|||||||
@@ -128,17 +128,9 @@ function buildAuthState(user, status, extra = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function syncSse(state) {
|
function syncSse(state) {
|
||||||
if (state.hasAuth) {
|
const sseAutomat = Automat.get('sse');
|
||||||
void import('./sseAutomat')
|
if (sseAutomat?.actions?.syncWithAuth) {
|
||||||
.then(({ default: sseAutomat }) => {
|
sseAutomat.actions.syncWithAuth(state);
|
||||||
sseAutomat.actions.syncWithAuth?.(state);
|
|
||||||
})
|
|
||||||
.catch(() => { });
|
|
||||||
} else {
|
|
||||||
const sseAutomat = Automat.get('sse');
|
|
||||||
if (sseAutomat?.actions?.syncWithAuth) {
|
|
||||||
sseAutomat.actions.syncWithAuth(state);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user