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(); beccaLoader.load();
for (const attr of becca.findAttributes('label','bookmarked')) { 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"); attr.markAsDeleted("0204__migrate_bookmarks_to_clones");
} }

View File

@ -131,7 +131,7 @@ class Branch extends AbstractEntity {
* @returns {boolean} * @returns {boolean}
*/ */
get isWeak() { 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}) { entitiesReloadedEvent({loadResults}) {
if (loadResults.getBranches().find(branch => branch.parentNoteId === 'lbBookmarks')) { if (loadResults.getBranches().find(branch => branch.parentNoteId === '_lbBookmarks')) {
this.refresh(); this.refresh();
} }

View File

@ -20,7 +20,7 @@ export default class BookmarkSwitchWidget extends SwitchWidget {
} }
async toggle(state) { 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) { if (!resp.success) {
toastService.showError(resp.message); toastService.showError(resp.message);
@ -28,7 +28,7 @@ export default class BookmarkSwitchWidget extends SwitchWidget {
} }
refreshWithNote(note) { 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.$switchOn.toggle(!isBookmarked);
this.$switchOff.toggle(isBookmarked); this.$switchOff.toggle(isBookmarked);

View File

@ -758,7 +758,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
.map(noteId => froca.notes[noteId]) .map(noteId => froca.notes[noteId])
.filter(note => !!note) .filter(note => !!note)
.filter(note => .filter(note =>
!['_share', 'lbBookmarks'].includes(note.noteId) !['_share', '_lbBookmarks'].includes(note.noteId)
&& note.type !== 'search'); && note.type !== 'search');
if (realClones.length > 1) { if (realClones.length > 1) {

View File

@ -100,7 +100,7 @@ function getAndValidateParent(params) {
throw new ValidationError(`Parent note "${params.parentNoteId}" not found.`); 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.`); 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 { return {
success: false, success: false,
message: 'Launcher note cannot have any children.' message: 'Launcher note cannot have any children.'