Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit66ad86a

Browse files
authored
fix: Update workspace wasn't using the latest build (#4001)
This was an oversight in a prior contribution. It broke the updatebutton, but fixed the other cases.
1 parent43f368d commit66ad86a

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

‎site/src/xServices/workspace/workspaceXService.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ export const workspaceMachine = createMachine(
9292
getTemplate:{
9393
data:TypesGen.Template
9494
}
95+
startWorkspaceWithLatestTemplate:{
96+
data:TypesGen.WorkspaceBuild
97+
}
9598
startWorkspace:{
9699
data:TypesGen.WorkspaceBuild
97100
}
@@ -212,7 +215,7 @@ export const workspaceMachine = createMachine(
212215
START:"requestingStart",
213216
STOP:"requestingStop",
214217
ASK_DELETE:"askingDelete",
215-
UPDATE:"refreshingTemplate",
218+
UPDATE:"requestingStartWithLatestTemplate",
216219
CANCEL:"requestingCancel",
217220
},
218221
},
@@ -222,6 +225,21 @@ export const workspaceMachine = createMachine(
222225
CANCEL_DELETE:"idle",
223226
},
224227
},
228+
requestingStartWithLatestTemplate:{
229+
entry:"clearBuildError",
230+
invoke:{
231+
id:"startWorkspaceWithLatestTemplate",
232+
src:"startWorkspaceWithLatestTemplate",
233+
onDone:{
234+
target:"idle",
235+
actions:["assignBuild","refreshTimeline"],
236+
},
237+
onError:{
238+
target:"idle",
239+
actions:["assignBuildError"],
240+
},
241+
},
242+
},
225243
requestingStart:{
226244
entry:"clearBuildError",
227245
invoke:{
@@ -524,6 +542,13 @@ export const workspaceMachine = createMachine(
524542
throwError("Cannot get template without workspace")
525543
}
526544
},
545+
startWorkspaceWithLatestTemplate:async(context)=>{
546+
if(context.workspace&&context.template){
547+
returnawaitAPI.startWorkspace(context.workspace.id,context.template.active_version_id)
548+
}else{
549+
throwError("Cannot start workspace without workspace id")
550+
}
551+
},
527552
startWorkspace:async(context)=>{
528553
if(context.workspace){
529554
returnawaitAPI.startWorkspace(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp