refactor: handle uploading imported evernote attachments note-by-note instead of all at once

This commit is contained in:
Aman Harwara
2023-12-07 22:05:29 +05:30
parent 620cd960e2
commit 6d03a8ad17
2 changed files with 5 additions and 8 deletions

View File

@@ -279,8 +279,8 @@ export class HeadlessSuperConverter implements SuperConverterServiceInterface {
resolve()
return
}
Promise.all(
concatenatedNodes.map(async (node) => {
;(async () => {
for (const node of concatenatedNodes) {
const blob = await fetch(node.__src).then((response) => response.blob())
const name = $isInlineFileNode(node) ? node.__fileName : node.__alt
const mimeType = $isInlineFileNode(node) ? node.__mimeType : node.__src.split(';')[0].split(':')[1]
@@ -303,8 +303,8 @@ export class HeadlessSuperConverter implements SuperConverterServiceInterface {
)
await linkFile(uploadedFile)
}),
)
}
})()
.then(() => resolve())
.catch(console.error)
},