feat: add clear all workspaces

This commit is contained in:
MingLiang Wang
2023-01-08 17:43:42 +08:00
parent d154a28ad1
commit 512c0a791e
3 changed files with 28 additions and 7 deletions
+10
View File
@@ -279,6 +279,16 @@ export class DataCenter {
return await this._transWorkspaceProvider(workspace, 'affine');
}
/**
* @deprecated
* clear all workspaces and data
*/
public async clear() {
for (const provider of this.providerMap.values()) {
await provider.clear();
}
}
/**
* Select a file to import the workspace
* @param {File} file file of workspace.