A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix: install page cannot fetch init config data
shuaiae38b2d1fc84
diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.tsindex 24016d0a..c6b8d359 100644--- a/ui/src/router/routes.ts+++ b/ui/src/router/routes.ts@@ -262,7 +262,7 @@ const routes: RouteNode[] = [],},{- path: 'install',+ path: '/install',page: 'pages/Install',},{diff --git a/ui/src/utils/guard.ts b/ui/src/utils/guard.tsindex c9517d7a..2e123bf7 100644--- a/ui/src/utils/guard.ts+++ b/ui/src/utils/guard.ts@@ -190,6 +190,15 @@ export const initAppSettingsStore = async () => {}};+export const shouldInitAppFetchData = () => {+ const { pathname } = window.location;+ if (pathname === '/install') {+ return false;+ }++ return true;+};+export const setupApp = async () => {/*** WARN:@@ -197,7 +206,10 @@ export const setupApp = async () => {* 2. must pre init app settings for app render*/// TODO: optimize `initAppSettingsStore` by server render- await Promise.allSettled([pullLoggedUser(), initAppSettingsStore()]);- setupAppLanguage();- setupAppTimeZone();++ if (shouldInitAppFetchData()) {+ await Promise.allSettled([pullLoggedUser(), initAppSettingsStore()]);+ setupAppLanguage();+ setupAppTimeZone();+ }};