Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

chore(core): improve export snapshot tool (#6863)

EYHN4ebe8f5fb481
diff --git a/packages/frontend/core/src/pages/workspace/index.tsx b/packages/frontend/core/src/pages/workspace/index.tsx
index 716858b84e..db31d55c59 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