mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
fix(import/enex): "Missing or wrong content type for resource" (fixes #943)
This commit is contained in:
parent
d319eede1f
commit
24c02e013b
@ -315,14 +315,10 @@ function importEnex(taskContext: TaskContext, file: File, parentNote: BNote): Pr
|
|||||||
resource.mime = resource.mime || "application/octet-stream";
|
resource.mime = resource.mime || "application/octet-stream";
|
||||||
|
|
||||||
const createFileNote = () => {
|
const createFileNote = () => {
|
||||||
if (typeof resource.content !== "string") {
|
|
||||||
throw new Error("Missing or wrong content type for resource.");
|
|
||||||
}
|
|
||||||
|
|
||||||
const resourceNote = noteService.createNewNote({
|
const resourceNote = noteService.createNewNote({
|
||||||
parentNoteId: noteEntity.noteId,
|
parentNoteId: noteEntity.noteId,
|
||||||
title: resource.title,
|
title: resource.title,
|
||||||
content: resource.content,
|
content: resource.content ?? "",
|
||||||
type: "file",
|
type: "file",
|
||||||
mime: resource.mime,
|
mime: resource.mime,
|
||||||
isProtected: parentNote.isProtected && protectedSessionService.isProtectedSessionAvailable()
|
isProtected: parentNote.isProtected && protectedSessionService.isProtectedSessionAvailable()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user