fix bookmark's ID

This commit is contained in:
zadam 2022-12-24 12:26:32 +01:00
parent 1d1e6ae782
commit c5fb2cccd5
7 changed files with 8 additions and 8 deletions

View File

@ -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");
}

View File

@ -131,7 +131,7 @@ class Branch extends AbstractEntity {
* @returns {boolean}
*/
get isWeak() {
return ['_share', 'lbBookmarks'].includes(this.parentNoteId);
return ['_share', '_lbBookmarks'].includes(this.parentNoteId);
}
/**

View File

@ -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();
}

View File

@ -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);

View File

@ -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) {

View File

@ -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.`);
}

View File

@ -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.'