diff --git a/ui/src/hooks/index.ts b/ui/src/hooks/index.ts index df0c0e03..756d8724 100644 --- a/ui/src/hooks/index.ts +++ b/ui/src/hooks/index.ts @@ -8,8 +8,8 @@ import useChangeUserRoleModal from './useChangeUserRoleModal'; import useUserModal from './useUserModal'; import useChangePasswordModal from './useChangePasswordModal'; import usePageTags from './usePageTags'; -import usePromptWithUnload from './usePrompt'; import useLoginRedirect from './useLoginRedirect'; +import usePromptWithUnload from './usePrompt'; export { useTagModal, @@ -22,6 +22,6 @@ export { useUserModal, useChangePasswordModal, usePageTags, - usePromptWithUnload, useLoginRedirect, + usePromptWithUnload, }; diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.ts index 174ca6b2..975b919c 100644 --- a/ui/src/router/routes.ts +++ b/ui/src/router/routes.ts @@ -24,7 +24,10 @@ const routes: RouteNode[] = [ { path: '/', page: 'pages/Layout', - loader: guard.setupApp, + loader: async () => { + await guard.setupApp(); + return null; + }, guard: () => { const gr = guard.shouldLoginRequired(); if (!gr.ok) { diff --git a/ui/src/utils/guard.ts b/ui/src/utils/guard.ts index 760c4952..f9407f25 100644 --- a/ui/src/utils/guard.ts +++ b/ui/src/utils/guard.ts @@ -85,7 +85,6 @@ export const pullLoggedUser = async (forceRePull = false) => { if (Date.now() - dedupeTimestamp < 1000 * 10) { return; } - dedupeTimestamp = Date.now(); const loggedUserInfo = await getLoggedUserInfo().catch((ex) => { dedupeTimestamp = 0;