From 4ebe8f5fb481797fb8d247f62805cb4341b72d4e Mon Sep 17 00:00:00 2001 From: EYHN Date: Mon, 13 May 2024 04:00:46 +0000 Subject: [PATCH] chore(core): improve export snapshot tool (#6863) --- packages/frontend/core/src/pages/workspace/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/frontend/core/src/pages/workspace/index.tsx b/packages/frontend/core/src/pages/workspace/index.tsx index 716858b84eeb1..db31d55c59646 100644 --- a/packages/frontend/core/src/pages/workspace/index.tsx +++ b/packages/frontend/core/src/pages/workspace/index.tsx @@ -66,12 +66,12 @@ export const Component = (): ReactElement => { }, }) ); - window.exportWorkspaceSnapshot = async () => { + window.exportWorkspaceSnapshot = async (docs?: string[]) => { const zip = await ZipTransformer.exportDocs( workspace.docCollection, - Array.from(workspace.docCollection.docs.values()).map(collection => - collection.getDoc() - ) + Array.from(workspace.docCollection.docs.values()) + .filter(doc => (docs ? docs.includes(doc.id) : true)) + .map(doc => doc.getDoc()) ); const url = URL.createObjectURL(zip); // download url