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

Commita7f1527

Browse files
committed
continue progress
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parenta23f997 commita7f1527

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

‎src/actions/setupActions.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ import openFiles from './utils/openFiles'
66
importrunCommandsfrom'./utils/runCommands'
77
importonErrorfrom'../services/sentry/onError'
88

9-
asyncfunctionwait(ms:number){
10-
returnnewPromise((resolve)=>{
11-
setTimeout(resolve,ms)
12-
})
13-
}
14-
159
interfaceSetupActions{
1610
actions:TT.StepActions
1711
send:(action:T.Action)=>void// send messages to client
@@ -35,8 +29,6 @@ export const setupActions = async ({ actions, send, path }: SetupActions): Promi
3529
// 3. start file watchers
3630
loadWatchers(watchers||[])
3731

38-
awaitwait(1000)
39-
4032
// 4. run command
4133
awaitrunCommands({commands:commands||[], send, path}).catch(onError)
4234
}

‎src/channel/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,12 @@ class Channel implements Channel {
284284
return
285285
// load step actions (git commits, commands, open files)
286286
case'SETUP_ACTIONS':
287-
awaitvscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload)
288-
setupActions({actions:action.payload,send:this.send})
287+
awaitvscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload.stepId)
288+
setupActions({actions:action.payload.actions,send:this.send})
289289
return
290290
// load solution step actions (git commits, commands, open files)
291291
case'SOLUTION_ACTIONS':
292-
awaitsolutionActions({actions:action.payload,send:this.send})
292+
awaitsolutionActions({actions:action.payload.actions,send:this.send})
293293
// run test following solution to update position
294294
vscode.commands.executeCommand(COMMANDS.RUN_TEST,action.payload.stepId)
295295
return
@@ -326,13 +326,16 @@ class Channel implements Channel {
326326

327327
switch(actionType){
328328
case'TEST_PASS':
329+
logger(`TEST PASS${action.payload.stepId}`)
329330
consttutorial=this.context.tutorial.get()
330331
if(!tutorial){
331332
thrownewError('ERROR: Tutorial not found in test run')
332333
}
333334
// update local storage stepProgress
334-
constprogress=this.context.progress.setStepComplete(tutorial,action.payload.stepId)
335-
this.context.position.setPositionFromProgress(tutorial,progress)
335+
if(action.payload.stepId){
336+
constprogress=this.context.progress.setStepComplete(tutorial,action.payload.stepId)
337+
this.context.position.setPositionFromProgress(tutorial,progress)
338+
}
336339
saveCommit()
337340
}
338341

‎web-app/src/services/state/actions/editor.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,25 @@ export default (editorSend: any) => ({
2929
},
3030
loadLevel(context:CR.MachineContext):void{
3131
constlevel:TT.Level=selectors.currentLevel(context)
32-
logger('loadStep',level)
32+
logger('loadLevel',level)
3333
if(level.setup){
3434
// load step actions
3535
editorSend({
3636
type:'SETUP_ACTIONS',
3737
payload:{
3838
actions:level.setup,
39-
stepId:level.steps.length ?level.steps[0].id :null,
39+
},
40+
})
41+
}
42+
// ensure level step is loaded before first step
43+
constfirstStep=selectors.currentStep(context)
44+
logger('loadFirstStep',firstStep)
45+
if(firstStep){
46+
editorSend({
47+
type:'SETUP_ACTIONS',
48+
payload:{
49+
actions:firstStep.setup,
50+
stepId:firstStep.id,
4051
},
4152
})
4253
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp