fix(tree): navigating to parent note when deleting a non-active note (closes #9380)

This commit is contained in:
Elian Doran
2026-04-11 19:31:44 +03:00
parent b402a7a32b
commit 1c93636538

View File

@@ -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();
}