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

Commitb6a15d8

Browse files
committed
replace load-current with load-next
1 parent0f1255a commitb6a15d8

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

‎src/state/guards/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ export default {
55
const{ data, position, progress}=context
66
conststeps=data.stages[position.stageId].stepList
77
// isn't final step yet
8-
consthasNext=!!position.stepId&&(steps[steps.length-1]!==position.stepId)||!progress.stages[position.stageId]
8+
conststageIncomplete=!progress.stages[position.stageId]
9+
consthasNext=stageIncomplete&&(!!position.stepId&&(steps[steps.length-1]!==position.stepId))
910
console.log('GUARD: hasNextStep',hasNext)
1011
returnhasNext
1112
},

‎src/state/machine.ts

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const machine = (dispatch: CR.EditorDispatch) =>
4747
ContinueTutorial:{
4848
onEntry:['tutorialContinue'],
4949
on:{
50-
TUTORIAL_START:'#tutorial-load-current',
50+
TUTORIAL_START:'#tutorial-load-next',
5151
},
5252
},
5353
},
@@ -57,7 +57,7 @@ export const machine = (dispatch: CR.EditorDispatch) =>
5757
initial:'Initialize',
5858
onEntry:['tutorialSetup'],
5959
on:{
60-
WEBVIEW_INITIALIZED:'#tutorial-load-current'
60+
WEBVIEW_INITIALIZED:'#tutorial-load-next'
6161
},
6262
states:{
6363
Initialize:{
@@ -66,28 +66,24 @@ export const machine = (dispatch: CR.EditorDispatch) =>
6666
0:'Summary',
6767
},
6868
},
69-
LoadCurrent:{
70-
id:'tutorial-load-current',
71-
// TODO: verify current is not complete
72-
after:{
73-
0:'Stage',
74-
},
75-
},
7669
LoadNext:{
7770
id:'tutorial-load-next',
7871
after:{
79-
0:[
80-
{
81-
target:'Stage',
82-
cond:'hasNextStage',
83-
},
84-
{
85-
target:'Level',
86-
cond:'hasNextLevel',
87-
},
88-
{
89-
target:'#completed-tutorial',
90-
},
72+
0:[{
73+
target:'Stage',
74+
cond:'hasNextStep',
75+
},
76+
{
77+
target:'Stage',
78+
cond:'hasNextStage',
79+
},
80+
{
81+
target:'Level',
82+
cond:'hasNextLevel',
83+
},
84+
{
85+
target:'#completed-tutorial',
86+
},
9187
],
9288
},
9389
},

‎typings/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ export interface MachineStateSchema {
148148
states:{
149149
Initialize:{}
150150
Summary:{}
151-
LoadCurrent:{}
152151
LoadNext:{}
153152
Level:{}
154153
Stage:{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp