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

Commitab0a4bd

Browse files
committed
fix continue progress
1 parentb324bb3 commitab0a4bd

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

‎src/state/actions/index.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,31 @@ export default {
7878
console.log('ACTION: tutorialLoad.progress')
7979
returncurrentProgress
8080
},
81-
position(){
81+
position(context:any):CR.Position{
8282
console.log('ACTION: tutorialLoad.position')
8383
if(!currentTutorial){
8484
thrownewError('No Tutorial loaded')
8585
}
8686
const{ data}=currentTutorial
87-
88-
constlevelId=data.summary.levelList[0]
89-
conststageId=data.levels[levelId].stageList[0]
90-
conststepId=data.stages[stageId].stepList[0]
87+
constlevelId=data.summary.levelList.find((id:string)=>!currentProgress.levels[id])
88+
if(!levelId){
89+
thrownewError('No level found on position load')
90+
}
91+
conststageId=data.levels[levelId].stageList.find((id:string)=>!currentProgress.stages[id])
92+
if(!stageId){
93+
thrownewError('No stage found on position load')
94+
}
95+
conststepId=data.stages[stageId].stepList.find((id:string)=>!currentProgress.steps[id])
96+
if(!stepId){
97+
thrownewError('No step found on position load')
98+
}
9199

92100
constposition={
93101
levelId,
94102
stageId,
95-
stepId,
103+
stepId
96104
}
97-
105+
console.log('position',position)
98106
returnposition
99107
}
100108
}),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp