File tree 3 files changed +26
-17
lines changed
3 files changed +26
-17
lines changed Original file line number Diff line number Diff line change @@ -89,27 +89,28 @@ export interface MachineStateSchema {
89
89
states : {
90
90
Setup : {
91
91
states : {
92
- Startup : { }
93
- ValidateSetup : { }
94
- Start : { }
95
- SelectTutorial : { }
96
- SetupNewTutorial : { }
97
- StartTutorial : { }
92
+ Startup : Record < string , unknown >
93
+ ValidateSetup : Record < string , unknown >
94
+ Start : Record < string , unknown >
95
+ SelectTutorial : Record < string , unknown >
96
+ SetupNewTutorial : Record < string , unknown >
97
+ StartTutorial : Record < string , unknown >
98
98
}
99
99
}
100
100
Tutorial : {
101
101
states : {
102
102
Level : {
103
103
states : {
104
- Load : { }
105
- Normal : { }
106
- TestRunning : { }
107
- StepNext : { }
108
- LevelComplete : { }
109
- LoadNext : { }
104
+ Load : Record < string , unknown >
105
+ Normal : Record < string , unknown >
106
+ TestRunning : Record < string , unknown >
107
+ StepNext : Record < string , unknown >
108
+ LevelComplete : Record < string , unknown >
109
+ LoadNext : Record < string , unknown >
110
110
}
111
111
}
112
- Completed : { }
112
+ Reset : Record < string , unknown >
113
+ Completed : Record < string , unknown >
113
114
}
114
115
}
115
116
}
Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ const Routes = () => {
42
42
< Route paths = { { Tutorial : { Level : { Load : true } } } } >
43
43
< LoadingPage text = "Loading Level..." processes = { context . processes } />
44
44
</ Route >
45
+ < Route paths = { { Tutorial : { Reset : true } } } >
46
+ < LoadingPage text = "Resetting tutorial..." processes = { context . processes } />
47
+ </ Route >
45
48
< Route paths = { { Tutorial : { Level : true , Completed : true } } } >
46
49
< TutorialPage send = { send } context = { context } state = { route . replace ( 'Tutorial.' , '' ) } />
47
50
</ Route >
Original file line number Diff line number Diff line change @@ -69,7 +69,6 @@ export const createMachine = (options: any) => {
69
69
target : 'SetupNewTutorial' ,
70
70
actions : [ 'setTutorialContext' ] ,
71
71
} ,
72
- // TODO: handle completed tutorial differently
73
72
TUTORIAL_ALREADY_COMPLETE : {
74
73
target : 'Start' ,
75
74
actions : [ 'setStart' ] ,
@@ -168,9 +167,7 @@ export const createMachine = (options: any) => {
168
167
RUN_TEST : {
169
168
actions : [ 'runTest' ] ,
170
169
} ,
171
- RUN_RESET : {
172
- actions : [ 'runReset' ] ,
173
- } ,
170
+ RUN_RESET : '#reset-tutorial' ,
174
171
KEY_PRESS_ENTER : {
175
172
actions : [ 'runTest' ] ,
176
173
} ,
@@ -234,6 +231,14 @@ export const createMachine = (options: any) => {
234
231
} ,
235
232
} ,
236
233
} ,
234
+ Reset : {
235
+ id : 'reset-tutorial' ,
236
+ onEntry : [ 'runReset' ] ,
237
+ onExit : [ 'testClear' ] ,
238
+ after : {
239
+ 3000 : '#tutorial' ,
240
+ } ,
241
+ } ,
237
242
Completed : {
238
243
id : 'completed-tutorial' ,
239
244
on : {
You can’t perform that action at this time.
0 commit comments