From fc43d9222a7549f4b314b939b499cffb7ea996b4 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 19 Sep 2022 23:12:12 +0200 Subject: [PATCH] fix erasing notes - becca should be reloaded afterwards, closes #3146 --- src/becca/becca.js | 2 ++ src/services/notes.js | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/becca/becca.js b/src/becca/becca.js index 97d3dd9b0..86c5e169c 100644 --- a/src/becca/becca.js +++ b/src/becca/becca.js @@ -27,6 +27,8 @@ class Becca { /** @type {Object.} */ this.etapiTokens = {}; + this.dirtyNoteSetCache(); + this.loaded = false; } diff --git a/src/services/notes.js b/src/services/notes.js index 5cbb694fa..108b9a9db 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -735,6 +735,10 @@ function eraseDeletedEntities(eraseEntitiesAfterTimeInSeconds = null) { const attributeIdsToErase = sql.getColumn("SELECT attributeId FROM attributes WHERE isDeleted = 1 AND utcDateModified <= ?", [dateUtils.utcDateTimeStr(cutoffDate)]); eraseAttributes(attributeIdsToErase); + + if (noteIdsToErase.length > 0 || branchIdsToErase.length > 0 || attributeIdsToErase.length > 0) { + require('../becca/becca_loader').reload(); + } }); } @@ -750,6 +754,10 @@ function eraseNotesWithDeleteId(deleteId) { const attributeIdsToErase = sql.getColumn("SELECT attributeId FROM attributes WHERE deleteId = ?", [deleteId]); eraseAttributes(attributeIdsToErase); + + if (noteIdsToErase.length > 0 || branchIdsToErase.length > 0 || attributeIdsToErase.length > 0) { + require('../becca/becca_loader').reload(); + } } function eraseDeletedNotesNow() {