mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 21:36:05 +01:00
Merge branch 'master' into dev
# Conflicts: # package-lock.json # package.json # src/public/app/widgets/dialogs/note_revisions.js # src/services/handlers.js # src/services/hidden_subtree.js # src/services/search/services/parse.js
This commit is contained in:
@@ -4,6 +4,8 @@ const treeService = require('./tree');
|
||||
const noteService = require('./notes');
|
||||
const becca = require('../becca/becca');
|
||||
const BAttribute = require('../becca/entities/battribute');
|
||||
const hiddenSubtreeService = require("./hidden_subtree");
|
||||
const oneTimeTimer = require("./one_time_timer");
|
||||
|
||||
function runAttachedRelations(note, relationName, originEntity) {
|
||||
if (!note) {
|
||||
@@ -206,6 +208,16 @@ eventService.subscribe(eventService.ENTITY_DELETED, ({ entityName, entity }) =>
|
||||
if (entityName === 'branches') {
|
||||
runAttachedRelations(entity.getNote(), 'runOnBranchDeletion', entity);
|
||||
}
|
||||
|
||||
if (entityName === 'notes' && entity.noteId.startsWith("_")) {
|
||||
// "named" note has been deleted, we will probably need to rebuild the hidden subtree
|
||||
// scheduling so that bulk deletes won't trigger so many checks
|
||||
oneTimeTimer.scheduleExecution('hidden-subtree-check', 1000, () => {
|
||||
console.log("Checking hidden subtree");
|
||||
|
||||
hiddenSubtreeService.checkHiddenSubtree();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user