mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
chore(core): improve export snapshot tool (#6863)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user