mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-26 10:45:57 +08:00
Merge branch 'feat/cloud-sync-saika' of github.com:toeverything/AFFiNE into feat/datacenter-dev
This commit is contained in:
@@ -438,6 +438,18 @@ export class DataCenter {
|
|||||||
return [];
|
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) {
|
onMessage(cb: (message: Message) => void) {
|
||||||
return this._messageCenter.onMessage(cb);
|
return this._messageCenter.onMessage(cb);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ export class AffineProvider extends BaseProvider {
|
|||||||
ws_details: Record<string, WorkspaceDetail>;
|
ws_details: Record<string, WorkspaceDetail>;
|
||||||
metadata: Record<string, { avatar: string; name: string }>;
|
metadata: Record<string, { avatar: string; name: string }>;
|
||||||
}) {
|
}) {
|
||||||
|
this._logger('receive server message');
|
||||||
Object.entries(ws_details).forEach(([id, detail]) => {
|
Object.entries(ws_details).forEach(([id, detail]) => {
|
||||||
const { name, avatar } = metadata[id];
|
const { name, avatar } = metadata[id];
|
||||||
assert(name);
|
assert(name);
|
||||||
@@ -444,4 +445,8 @@ export class AffineProvider extends BaseProvider {
|
|||||||
public override async getWorkspaceMembers(id: string) {
|
public override async getWorkspaceMembers(id: string) {
|
||||||
return this._apis.getWorkspaceMembers({ id });
|
return this._apis.getWorkspaceMembers({ id });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override async acceptInvitation(invitingCode: string): Promise<void> {
|
||||||
|
await this._apis.acceptInviting({ invitingCode });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,4 +233,14 @@ export class BaseProvider {
|
|||||||
workspaceId;
|
workspaceId;
|
||||||
return Promise.resolve([]);
|
return Promise.resolve([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* accept invitation
|
||||||
|
* @param {string} inviteCode
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
public async acceptInvitation(inviteCode: string): Promise<void> {
|
||||||
|
inviteCode;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user