feat: add message center

This commit is contained in:
MingLiang Wang committed 2023-01-10 15:39:24 +08:00
1 parent ecec2d6efe
commit 31d3a012f9
8 files changed
+65 -15

No files matched your search

@@ -11,6 +11,7 @@ import { WebsocketProvider } from './sync.js';
import { getApis } from './apis/index.js';
import type { Apis, WorkspaceDetail, Callback } from './apis';
import { setDefaultAvatar } from '../utils.js';
import { MessageCode } from 'src/message/code.js';
export interface AffineProviderConstructorParams
extends ProviderConstructorParams {
@@ -196,7 +197,10 @@ export class AffineProvider extends BaseProvider {
return;
}
}
await this._apis.signInWithGoogle?.();
const user = await this._apis.signInWithGoogle?.();
if (!user) {
this._messageCenter.send(MessageCode.loginError);
}
}
public override async getUserInfo(): Promise<User | undefined> {