@@ -26,7 +26,6 @@ import com.jetbrains.toolbox.api.ui.ToolboxUi
2626import com.jetbrains.toolbox.api.ui.actions.RunnableActionDescription
2727import com.jetbrains.toolbox.api.ui.components.AccountDropdownField
2828import com.jetbrains.toolbox.api.ui.components.UiPage
29- import com.jetbrains.toolbox.api.ui.observables.ObservablePropertiesFactory
3029import kotlinx.coroutines.CoroutineScope
3130import kotlinx.coroutines.Job
3231import kotlinx.coroutines.delay
@@ -46,7 +45,6 @@ class CoderRemoteProvider(
4645 private val ui : ToolboxUi ,
4746 settingsStore : PluginSettingsStore ,
4847 secretsStore : PluginSecretStore ,
49- private val observablePropertiesFactory : ObservablePropertiesFactory ,
5048) : RemoteProvider {
5149 private val logger = LoggerFactory .getLogger(javaClass)
5250
@@ -98,7 +96,7 @@ class CoderRemoteProvider(
9896 it.name
9997 }?.map { agent ->
10098 // If we have an environment already, update that.
101- val env = CoderRemoteEnvironment (client, ws, agent, ui, observablePropertiesFactory )
99+ val env = CoderRemoteEnvironment (client, ws, agent, ui)
102100 lastEnvironments?.firstOrNull { it == env }?.let {
103101 it.update(ws, agent)
104102 it
@@ -122,7 +120,7 @@ class CoderRemoteProvider(
122120 cli.configSsh(newEnvironments.map { it.name }.toSet())
123121 }
124122
125- consumer.consumeEnvironments(environments)
123+ consumer.consumeEnvironments(environments, true )
126124
127125 lastEnvironments = environments
128126 } catch (_: CancellationException ) {
@@ -157,9 +155,7 @@ class CoderRemoteProvider(
157155 override fun getAccountDropDown (): AccountDropdownField ? {
158156 val username = client?.me?.username
159157 if (username != null ) {
160- return AccountDropdownField (username) {
161- logout()
162- }
158+ return AccountDropdownField (username, Runnable { logout() })
163159 }
164160 return null
165161 }
@@ -183,7 +179,7 @@ class CoderRemoteProvider(
183179 pollJob?.cancel()
184180 client = null
185181 lastEnvironments = null
186- consumer.consumeEnvironments(emptyList())
182+ consumer.consumeEnvironments(emptyList(), true )
187183 }
188184
189185 override fun getName (): String = " Coder Gateway"
0 commit comments