mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat: throw error if user not found
This commit is contained in:
@@ -134,7 +134,11 @@ export const AppStateProvider = ({
|
||||
const login = async () => {
|
||||
const { dataCenter } = appState;
|
||||
await dataCenter.login();
|
||||
|
||||
const user = (await dataCenter.getUserInfo()) as User;
|
||||
if (!user) {
|
||||
throw new Error('User info not found');
|
||||
}
|
||||
setAppState({
|
||||
...appState,
|
||||
user,
|
||||
|
||||
Reference in New Issue
Block a user