diff --git a/package.json b/package.json index 085264966..dc9f22a68 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "trilium", "productName": "Trilium Notes", "description": "Trilium Notes", - "version": "0.46.3-beta", + "version": "0.46.4-beta", "license": "AGPL-3.0-only", "main": "electron.js", "bin": { diff --git a/src/public/app/entities/note_short.js b/src/public/app/entities/note_short.js index a97b74155..1cc4fd376 100644 --- a/src/public/app/entities/note_short.js +++ b/src/public/app/entities/note_short.js @@ -254,22 +254,39 @@ class NoteShort { return noteAttributeCache.attributes[this.noteId]; } - getAllNotePaths() { + getAllNotePaths(encounteredNoteIds = null) { if (this.noteId === 'root') { return [['root']]; } + if (!encounteredNoteIds) { + encounteredNoteIds = new Set(); + } + + encounteredNoteIds.add(this.noteId); + const parentNotes = this.getParentNotes(); let paths; if (parentNotes.length === 1) { // optimization for the most common case - paths = parentNotes[0].getAllNotePaths(); + if (encounteredNoteIds.has(parentNotes[0].noteId)) { + return []; + } + else { + paths = parentNotes[0].getAllNotePaths(encounteredNoteIds); + } } else { paths = []; for (const parentNote of parentNotes) { - paths.push(...parentNote.getAllNotePaths()); + if (encounteredNoteIds.has(parentNote.noteId)) { + continue; + } + + const newSet = new Set(encounteredNoteIds); + + paths.push(...parentNote.getAllNotePaths(newSet)); } } diff --git a/src/public/app/widgets/note_paths.js b/src/public/app/widgets/note_paths.js index 495dae8a8..4e6357ad3 100644 --- a/src/public/app/widgets/note_paths.js +++ b/src/public/app/widgets/note_paths.js @@ -88,7 +88,7 @@ export default class NotePathsWidget extends TabAwareWidget { .find('a') .addClass("no-tooltip-preview"); - const comments = []; + const icons = []; if (this.notePath === notePath) { $noteLink.addClass("path-current"); @@ -98,23 +98,23 @@ export default class NotePathsWidget extends TabAwareWidget { $noteLink.addClass("path-in-hoisted-subtree"); } else { - comments.push("outside of hoisting"); + icons.push(``); } if (notePathRecord.isArchived) { $noteLink.addClass("path-archived"); - comments.push("archived"); + icons.push(``); } if (notePathRecord.isSearch) { $noteLink.addClass("path-search"); - comments.push("search"); + icons.push(``); } - if (comments.length > 0) { - $noteLink.append(` (${comments.join(', ')})`); + if (icons.length > 0) { + $noteLink.append(` ${icons.join(' ')}`); } this.$notePathList.append($noteLink); diff --git a/src/routes/api/clipper.js b/src/routes/api/clipper.js index 324b7c5bb..13b7a4496 100644 --- a/src/routes/api/clipper.js +++ b/src/routes/api/clipper.js @@ -106,7 +106,7 @@ function processContent(images, note, content) { for (const {src, dataUrl, imageId} of images) { const filename = path.basename(src); - if (!dataUrl.startsWith("data:image")) { + if (!dataUrl || !dataUrl.startsWith("data:image")) { log.info("Image could not be recognized as data URL:", dataUrl.substr(0, Math.min(100, dataUrl.length))); continue; } diff --git a/src/services/build.js b/src/services/build.js index 2d4604e39..4bbb79fa2 100644 --- a/src/services/build.js +++ b/src/services/build.js @@ -1 +1 @@ -module.exports = { buildDate:"2021-03-08T23:11:11+01:00", buildRevision: "f27370d44f08afaa22d4cd86cba489584f9c878b" }; +module.exports = { buildDate:"2021-03-10T23:35:12+01:00", buildRevision: "6f901e6852c33ba0dae6c70efb9f65e5b0028995" };