From b61c6a7553204cd059ddbe453b599c2e7179fb4f Mon Sep 17 00:00:00 2001 From: James Peru Date: Mon, 30 Nov 2026 08:13:08 +0300 Subject: [PATCH] ui: wait for the zones before building the menu on first login On a fresh login the routes were generated as soon as listApis returned, without waiting for listZones. The zones in the store were still the initial value, an object, so the menu checks that call zones.filter() failed and the UI stayed empty until a reload. Start with an empty list and generate the routes only after the zones are stored. Fixes: #14847 --- ui/src/store/modules/user.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/src/store/modules/user.js b/ui/src/store/modules/user.js index 4103ff920d63..64f4a575910c 100644 --- a/ui/src/store/modules/user.js +++ b/ui/src/store/modules/user.js @@ -121,7 +121,7 @@ const user = { headerNotices: [], isLdapEnabled: false, cloudian: {}, - zones: {}, + zones: [], timezoneoffset: 0.0, usebrowsertimezone: false, domainStore: {}, @@ -380,7 +380,8 @@ const user = { }) } else if (store.getters.loginFlag) { const hide = message.loading(i18n.global.t('message.discovering.feature'), 0) - getAPI('listZones').then(json => { + // The menu depends on the zones, so the routes are generated only once the zones are known + const zonesLoaded = getAPI('listZones').then(json => { const zones = json.listzonesresponse.zone || [] commit('SET_ZONES', zones) }).catch(error => { @@ -401,7 +402,7 @@ const user = { } } commit('SET_APIS', apis) - loadFeatures(apis).then(() => { + Promise.all([loadFeatures(apis), zonesLoaded]).then(() => { resolve(apis) store.dispatch('GenerateRoutes', { apis }).then(() => { store.getters.addRouters.map(route => {