33
44import { computeConnColorNum } from "@/app/block/blockutil" ;
55import { TypeAheadModal } from "@/app/modals/typeaheadmodal" ;
6- import {
7- atoms ,
8- createBlock ,
9- getApi ,
10- getConnStatusAtom ,
11- getHostName ,
12- getUserName ,
13- globalStore ,
14- WOS ,
15- } from "@/app/store/global" ;
166import { ConnectionsModel } from "@/app/store/connections-model" ;
7+ import { atoms , createBlock , getConnStatusAtom , getHostName , getUserName , globalStore , WOS } from "@/app/store/global" ;
178import { globalRefocusWithTimeout } from "@/app/store/keymodel" ;
189import { RpcApi } from "@/app/store/wshclientapi" ;
1910import { TabRpcClient } from "@/app/store/wshrpcutil" ;
@@ -108,7 +99,7 @@ function createFilteredLocalSuggestionItem(
10899 iconColor : "var(--grey-text-color)" ,
109100 value : "" ,
110101 label : localName ,
111- current : connection == null ,
102+ current : util . isBlank ( connection ) ,
112103 } ;
113104 return [ localSuggestion ] ;
114105 }
@@ -179,7 +170,7 @@ function getLocalSuggestions(
179170 const wslFiltered = filterConnections ( connList , connSelected , fullConfig , filterOutNowsh ) ;
180171 const wslSuggestionItems = createWslSuggestionItems ( wslFiltered , connection , connStatusMap ) ;
181172 const localSuggestionItem = createFilteredLocalSuggestionItem ( localName , connection , connSelected ) ;
182-
173+
183174 const gitBashItems : Array < SuggestionConnectionItem > = [ ] ;
184175 if ( hasGitBash && "Git Bash" . toLowerCase ( ) . includes ( connSelected . toLowerCase ( ) ) ) {
185176 gitBashItems . push ( {
@@ -191,7 +182,7 @@ function getLocalSuggestions(
191182 current : connection === "local:gitbash" ,
192183 } ) ;
193184 }
194-
185+
195186 const combinedSuggestionItems = [ ...localSuggestionItem , ...gitBashItems , ...wslSuggestionItems ] ;
196187 const sortedSuggestionItems = sortConnSuggestionItems ( combinedSuggestionItems , fullConfig ) ;
197188 if ( sortedSuggestionItems . length == 0 ) {
@@ -250,7 +241,7 @@ function getDisconnectItem(
250241 connection : string ,
251242 connStatusMap : Map < string , ConnStatus >
252243) : SuggestionConnectionItem | null {
253- if ( ! connection ) {
244+ if ( util . isLocalConnName ( connection ) ) {
254245 return null ;
255246 }
256247 const connStatus = connStatusMap . get ( connection ) ;
@@ -418,7 +409,7 @@ const ChangeConnectionBlockModal = React.memo(
418409 oref : WOS . makeORef ( "block" , blockId ) ,
419410 meta : { connection : connName , file : newFile , "cmd:cwd" : null } ,
420411 } ) ;
421-
412+
422413 try {
423414 await RpcApi . ConnEnsureCommand (
424415 TabRpcClient ,
0 commit comments