File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,6 @@ export default {
103103 return position
104104 }
105105 } ) ,
106- tutorialLoadNext ( ) {
107- machine . send ( 'LOAD_NEXT' )
108- } ,
109106 testStart ( ) {
110107 vscode . commands . executeCommand ( 'coderoad.run_test' )
111108 } ,
Original file line number Diff line number Diff line change @@ -5,11 +5,14 @@ export default {
55 const { data, position, progress } = context
66 const steps = data . stages [ position . stageId ] . stepList
77 // isn't final step yet
8+ let hasNext
89 if ( steps [ steps . length - 1 ] !== position . stepId ) {
9- return true
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+ return hasNext
1316 } ,
1417 hasNextStage : ( context : CR . MachineContext ) : boolean => {
1518 const { data, position } = context
Original file line number Diff line number Diff 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 } ,
You can’t perform that action at this time.
0 commit comments