Skip to content

Commit fc0016b

Browse files
committed
Fix: workspaces are now being refreshed when coming back from IDE&Projects view
- workspaces were no longer refreshed if user came back from the IDE&Projects view - resolves #68
1 parent b75685a commit fc0016b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/main/kotlin/com/coder/gateway/sdk/CoderCLIManager.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ class CoderCLIManager(url: URL, buildVersion: String) {
1111

1212
init {
1313
val os = getOS()
14-
val ext = if (os == OS.WINDOWS) "exe" else ""
1514
val cliName = getCoderCLIForOS(os, getArch())
16-
val filename = if (ext.isBlank()) "${cliName}-${buildVersion}" else "${cliName}-${buildVersion}.${ext}"
15+
val cliNameWithExt = if (os == OS.WINDOWS) "$cliName.exe" else cliName
16+
val filename = if (os == OS.WINDOWS) "${cliName}-${buildVersion}.exe" else "${cliName}-${buildVersion}"
1717

18-
remoteCliPath = URL(url.protocol, url.host, url.port, "/bin/$cliName")
18+
remoteCliPath = URL(url.protocol, url.host, url.port, "/bin/$cliNameWithExt")
1919
localCliPath = Paths.get(System.getProperty("java.io.tmpdir"), filename)
2020
}
2121

src/main/kotlin/com/coder/gateway/views/steps/CoderWorkspacesStepView.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ class CoderWorkspacesStepView(val enableNextButtonCallback: (Boolean) -> Unit) :
219219

220220
override fun onInit(wizardModel: CoderWorkspacesWizardModel) {
221221
enableNextButtonCallback(false)
222+
if (localWizardModel.coderURL.isNotBlank() && localWizardModel.token.isNotBlank()) {
223+
triggerWorkspacePolling()
224+
}
222225
updateWorkspaceActions()
223226
}
224227

0 commit comments

Comments
 (0)