Skip to content

Build your personal knowledge base with Trilium Notes

fix erasing notes - becca should be reloaded afterwards, closes #3146

zadamfc43d9222a75
diff --git a/src/becca/becca.js b/src/becca/becca.js
index 97d3dd9b0e..86c5e169c9 100644
--- a/src/becca/becca.js
+++ b/src/becca/becca.js
@@ -27,6 +27,8 @@ class Becca {
/** @type {Object.<String, EtapiToken>} */
this.etapiTokens = {};
+ this.dirtyNoteSetCache();
+
this.loaded = false;
}
diff --git a/src/services/notes.js b/src/services/notes.js
index 5cbb694fa6..108b9a9db1 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() {