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

Commitd84d2b0

Browse files
committed
cleanup actions
1 parent5ba31e6 commitd84d2b0

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

‎web-app/src/services/state/actions/context.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,20 @@ const contextActions: ActionFunctionMap<CR.MachineContext, CR.MachineEvent> = {
2727
},
2828
}),
2929
//@ts-ignore
30-
newTutorial:assign({
30+
selectTutorialById:assign({
3131
tutorial:(context:CR.MachineContext,event:CR.MachineEvent):any=>{
3232
returnevent.payload.tutorial
3333
},
34-
progress:():CR.Progress=>{
35-
return{levels:{},steps:{},complete:false}
36-
},
3734
}),
3835
//@ts-ignore
39-
initPosition:assign({
36+
startNewTutorial:assign({
4037
position:(context:CR.MachineContext,event:CR.MachineEvent):CR.Position=>{
41-
console.log('init position')
4238
constposition:CR.Position=selectors.initialPosition(context)
4339
returnposition
4440
},
41+
progress:():CR.Progress=>{
42+
return{levels:{},steps:{},complete:false}
43+
},
4544
}),
4645
//@ts-ignore
4746
updateStepPosition:assign({

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const createMachine = (options: any) => {
7676
on:{
7777
SELECT_TUTORIAL:{
7878
target:'LoadTutorialSummary',
79-
actions:['newTutorial'],
79+
actions:['selectTutorialById'],
8080
},
8181
},
8282
},
@@ -124,7 +124,7 @@ export const createMachine = (options: any) => {
124124
},
125125
},
126126
SetupNewTutorial:{
127-
onEntry:['configureNewTutorial','initPosition'],
127+
onEntry:['configureNewTutorial','startNewTutorial'],
128128
after:{
129129
0:'#tutorial',
130130
},
@@ -142,7 +142,7 @@ export const createMachine = (options: any) => {
142142
},
143143
Tutorial:{
144144
id:'tutorial',
145-
initial:'LoadNext',
145+
initial:'Level',
146146
on:{
147147
// track commands
148148
COMMAND_START:{
@@ -168,7 +168,7 @@ export const createMachine = (options: any) => {
168168
actions:['updatePosition'],
169169
},
170170
NEXT_LEVEL:{
171-
target:'Level',// TODO should return to levels summary page
171+
target:'Level',
172172
actions:['updatePosition'],
173173
},
174174
COMPLETED:'#completed-tutorial',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp