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 ({
78
78
79
79
useEffect ( ( ) => {
80
80
languageClientCount ++
81
+ // As soon as a new language client is requested and we have a focus, let's become the active tab
81
82
if ( window . document . hasFocus ( ) ) {
82
83
writeStorage ( ACTIVE_TAB_LOCAL_STORAGE_KEY , currentTab )
83
84
}
85
+ return ( ) => {
86
+ languageClientCount --
87
+ }
88
+ } , [ ] )
84
89
90
+ useEffect ( ( ) => {
85
91
setWillShutdown ( false )
86
92
87
93
if ( shouldShutdownLanguageClientForInactivity || shouldShutdownLanguageClientAsNotActiveTab ) {
@@ -105,7 +111,6 @@ function LanguageClient ({
105
111
} )
106
112
107
113
return ( ) => {
108
- languageClientCount --
109
114
errorDisposable . dispose ( )
110
115
statusChangeDisposable . dispose ( )
111
116
// eslint-disable-next-line no-console
You can’t perform that action at this time.
0 commit comments