File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
apps/client/src/widgets/containers Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments