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

Commit89795db

Browse files
committed
fix return from tutorial completed
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent3523007 commit89795db

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

‎web-app/src/containers/Tutorial/formatLevels.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const formatLevels = ({ progress, position, levels, testStatus }: Input): Output
3737
stepIndex=levels[levelIndex].steps.length
3838
}
3939

40+
// current level
4041
constlevelUI:T.LevelUI={
4142
...currentLevel,
4243
status:progress.levels[position.levelId] ?'COMPLETE' :'ACTIVE',
@@ -80,6 +81,7 @@ const formatLevels = ({ progress, position, levels, testStatus }: Input): Output
8081
}),
8182
}
8283

84+
// flag all levels before as complete
8385
constcompleted:T.LevelUI[]=levels.slice(0,levelIndex).map((level:TT.Level)=>({
8486
...level,
8587
status:'COMPLETE',
@@ -90,6 +92,7 @@ const formatLevels = ({ progress, position, levels, testStatus }: Input): Output
9092
})),
9193
}))
9294

95+
// flag all levels after as incomplete
9396
constincompleted:T.LevelUI[]=levels.slice(levelIndex+1,levels.length).map((level:TT.Level)=>({
9497
...level,
9598
status:'INCOMPLETE',

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ export const createMachine = (options: any) => {
141141
Tutorial:{
142142
id:'tutorial',
143143
initial:'Level',
144+
on:{
145+
RUN_RESET_TO_POSITION:{
146+
actions:['runResetToPosition'],
147+
target:'Tutorial.Level',
148+
},
149+
},
144150
states:{
145151
Level:{
146152
initial:'Load',
@@ -171,9 +177,6 @@ export const createMachine = (options: any) => {
171177
RUN_RESET:{
172178
actions:['runReset'],
173179
},
174-
RUN_RESET_TO_POSITION:{
175-
actions:['runResetToPosition'],
176-
},
177180
KEY_PRESS_ENTER:{
178181
actions:['runTest'],
179182
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp