From bf40d41c8637ed1309cd3f6513612bbac1703499 Mon Sep 17 00:00:00 2001 From: Peng Xiao Date: Tue, 5 Sep 2023 17:53:22 +0800 Subject: [PATCH] fix: cloud workspace sometimes converted to local workspace (#4194) --- packages/workspace/src/local/crud.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/workspace/src/local/crud.ts b/packages/workspace/src/local/crud.ts index 9594eaa30..498a0837f 100644 --- a/packages/workspace/src/local/crud.ts +++ b/packages/workspace/src/local/crud.ts @@ -98,17 +98,10 @@ export const CRUD: WorkspaceCRUD = { 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[];