mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
fix(electron): export and import (#9767)
This commit is contained in:
@@ -120,6 +120,7 @@ class CloudWorkspaceFlavourProvider implements WorkspaceFlavourProvider {
|
||||
id: id,
|
||||
},
|
||||
});
|
||||
// TODO(@forehalo): when deleting cloud workspace, should we delete the workspace folder in local?
|
||||
this.revalidate();
|
||||
await this.waitForLoaded();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import type { BlobStorage, DocStorage } from '@affine/nbstore';
|
||||
import {
|
||||
type BlobStorage,
|
||||
type DocStorage,
|
||||
universalId,
|
||||
} from '@affine/nbstore';
|
||||
import {
|
||||
IndexedDBBlobStorage,
|
||||
IndexedDBDocStorage,
|
||||
@@ -101,11 +105,13 @@ class LocalWorkspaceFlavourProvider implements WorkspaceFlavourProvider {
|
||||
async deleteWorkspace(id: string): Promise<void> {
|
||||
setLocalWorkspaceIds(ids => ids.filter(x => x !== id));
|
||||
|
||||
// TODO(@forehalo): deleting logic for indexeddb workspaces
|
||||
if (BUILD_CONFIG.isElectron) {
|
||||
const electronApi = this.framework.get(DesktopApiService);
|
||||
await electronApi.handler.workspace.delete(id);
|
||||
await electronApi.handler.workspace.moveToTrash(
|
||||
universalId({ peer: 'local', type: 'workspace', id })
|
||||
);
|
||||
}
|
||||
|
||||
// notify all browser tabs, so they can update their workspace list
|
||||
this.notifyChannel.postMessage(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user