A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: no notes found on zip import
thecodrr4c0f0c5aa7c8
diff --git a/apps/web/src/utils/importer.js b/apps/web/src/utils/importer.jsindex 1e48d33fc..8cf137c4b 100644--- a/apps/web/src/utils/importer.js+++ b/apps/web/src/utils/importer.js@@ -6,9 +6,9 @@ const textDecoder = new TextDecoder();async function getNotesFromImport(files) {let notes = [];for (let file of files) {- const unzipped = unzipSync(new Uint8Array(await file.arrayBuffer()));+ const unzippedFiles = unzipSync(new Uint8Array(await file.arrayBuffer()));- let metadata = binaryToJson(unzipped["metadata.json"], undefined);+ let metadata = binaryToJson(unzippedFiles["metadata.json"], undefined);if (!metadata) continue;const noteIds = metadata["notes"];@@ -16,17 +16,17 @@ async function getNotesFromImport(files) {for (let noteId of noteIds) {const path = `${noteId}/note.json`;- let note = binaryToJson(files[path]);+ let note = binaryToJson(unzippedFiles[path]);if (!note) continue;const attachments = note.attachments?.slice() || [];note.attachments = [];for (let attachment of attachments) {const attachmentPath = `${noteId}/attachments/${attachment.hash}`;- if (!files[attachmentPath]) continue;+ if (!unzippedFiles[attachmentPath]) continue;attachment.filename = attachment.filename || attachment.hash;- attachment.data = files[attachmentPath];+ attachment.data = unzippedFiles[attachmentPath];note.attachments.push(attachment);}