Skip to content

Commit 9c4fb52

Browse files
committed
Revert "remove double listUsers call"
This reverts commit 9b03c78.
1 parent 9b03c78 commit 9c4fb52

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ui/src/store/modules/user.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,17 @@ const user = {
311311
commit('SET_TIMEZONE_OFFSET', cachedTimezoneOffset)
312312
commit('SET_USE_BROWSER_TIMEZONE', cachedUseBrowserTimezone)
313313
commit('SET_CUSTOM_COLUMNS', cachedCustomColumns)
314+
315+
// Ensuring we get the user info so that store.getters.user is never empty when the page is freshly loaded
316+
api('listUsers', { username: Cookies.get('username'), listall: true }).then(response => {
317+
const result = response.listusersresponse.user[0]
318+
commit('SET_INFO', result)
319+
commit('SET_NAME', result.firstname + ' ' + result.lastname)
320+
store.dispatch('SetCsLatestVersion', result.rolename)
321+
resolve(cachedApis)
322+
}).catch(error => {
323+
reject(error)
324+
})
314325
} else if (store.getters.loginFlag) {
315326
const hide = message.loading(i18n.global.t('message.discovering.feature'), 0)
316327
api('listZones').then(json => {

0 commit comments

Comments
 (0)