Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
server: Refactor variable usage
Elian Doran5e80f120c94e
diff --git a/src/services/import/zip.ts b/src/services/import/zip.tsindex c2c06b1be4..15d60482b3 100644--- a/src/services/import/zip.ts+++ b/src/services/import/zip.ts@@ -456,8 +456,8 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRooreturn;}- let { mime, type } = noteMeta ? noteMeta : detectFileTypeAndMime(taskContext, filePath);- type = resolveNoteType(type);+ let { mime, type: detectedType } = noteMeta ? noteMeta : detectFileTypeAndMime(taskContext, filePath);+ const type = resolveNoteType(detectedType);if (mime == null) {throw new Error("Unable to resolve mime type.");}@@ -478,7 +478,7 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo// only skeleton was created because of altered order of cloned notes in ZIP, we need to update// https://github.com/zadam/trilium/issues/2440if (note.type === undefined) {- note.type = type as NoteType;+ note.type = type;note.mime = mime;note.title = noteTitle || "";note.isProtected = isProtected;@@ -503,7 +503,7 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRootitle: noteTitle || "",content: content,noteId,- type: type as NoteType,+ type,mime,prefix: noteMeta?.prefix || '',isExpanded: !!noteMeta?.isExpanded,