mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Fixes exportFolder by making it actually wait for each exportNote
This commit is contained in:
@@ -43,19 +43,18 @@ function exportFolder (storageKey, folderKey, fileType, exportDir) {
|
|||||||
.then(function exportNotes (data) {
|
.then(function exportNotes (data) {
|
||||||
const { storage, notes } = data
|
const { storage, notes } = data
|
||||||
|
|
||||||
notes
|
return Promise.all(notes
|
||||||
.filter(note => note.folder === folderKey && note.isTrashed === false && note.type === 'MARKDOWN_NOTE')
|
.filter(note => note.folder === folderKey && note.isTrashed === false && note.type === 'MARKDOWN_NOTE')
|
||||||
.forEach(note => {
|
.map(note => {
|
||||||
const notePath = path.join(exportDir, `${filenamify(note.title, {replacement: '_'})}.${fileType}`)
|
const notePath = path.join(exportDir, `${filenamify(note.title, {replacement: '_'})}.${fileType}`)
|
||||||
exportNote(note.key, storage.path, note.content, notePath, null)
|
return exportNote(note.key, storage.path, note.content, notePath, null)
|
||||||
})
|
})
|
||||||
|
).then(() => ({
|
||||||
return {
|
|
||||||
storage,
|
storage,
|
||||||
folderKey,
|
folderKey,
|
||||||
fileType,
|
fileType,
|
||||||
exportDir
|
exportDir
|
||||||
}
|
}))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user