From eb0a68d0abda51adeb37f6745e9ddd87571b7f3b Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 29 Oct 2023 01:02:55 +0200 Subject: [PATCH] note list should show the prefix, #4362 --- src/public/app/services/note_list_renderer.js | 3 ++- src/public/app/services/tree.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/public/app/services/note_list_renderer.js b/src/public/app/services/note_list_renderer.js index ee2aac0d1..639eda944 100644 --- a/src/public/app/services/note_list_renderer.js +++ b/src/public/app/services/note_list_renderer.js @@ -3,6 +3,7 @@ import contentRenderer from "./content_renderer.js"; import froca from "./froca.js"; import attributeRenderer from "./attribute_renderer.js"; import libraryLoader from "./library_loader.js"; +import treeService from "./tree.js"; const TPL = `
@@ -294,7 +295,7 @@ class NoteListRenderer { .append($expander) .append($('').addClass(note.getIcon())) .append(this.viewType === 'grid' - ? $('').text(note.title) + ? $('').text(await treeService.getNoteTitle(note.noteId, this.parentNote.noteId)) : (await linkService.createLink(notePath, {showTooltip: false, showNotePath: this.showNotePath})) .addClass("note-book-title") ) diff --git a/src/public/app/services/tree.js b/src/public/app/services/tree.js index 858aa4804..48aac1323 100644 --- a/src/public/app/services/tree.js +++ b/src/public/app/services/tree.js @@ -217,7 +217,7 @@ async function getNoteTitle(noteId, parentNoteId = null) { if (branchId) { const branch = froca.getBranch(branchId); - if (branch && branch.prefix) { + if (branch?.prefix) { title = `${branch.prefix} - ${title}`; } }