Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(split): improve support for closing any split pane
SiriusXT6b0bcf93d369
diff --git a/apps/client/src/widgets/containers/split_note_container.ts b/apps/client/src/widgets/containers/split_note_container.tsindex f29a5fad56..02ed8cf045 100644--- a/apps/client/src/widgets/containers/split_note_container.ts+++ b/apps/client/src/widgets/containers/split_note_container.ts@@ -102,12 +102,11 @@ export default class SplitNoteContainer extends FlexContainer<SplitNoteWidget> {async closeThisNoteSplitCommand({ ntxId }: CommandListenerData<"closeThisNoteSplit">) {if (!ntxId) return;const contexts = appContext.tabManager.noteContexts;-const currentIndex = contexts.findIndex((c) => c.ntxId === ntxId);if (currentIndex === -1) return;- const isRemoveMainContext = !contexts[currentIndex].mainNtxId;- if (isRemoveMainContext && currentIndex + 1 <= contexts.length) {+ const isRemoveMainContext = contexts[currentIndex].isMainContext();+ if (isRemoveMainContext && currentIndex + 1 < contexts.length) {const ntxIds = contexts.map((c) => c.ntxId).filter((c) => !!c) as string[];this.triggerCommand("noteContextReorder", {ntxIdsInOrder: ntxIds,