Skip to content

Commit 2f16bf3

Browse files
committed
Pass in selected workspace to executor
No really good reason, just figured since we already have it and we use it in other function calls in the same area we might as well. It does let us avoid the `?` I suppose.
1 parent 738fc07 commit 2f16bf3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class CoderLocateRemoteProjectStepView(private val disableNextAction: () -> Unit
140140

141141
ideResolvingJob = cs.launch {
142142
try {
143-
val executor = withTimeout(Duration.ofSeconds(60)) { createRemoteExecutor() }
143+
val executor = withTimeout(Duration.ofSeconds(60)) { createRemoteExecutor(selectedWorkspace) }
144144
retrieveIDES(executor, selectedWorkspace)
145145
if (ComponentValidator.getInstance(tfProject).isEmpty) {
146146
installRemotePathValidator(executor)
@@ -212,10 +212,10 @@ class CoderLocateRemoteProjectStepView(private val disableNextAction: () -> Unit
212212
})
213213
}
214214

215-
private suspend fun createRemoteExecutor(): HighLevelHostAccessor {
215+
private suspend fun createRemoteExecutor(selectedWorkspace: WorkspaceAgentModel): HighLevelHostAccessor {
216216
return HighLevelHostAccessor.create(
217217
RemoteCredentialsHolder().apply {
218-
setHost("coder.${wizard.selectedWorkspace?.name}")
218+
setHost("coder.${selectedWorkspace.name}")
219219
userName = "coder"
220220
port = 22
221221
authType = AuthType.OPEN_SSH
@@ -352,4 +352,4 @@ class CoderLocateRemoteProjectStepView(private val disableNextAction: () -> Unit
352352
companion object {
353353
val logger = Logger.getInstance(CoderLocateRemoteProjectStepView::class.java.simpleName)
354354
}
355-
}
355+
}

0 commit comments

Comments
 (0)