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

Commita369df6

Browse files
committed
fix continue
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentb44914a commita369df6

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

‎web-app/src/containers/Start/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ interface ContainerProps {
8686
constStartPageContainer=({ context, send}:ContainerProps)=>{
8787
consttutorial=context.tutorial||undefined
8888
return(
89-
<StartPageonContinue={()=>send('CONTINUE_TUTORIAL')}onNew={()=>send('NEW_TUTORIAL')}tutorial={tutorial}/>
89+
<StartPage
90+
onContinue={()=>send({type:'CONTINUE_TUTORIAL'})}
91+
onNew={()=>send({type:'NEW_TUTORIAL'})}
92+
tutorial={tutorial}
93+
/>
9094
)
9195
}
9296

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

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as TT from 'typings/tutorial'
33
import{assign,send,ActionFunctionMap}from'xstate'
44
import*asselectorsfrom'../../selectors'
55
importonErrorfrom'../../../services/sentry/onError'
6-
importloggerfrom'services/logger'
6+
importloggerfrom'../../../services/logger'
77

88
constcontextActions:ActionFunctionMap<T.MachineContext,T.MachineEvent>={
99
//@ts-ignore
@@ -16,25 +16,20 @@ const contextActions: ActionFunctionMap<T.MachineContext, T.MachineEvent> = {
1616
},
1717
}),
1818
//@ts-ignore
19-
storeContinuedTutorial:assign({
20-
env:(context:T.MachineContext,event:T.MachineEvent)=>{
21-
return{
19+
loadContinuedTutorial:assign((context:T.MachineContext,event:T.MachineEvent):any=>{
20+
return{
21+
env:{
2222
...context.env,
2323
...event.payload.env,
24-
}
25-
},
26-
tutorial:(context:T.MachineContext,event:T.MachineEvent)=>{
27-
returnevent.payload.tutorial
28-
},
29-
progress:(context:T.MachineContext,event:T.MachineEvent)=>{
30-
returnevent.payload.progress
31-
},
32-
position:(context:T.MachineContext,event:T.MachineEvent)=>{
33-
returnevent.payload.position
34-
},
24+
},
25+
tutorial:event.payload.tutorial,
26+
progress:event.payload.progress,
27+
position:event.payload.position,
28+
}
3529
}),
30+
3631
//@ts-ignore
37-
startTutorial:assign({
32+
initProgressPosition:assign({
3833
position:(context:T.MachineContext,event:T.MachineEvent):any=>{
3934
constposition:T.Position=selectors.initialPosition(context)
4035
returnposition

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const createMachine = (options: any) => {
6464
},
6565
LOAD_STORED_TUTORIAL:{
6666
target:'Start',
67-
actions:['storeContinuedTutorial'],
67+
actions:['loadContinuedTutorial'],
6868
},
6969
START_NEW_TUTORIAL:{
7070
target:'Start',
@@ -97,7 +97,7 @@ export const createMachine = (options: any) => {
9797
on:{
9898
NEW_TUTORIAL:'ValidateSetup',
9999
CONTINUE_TUTORIAL:{
100-
target:'StartTutorial',
100+
target:'#tutorial',
101101
actions:['continueConfig'],
102102
},
103103
CONTINUE_FAILED:{
@@ -127,7 +127,7 @@ export const createMachine = (options: any) => {
127127
},
128128
},
129129
StartTutorial:{
130-
onEntry:['startTutorial'],
130+
onEntry:['initProgressPosition'],
131131
after:{
132132
0:'#tutorial',
133133
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp