mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
fix: create workspace optimize
This commit is contained in:
@@ -128,20 +128,20 @@ export class DataCenter {
|
||||
* login to all providers, it will default run all auth ,
|
||||
* maybe need a params to control which provider to auth
|
||||
*/
|
||||
public async login() {
|
||||
this.providers.forEach(p => {
|
||||
// TODO: may be add params of auth
|
||||
p.auth();
|
||||
});
|
||||
public async login(providerId = 'affine') {
|
||||
const provider = this.providerMap.get(providerId);
|
||||
assert(provider, `provide '${providerId}' is not registered`);
|
||||
await provider.auth();
|
||||
provider.loadWorkspaces();
|
||||
}
|
||||
|
||||
/**
|
||||
* logout from all providers
|
||||
*/
|
||||
public async logout() {
|
||||
this.providers.forEach(p => {
|
||||
p.logout();
|
||||
});
|
||||
public async logout(providerId = 'affine') {
|
||||
const provider = this.providerMap.get(providerId);
|
||||
assert(provider, `provide '${providerId}' is not registered`);
|
||||
await provider.logout();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user