feat: add accept invite

This commit is contained in:
MingLiang Wang
2023-01-11 21:35:40 +08:00
parent 932f5f02c4
commit 49eff042fe
3 changed files with 27 additions and 0 deletions

View File

@@ -438,6 +438,18 @@ export class DataCenter {
return [];
}
/**
* accept invitation
* @param {string} inviteCode
*/
async acceptInvitation(inviteCode: string, providerStr = 'affine') {
const provider = this.providerMap.get(providerStr);
if (provider) {
return await provider.acceptInvitation(inviteCode);
}
return [];
}
onMessage(cb: (message: Message) => void) {
return this._messageCenter.onMessage(cb);
}