File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,16 @@ function LanguageClient ({
7878
7979 useEffect ( ( ) => {
8080 languageClientCount ++
81+ // As soon as a new language client is requested and we have a focus, let's become the active tab
8182 if ( window . document . hasFocus ( ) ) {
8283 writeStorage ( ACTIVE_TAB_LOCAL_STORAGE_KEY , currentTab )
8384 }
85+ return ( ) => {
86+ languageClientCount --
87+ }
88+ } , [ ] )
8489
90+ useEffect ( ( ) => {
8591 setWillShutdown ( false )
8692
8793 if ( shouldShutdownLanguageClientForInactivity || shouldShutdownLanguageClientAsNotActiveTab ) {
@@ -105,7 +111,6 @@ function LanguageClient ({
105111 } )
106112
107113 return ( ) => {
108- languageClientCount --
109114 errorDisposable . dispose ( )
110115 statusChangeDisposable . dispose ( )
111116 // eslint-disable-next-line no-console
You can’t perform that action at this time.
0 commit comments