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

Commit30dd21c

Browse files
committed
fix issues with tutorial init
1 parentccd088b commit30dd21c

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

‎src/channel/state/Progress.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ class Progress {
3535
if(this.storage){
3636
this.storage.set(value)
3737
}
38+
returnthis.value
3839
}
39-
publicsetStepComplete=(stepId:string)=>{
40+
publicsetStepComplete=(stepId:string):CR.Progress=>{
4041
constnext=this.value
4142
next.steps[stepId]=true
42-
this.set(next)
43+
returnthis.set(next)
4344
}
4445
}
4546

‎web-app/src/services/channel/mock.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const createReceiveEvent = (action: Action) => ({
99
//@ts-ignore
1010
window.acquireVsCodeApi=()=>({
1111
postMessage(action:Action){
12-
console.log('postMessage',action)
1312

1413
switch(action.type){
1514
case'TUTORIAL_START':

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@ export default {
1515
returnevent.payload.position
1616
},
1717
}),
18-
setTutorial:assign({
18+
newTutorial:assign({
1919
tutorial:(context:CR.MachineContext,event:CR.MachineEvent):any=>{
20-
const{tutorial}=event.payload
21-
returntutorial
20+
console.log('new tutorial event')
21+
console.log(JSON.stringify(event))
22+
returnevent.payload.tutorial
23+
},
24+
progress:():CR.Progress=>{
25+
return{levels:{},stages:{},steps:{},complete:false}
26+
}
27+
}),
28+
initTutorial:assign({
29+
// loads complete tutorial
30+
tutorial:(context:CR.MachineContext,event:CR.MachineEvent):any=>{
31+
returnevent.payload.tutorial
2232
},
2333
}),
2434
//@ts-ignore

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
4343
on:{
4444
TUTORIAL_START:{
4545
target:'#tutorial',
46-
actions:['setTutorial'],
46+
actions:['newTutorial'],
4747
},
4848
},
4949
},
@@ -89,12 +89,11 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
8989
COMPLETED:'#completed-tutorial'
9090
}
9191
},
92-
9392
Summary:{
9493
on:{
9594
LOAD_TUTORIAL:{
9695
target:'Level',
97-
actions:['initPosition','setTutorial']
96+
actions:['initPosition','initTutorial']
9897
}
9998
},
10099
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp