fix: userinfo issue after state refactor (#1061)

This commit is contained in:
Peng Xiao 2023-02-16 17:54:40 +08:00 committed by GitHub
parent 1034b6d517
commit 13e2537dfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -128,6 +128,10 @@ export function DataCenterPreloader({ children }: React.PropsWithChildren) {
currentWorkspace: null,
currentDataCenterWorkspace: null,
dataCenterPageList: [],
user:
(await dataCenter.getUserInfo(
dataCenter.providers.filter(p => p.id !== 'local')[0]?.id
)) || null,
});
});
throw promise;

View File

@ -12,6 +12,7 @@ export interface UserActions {
}
export const createUserState = (): UserState => ({
// initialized in DataCenterLoader (restore from localStorage)
user: null,
isOwner: false,
});