refactor: create and load workspace will return workspaceUnit

This commit is contained in:
alt0
2023-01-11 23:14:13 +08:00
parent 15bdd2f31e
commit 8e4585495f
11 changed files with 327 additions and 280 deletions
+21 -8
View File
@@ -37,6 +37,16 @@ export class WorkspaceUnit {
this.update(params);
}
get isPublish() {
console.error('Suggest changing to published');
return this.published;
}
get isLocal() {
console.error('Suggest changing to syncMode');
return this.syncMode === 'all';
}
get blocksuiteWorkspace() {
return this._blocksuiteWorkspace;
}
@@ -52,13 +62,16 @@ export class WorkspaceUnit {
Object.assign(this, params);
}
get isPublish() {
console.error('Suggest changing to published');
return this.published;
}
get isLocal() {
console.error('Suggest changing to syncMode');
return this.syncMode === 'all';
toJSON(): Omit<WorkspaceUnitCtorParams, 'blocksuiteWorkspace'> {
return {
id: this.id,
name: this.name,
avatar: this.avatar,
owner: this.owner,
published: this.published,
memberCount: this.memberCount,
provider: this.provider,
syncMode: this.syncMode,
};
}
}