Skip to content

Commit 6b0bcf9

Browse files
committed
feat(split): improve support for closing any split pane
1 parent 13afe33 commit 6b0bcf9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apps/client/src/widgets/containers/split_note_container.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,11 @@ export default class SplitNoteContainer extends FlexContainer<SplitNoteWidget> {
102102
async closeThisNoteSplitCommand({ ntxId }: CommandListenerData<"closeThisNoteSplit">) {
103103
if (!ntxId) return;
104104
const contexts = appContext.tabManager.noteContexts;
105-
106105
const currentIndex = contexts.findIndex((c) => c.ntxId === ntxId);
107106
if (currentIndex === -1) return;
108107

109-
const isRemoveMainContext = !contexts[currentIndex].mainNtxId;
110-
if (isRemoveMainContext && currentIndex + 1 <= contexts.length) {
108+
const isRemoveMainContext = contexts[currentIndex].isMainContext();
109+
if (isRemoveMainContext && currentIndex + 1 < contexts.length) {
111110
const ntxIds = contexts.map((c) => c.ntxId).filter((c) => !!c) as string[];
112111
this.triggerCommand("noteContextReorder", {
113112
ntxIdsInOrder: ntxIds,

0 commit comments

Comments
 (0)