Skip to content

Commit 5544641

Browse files
committed
refactor: update already assigns the workspace reference
1 parent 5f17562 commit 5544641

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/main/kotlin/com/coder/toolbox/CoderRemoteEnvironment.kt

+3-6
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,19 @@ class CoderRemoteEnvironment(
7272
if (wsRawStatus.canStart() && !workspace.outdated) {
7373
actions.add(Action(context.i18n.ptrl("Start")) {
7474
val build = client.startWorkspace(workspace)
75-
workspace = workspace.copy(latestBuild = build)
76-
update(workspace, agent)
75+
update(workspace.copy(latestBuild = build), agent)
7776
})
7877
}
7978
if (wsRawStatus.canStop()) {
8079
actions.add(Action(context.i18n.ptrl("Stop")) {
8180
val build = client.stopWorkspace(workspace)
82-
workspace = workspace.copy(latestBuild = build)
83-
update(workspace, agent)
81+
update(workspace.copy(latestBuild = build), agent)
8482
})
8583
}
8684
if (workspace.outdated) {
8785
actions.add(Action(context.i18n.ptrl("Update and start")) {
8886
val build = client.updateWorkspace(workspace)
89-
workspace = workspace.copy(latestBuild = build)
90-
update(workspace, agent)
87+
update(workspace.copy(latestBuild = build), agent)
9188
})
9289
}
9390

0 commit comments

Comments
 (0)