mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-25 17:33:14 +03:00
fix: cloud workspace sometimes converted to local workspace (#4194)
This commit is contained in:
parent
8b4f2a6c50
commit
bf40d41c86
@ -98,17 +98,10 @@ export const CRUD: WorkspaceCRUD<WorkspaceFlavour.LOCAL> = {
|
||||
list: async () => {
|
||||
logger.debug('list');
|
||||
const storage = getStorage();
|
||||
let allWorkspaceIDs: string[] = storage.getItem(kStoreKey, []) as z.infer<
|
||||
const allWorkspaceIDs: string[] = storage.getItem(kStoreKey, []) as z.infer<
|
||||
typeof schema
|
||||
>;
|
||||
|
||||
// fixme: remove this once desktop data migration is done
|
||||
if (window.apis && environment.isDesktop) {
|
||||
const desktopIds = (await window.apis.workspace.list()).map(v => v[0]);
|
||||
allWorkspaceIDs = [...new Set([...allWorkspaceIDs, ...desktopIds])];
|
||||
storage.setItem(kStoreKey, allWorkspaceIDs);
|
||||
}
|
||||
|
||||
const workspaces = (
|
||||
await Promise.all(allWorkspaceIDs.map(id => CRUD.get(id)))
|
||||
).filter(item => item !== null) as LocalWorkspace[];
|
||||
|
Loading…
Reference in New Issue
Block a user