@@ -26,7 +26,6 @@ import com.jetbrains.toolbox.api.ui.ToolboxUi
26
26
import com.jetbrains.toolbox.api.ui.actions.RunnableActionDescription
27
27
import com.jetbrains.toolbox.api.ui.components.AccountDropdownField
28
28
import com.jetbrains.toolbox.api.ui.components.UiPage
29
- import com.jetbrains.toolbox.api.ui.observables.ObservablePropertiesFactory
30
29
import kotlinx.coroutines.CoroutineScope
31
30
import kotlinx.coroutines.Job
32
31
import kotlinx.coroutines.delay
@@ -46,7 +45,6 @@ class CoderRemoteProvider(
46
45
private val ui : ToolboxUi ,
47
46
settingsStore : PluginSettingsStore ,
48
47
secretsStore : PluginSecretStore ,
49
- private val observablePropertiesFactory : ObservablePropertiesFactory ,
50
48
) : RemoteProvider {
51
49
private val logger = LoggerFactory .getLogger(javaClass)
52
50
@@ -98,7 +96,7 @@ class CoderRemoteProvider(
98
96
it.name
99
97
}?.map { agent ->
100
98
// 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)
102
100
lastEnvironments?.firstOrNull { it == env }?.let {
103
101
it.update(ws, agent)
104
102
it
@@ -122,7 +120,7 @@ class CoderRemoteProvider(
122
120
cli.configSsh(newEnvironments.map { it.name }.toSet())
123
121
}
124
122
125
- consumer.consumeEnvironments(environments)
123
+ consumer.consumeEnvironments(environments, true )
126
124
127
125
lastEnvironments = environments
128
126
} catch (_: CancellationException ) {
@@ -157,9 +155,7 @@ class CoderRemoteProvider(
157
155
override fun getAccountDropDown (): AccountDropdownField ? {
158
156
val username = client?.me?.username
159
157
if (username != null ) {
160
- return AccountDropdownField (username) {
161
- logout()
162
- }
158
+ return AccountDropdownField (username, Runnable { logout() })
163
159
}
164
160
return null
165
161
}
@@ -183,7 +179,7 @@ class CoderRemoteProvider(
183
179
pollJob?.cancel()
184
180
client = null
185
181
lastEnvironments = null
186
- consumer.consumeEnvironments(emptyList())
182
+ consumer.consumeEnvironments(emptyList(), true )
187
183
}
188
184
189
185
override fun getName (): String = " Coder Gateway"
0 commit comments