mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix bookmark's ID
This commit is contained in:
parent
1d1e6ae782
commit
c5fb2cccd5
@ -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");
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ class Branch extends AbstractEntity {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
get isWeak() {
|
||||
return ['_share', 'lbBookmarks'].includes(this.parentNoteId);
|
||||
return ['_share', '_lbBookmarks'].includes(this.parentNoteId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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.`);
|
||||
}
|
||||
|
||||
|
@ -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.'
|
||||
|
Loading…
x
Reference in New Issue
Block a user