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

Commitb6501e0

Browse files
committed
prevent commands on reset tutorial
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent032057d commitb6501e0

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

‎typings/index.d.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,27 +89,28 @@ export interface MachineStateSchema {
8989
states:{
9090
Setup:{
9191
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>
9898
}
9999
}
100100
Tutorial:{
101101
states:{
102102
Level:{
103103
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>
110110
}
111111
}
112-
Completed:{}
112+
Reset:Record<string,unknown>
113+
Completed:Record<string,unknown>
113114
}
114115
}
115116
}

‎web-app/src/Routes.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ const Routes = () => {
4242
<Routepaths={{Tutorial:{Level:{Load:true}}}}>
4343
<LoadingPagetext="Loading Level..."processes={context.processes}/>
4444
</Route>
45+
<Routepaths={{Tutorial:{Reset:true}}}>
46+
<LoadingPagetext="Resetting tutorial..."processes={context.processes}/>
47+
</Route>
4548
<Routepaths={{Tutorial:{Level:true,Completed:true}}}>
4649
<TutorialPagesend={send}context={context}state={route.replace('Tutorial.','')}/>
4750
</Route>

‎web-app/src/services/state/machine.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export const createMachine = (options: any) => {
6969
target:'SetupNewTutorial',
7070
actions:['setTutorialContext'],
7171
},
72-
// TODO: handle completed tutorial differently
7372
TUTORIAL_ALREADY_COMPLETE:{
7473
target:'Start',
7574
actions:['setStart'],
@@ -168,9 +167,7 @@ export const createMachine = (options: any) => {
168167
RUN_TEST:{
169168
actions:['runTest'],
170169
},
171-
RUN_RESET:{
172-
actions:['runReset'],
173-
},
170+
RUN_RESET:'#reset-tutorial',
174171
KEY_PRESS_ENTER:{
175172
actions:['runTest'],
176173
},
@@ -234,6 +231,14 @@ export const createMachine = (options: any) => {
234231
},
235232
},
236233
},
234+
Reset:{
235+
id:'reset-tutorial',
236+
onEntry:['runReset'],
237+
onExit:['testClear'],
238+
after:{
239+
3000:'#tutorial',
240+
},
241+
},
237242
Completed:{
238243
id:'completed-tutorial',
239244
on:{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp