mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +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(
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user