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