take branch prefix into account while sorting, fixes #3896

This commit is contained in:
zadam
2023-05-03 23:42:44 +02:00
parent fbffc6b2b5
commit 9b32d86f78
2 changed files with 18 additions and 5 deletions

View File

@@ -61,6 +61,12 @@ eventService.subscribe([ eventService.ENTITY_CHANGED, eventService.ENTITY_DELETE
eventService.subscribe(eventService.ENTITY_CHANGED, ({entityName, entity}) => {
if (entityName === 'note_contents') { // FIXME
runAttachedRelations(entity, 'runOnNoteContentChange', entity);
} else if (entityName === 'branches') {
const parentNote = becca.getNote(entity.parentNoteId);
if (parentNote?.hasLabel("sorted")) {
treeService.sortNotesIfNeeded(parentNote.noteId);
}
}
});