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

This commit is contained in:
zadam 2022-09-19 23:12:12 +02:00
parent d4658b9c2a
commit fc43d9222a
2 changed files with 10 additions and 0 deletions

View file

@ -27,6 +27,8 @@ class Becca {
/** @type {Object.<String, EtapiToken>} */
this.etapiTokens = {};
this.dirtyNoteSetCache();
this.loaded = false;
}

View file

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