File tree 3 files changed +19
-23
lines changed
3 files changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ export default {
5
5
const { data, position, progress } = context
6
6
const steps = data . stages [ position . stageId ] . stepList
7
7
// isn't final step yet
8
- const hasNext = ! ! position . stepId && ( steps [ steps . length - 1 ] !== position . stepId ) || ! progress . stages [ position . stageId ]
8
+ const stageIncomplete = ! progress . stages [ position . stageId ]
9
+ const hasNext = stageIncomplete && ( ! ! position . stepId && ( steps [ steps . length - 1 ] !== position . stepId ) )
9
10
console . log ( 'GUARD: hasNextStep' , hasNext )
10
11
return hasNext
11
12
} ,
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export const machine = (dispatch: CR.EditorDispatch) =>
47
47
ContinueTutorial : {
48
48
onEntry : [ 'tutorialContinue' ] ,
49
49
on : {
50
- TUTORIAL_START : '#tutorial-load-current ' ,
50
+ TUTORIAL_START : '#tutorial-load-next ' ,
51
51
} ,
52
52
} ,
53
53
} ,
@@ -57,7 +57,7 @@ export const machine = (dispatch: CR.EditorDispatch) =>
57
57
initial : 'Initialize' ,
58
58
onEntry : [ 'tutorialSetup' ] ,
59
59
on : {
60
- WEBVIEW_INITIALIZED : '#tutorial-load-current '
60
+ WEBVIEW_INITIALIZED : '#tutorial-load-next '
61
61
} ,
62
62
states : {
63
63
Initialize : {
@@ -66,28 +66,24 @@ export const machine = (dispatch: CR.EditorDispatch) =>
66
66
0 : 'Summary' ,
67
67
} ,
68
68
} ,
69
- LoadCurrent : {
70
- id : 'tutorial-load-current' ,
71
- // TODO: verify current is not complete
72
- after : {
73
- 0 : 'Stage' ,
74
- } ,
75
- } ,
76
69
LoadNext : {
77
70
id : 'tutorial-load-next' ,
78
71
after : {
79
- 0 : [
80
- {
81
- target : 'Stage' ,
82
- cond : 'hasNextStage' ,
83
- } ,
84
- {
85
- target : 'Level' ,
86
- cond : 'hasNextLevel' ,
87
- } ,
88
- {
89
- target : '#completed-tutorial' ,
90
- } ,
72
+ 0 : [ {
73
+ target : 'Stage' ,
74
+ cond : 'hasNextStep' ,
75
+ } ,
76
+ {
77
+ target : 'Stage' ,
78
+ cond : 'hasNextStage' ,
79
+ } ,
80
+ {
81
+ target : 'Level' ,
82
+ cond : 'hasNextLevel' ,
83
+ } ,
84
+ {
85
+ target : '#completed-tutorial' ,
86
+ } ,
91
87
] ,
92
88
} ,
93
89
} ,
Original file line number Diff line number Diff line change @@ -148,7 +148,6 @@ export interface MachineStateSchema {
148
148
states : {
149
149
Initialize : { }
150
150
Summary : { }
151
- LoadCurrent : { }
152
151
LoadNext : { }
153
152
Level : { }
154
153
Stage : {
You can’t perform that action at this time.
0 commit comments