diff --git a/CHANGELOG.md b/CHANGELOG.md index 09c5e1ee..508a85ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ - support for Gateway 2023 +### Fixed + +- the "Select IDE and Project" button is no longer disabled for a time after + going back a step + +### Changed + +- initial authentication is now asynchronous which means no hang on the main + screen while that happens and it shows in the progress bar + ## 2.1.7 - 2023-02-28 ### Fixed diff --git a/src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt b/src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt index cf262a21..f24d9670 100644 --- a/src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt +++ b/src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt @@ -212,11 +212,13 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) : tfUrl = textField().resizableColumn().align(AlignX.FILL).gap(RightGap.SMALL).bindText(localWizardModel::coderURL).applyToComponent { addActionListener { poller?.cancel() + listTableModelOfWorkspaces.items = emptyList() askTokenAndOpenSession(true) } }.component button(CoderGatewayBundle.message("gateway.connector.view.coder.workspaces.connect.text")) { poller?.cancel() + listTableModelOfWorkspaces.items = emptyList() askTokenAndOpenSession(true) }.applyToComponent { background = WelcomeScreenUIManager.getMainAssociatedComponentBackground() @@ -309,9 +311,9 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) : } override fun onInit(wizardModel: CoderWorkspacesWizardModel) { - enableNextButtonCallback(false) + listTableModelOfWorkspaces.items = emptyList() if (localWizardModel.coderURL.isNotBlank() && localWizardModel.token.isNotBlank()) { - triggerWorkspacePolling() + triggerWorkspacePolling(true) } else { val url = appPropertiesService.getValue(CODER_URL_KEY) val token = appPropertiesService.getValue(SESSION_TOKEN) @@ -434,7 +436,7 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) : this.indicator.fraction = 1.0 updateWorkspaceActions() - triggerWorkspacePolling() + triggerWorkspacePolling(false) } } @@ -465,10 +467,13 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) : return tokenFromUser } - private fun triggerWorkspacePolling() { + private fun triggerWorkspacePolling(fetchNow: Boolean) { poller?.cancel() poller = cs.launch { + if (fetchNow) { + loadWorkspaces() + } while (isActive) { delay(5000) loadWorkspaces()