@@ -212,11 +212,13 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
212
212
tfUrl = textField().resizableColumn().align(AlignX .FILL ).gap(RightGap .SMALL ).bindText(localWizardModel::coderURL).applyToComponent {
213
213
addActionListener {
214
214
poller?.cancel()
215
+ listTableModelOfWorkspaces.items = emptyList()
215
216
askTokenAndOpenSession(true )
216
217
}
217
218
}.component
218
219
button(CoderGatewayBundle .message(" gateway.connector.view.coder.workspaces.connect.text" )) {
219
220
poller?.cancel()
221
+ listTableModelOfWorkspaces.items = emptyList()
220
222
askTokenAndOpenSession(true )
221
223
}.applyToComponent {
222
224
background = WelcomeScreenUIManager .getMainAssociatedComponentBackground()
@@ -309,9 +311,9 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
309
311
}
310
312
311
313
override fun onInit (wizardModel : CoderWorkspacesWizardModel ) {
312
- enableNextButtonCallback( false )
314
+ listTableModelOfWorkspaces.items = emptyList( )
313
315
if (localWizardModel.coderURL.isNotBlank() && localWizardModel.token.isNotBlank()) {
314
- triggerWorkspacePolling()
316
+ triggerWorkspacePolling(true )
315
317
} else {
316
318
val url = appPropertiesService.getValue(CODER_URL_KEY )
317
319
val token = appPropertiesService.getValue(SESSION_TOKEN )
@@ -434,7 +436,7 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
434
436
435
437
this .indicator.fraction = 1.0
436
438
updateWorkspaceActions()
437
- triggerWorkspacePolling()
439
+ triggerWorkspacePolling(false )
438
440
}
439
441
}
440
442
@@ -465,10 +467,13 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
465
467
return tokenFromUser
466
468
}
467
469
468
- private fun triggerWorkspacePolling () {
470
+ private fun triggerWorkspacePolling (fetchNow : Boolean ) {
469
471
poller?.cancel()
470
472
471
473
poller = cs.launch {
474
+ if (fetchNow) {
475
+ loadWorkspaces()
476
+ }
472
477
while (isActive) {
473
478
delay(5000 )
474
479
loadWorkspaces()
0 commit comments