From 7d732eb73bd5b227e944ba96693cc08cdbf2ddde Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 26 Oct 2022 19:14:49 +0200 Subject: [PATCH] fix deleting note from task manager, closes #3239 --- db/TODO.txt | 5 ----- src/becca/entities/branch.js | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/db/TODO.txt b/db/TODO.txt index 727557383..db29e44f3 100644 --- a/db/TODO.txt +++ b/db/TODO.txt @@ -1,11 +1,6 @@ -- drop branches.utcDateCreated - not used for anything -- drop options.utcDateCreated - not used for anything - isDeleted = 0 by default - rename openTabs to openNoteContexts -- migrate black theme to dark theme - unify readOnly handling to a single attribute: * readOnly - like now * readOnly=auto - like without readOnly (used to override inherited readOnly) * readOnly=never - like autoReadOnlyDisabled -- remove focusOnAttributesKeyboardShortcut -- rename white theme to "light" theme (it's not completely white and matches well to dark theme) diff --git a/src/becca/entities/branch.js b/src/becca/entities/branch.js index 44ba60cf3..af740bb1d 100644 --- a/src/becca/entities/branch.js +++ b/src/becca/entities/branch.js @@ -170,6 +170,10 @@ class Branch extends AbstractEntity { log.info("Deleting note " + note.noteId); + // marking note as deleted as a signal to event handlers that the note is being deleted + // (isDeleted is being checked against becca) + delete this.becca.notes[note.noteId]; + for (const attribute of note.getOwnedAttributes()) { attribute.markAsDeleted(deleteId); }