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

This commit is contained in:
EYHN
2024-05-13 04:00:46 +00:00
parent f94306703a
commit 4ebe8f5fb4

View File

@@ -66,12 +66,12 @@ export const Component = (): ReactElement => {
}, },
}) })
); );
window.exportWorkspaceSnapshot = async () => { window.exportWorkspaceSnapshot = async (docs?: string[]) => {
const zip = await ZipTransformer.exportDocs( const zip = await ZipTransformer.exportDocs(
workspace.docCollection, workspace.docCollection,
Array.from(workspace.docCollection.docs.values()).map(collection => Array.from(workspace.docCollection.docs.values())
collection.getDoc() .filter(doc => (docs ? docs.includes(doc.id) : true))
) .map(doc => doc.getDoc())
); );
const url = URL.createObjectURL(zip); const url = URL.createObjectURL(zip);
// download url // download url