mirror of
https://github.com/zadam/trilium.git
synced 2026-05-07 02:36:07 +02:00
fix(tree): navigating to parent note when deleting a non-active note (closes #9380)
This commit is contained in:
@@ -1614,7 +1614,14 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
await branchService.deleteNotes(branchIds);
|
||||
// Only navigate to parent if deleting the currently active note
|
||||
const activeNoteId = appContext.tabManager.getActiveContext()?.noteId;
|
||||
const isDeletingActiveNote = branchIds.some((branchId) => {
|
||||
const branch = froca.getBranch(branchId);
|
||||
return branch?.noteId === activeNoteId;
|
||||
});
|
||||
|
||||
await branchService.deleteNotes(branchIds, false, isDeletingActiveNote);
|
||||
|
||||
this.clearSelectedNodes();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user