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
fix bookmark's ID
zadamc5fb2cccd5b0
diff --git a/db/migrations/0204__migrate_bookmarks_to_clones.js b/db/migrations/0204__migrate_bookmarks_to_clones.jsindex 8f78066cb9..82cc11ebeb 100644--- a/db/migrations/0204__migrate_bookmarks_to_clones.js+++ b/db/migrations/0204__migrate_bookmarks_to_clones.js@@ -8,7 +8,7 @@ module.exports = () => {beccaLoader.load();for (const attr of becca.findAttributes('label','bookmarked')) {- cloningService.toggleNoteInParent(true, attr.noteId, 'lbBookmarks');+ cloningService.toggleNoteInParent(true, attr.noteId, '_lbBookmarks');attr.markAsDeleted("0204__migrate_bookmarks_to_clones");}diff --git a/src/becca/entities/branch.js b/src/becca/entities/branch.jsindex f3640e7bec..127c58b3c8 100644--- a/src/becca/entities/branch.js+++ b/src/becca/entities/branch.js@@ -131,7 +131,7 @@ class Branch extends AbstractEntity {* @returns {boolean}*/get isWeak() {- return ['_share', 'lbBookmarks'].includes(this.parentNoteId);+ return ['_share', '_lbBookmarks'].includes(this.parentNoteId);}/**diff --git a/src/public/app/widgets/bookmark_buttons.js b/src/public/app/widgets/bookmark_buttons.jsindex 0517933c9f..6e19319149 100644--- a/src/public/app/widgets/bookmark_buttons.js+++ b/src/public/app/widgets/bookmark_buttons.js@@ -38,7 +38,7 @@ export default class BookmarkButtons extends FlexContainer {}entitiesReloadedEvent({loadResults}) {- if (loadResults.getBranches().find(branch => branch.parentNoteId === 'lbBookmarks')) {+ if (loadResults.getBranches().find(branch => branch.parentNoteId === '_lbBookmarks')) {this.refresh();}diff --git a/src/public/app/widgets/bookmark_switch.js b/src/public/app/widgets/bookmark_switch.jsindex 5d1a3b3b3a..3c661d9e04 100644--- a/src/public/app/widgets/bookmark_switch.js+++ b/src/public/app/widgets/bookmark_switch.js@@ -20,7 +20,7 @@ export default class BookmarkSwitchWidget extends SwitchWidget {}async toggle(state) {- const resp = await server.put(`notes/${this.noteId}/toggle-in-parent/lbBookmarks/${!!state}`);+ const resp = await server.put(`notes/${this.noteId}/toggle-in-parent/_lbBookmarks/${!!state}`);if (!resp.success) {toastService.showError(resp.message);@@ -28,7 +28,7 @@ export default class BookmarkSwitchWidget extends SwitchWidget {}refreshWithNote(note) {- const isBookmarked = !!note.getParentBranches().find(b => b.parentNoteId === 'lbBookmarks');+ const isBookmarked = !!note.getParentBranches().find(b => b.parentNoteId === '_lbBookmarks');this.$switchOn.toggle(!isBookmarked);this.$switchOff.toggle(isBookmarked);diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.jsindex df2cb92d19..2381f23795 100644--- a/src/public/app/widgets/note_tree.js+++ b/src/public/app/widgets/note_tree.js@@ -758,7 +758,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {.map(noteId => froca.notes[noteId]).filter(note => !!note).filter(note =>- !['_share', 'lbBookmarks'].includes(note.noteId)+ !['_share', '_lbBookmarks'].includes(note.noteId)&& note.type !== 'search');if (realClones.length > 1) {diff --git a/src/services/notes.js b/src/services/notes.jsindex f17c7adce8..21e8588611 100644--- a/src/services/notes.js+++ b/src/services/notes.js@@ -100,7 +100,7 @@ function getAndValidateParent(params) {throw new ValidationError(`Parent note "${params.parentNoteId}" not found.`);}- if (parentNote.type === 'launcher' && parentNote.noteId !== 'lbBookmarks') {+ if (parentNote.type === 'launcher' && parentNote.noteId !== '_lbBookmarks') {throw new ValidationError(`Creating child notes into launcher notes is not allowed.`);}diff --git a/src/services/tree.js b/src/services/tree.jsindex f24bdca09f..72694b4b36 100644--- a/src/services/tree.js+++ b/src/services/tree.js@@ -58,7 +58,7 @@ function validateParentChild(parentNoteId, childNoteId, branchId = null) {};}- if (parentNoteId !== 'lbBookmarks' && becca.getNote(parentNoteId).type === 'launcher') {+ if (parentNoteId !== '_lbBookmarks' && becca.getNote(parentNoteId).type === 'launcher') {return {success: false,message: 'Launcher note cannot have any children.'