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

Commit8f65845

Browse files
committed
cleanup load next
1 parent26d673e commit8f65845

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

‎src/state/actions/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ export default {
103103
returnposition
104104
}
105105
}),
106-
tutorialLoadNext(){
107-
machine.send('LOAD_NEXT')
108-
},
109106
testStart(){
110107
vscode.commands.executeCommand('coderoad.run_test')
111108
},

‎src/state/guards/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ export default {
55
const{ data, position, progress}=context
66
conststeps=data.stages[position.stageId].stepList
77
// isn't final step yet
8+
lethasNext
89
if(steps[steps.length-1]!==position.stepId){
9-
returntrue
10+
hasNext=true
1011
}
1112
// final step is not yet complete
12-
return!progress.steps[position.stepId]
13+
hasNext=!progress.steps[position.stepId]
14+
console.log('GUARD: hasNextStep',hasNext)
15+
returnhasNext
1316
},
1417
hasNextStage:(context:CR.MachineContext):boolean=>{
1518
const{ data, position}=context

‎src/state/machine.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ export const machine = Machine<
7575
},
7676
LoadNext:{
7777
id:'tutorial-load-next',
78-
onEntry:['tutorialLoadNext'],
79-
on:{
80-
LOAD_NEXT:[
78+
after:{
79+
0:[
8180
{
8281
target:'Stage',
8382
cond:'hasNextStage',
@@ -152,7 +151,7 @@ export const machine = Machine<
152151
StageComplete:{
153152
onEntry:'stageComplete',
154153
on:{
155-
NEXT:'#tutorial-load-next',
154+
STAGE_NEXT:'#tutorial-load-next',
156155
},
157156
},
158157
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp