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

Commitdf9de6e

Browse files
committed
fix crash on restart
1 parent2d06aac commitdf9de6e

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

‎src/services/position.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ export async function loadProgressPosition() {
6262
storage.setPosition(position)
6363
}
6464

65-
exportasyncfunctiongetPrev():Promise<void>{}
65+
exportasyncfunctiongetPrev():Promise<void>{}

‎src/state/actions/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export default (dispatch: CR.EditorDispatch) => ({
4747
},
4848
tutorialSetup(){
4949
dispatch('coderoad.tutorial_setup',currentTutorial)
50-
dispatch('coderoad.open_webview',2)
5150
},
5251
initializeNewTutorial:assign({
5352
position:(context:any):CR.Position=>{
@@ -88,6 +87,8 @@ export default (dispatch: CR.EditorDispatch) => ({
8887
constlevelId=levelList.find((id:string)=>!currentProgress.levels[id])||levelList[levelList.length-1]
8988
const{ stageList}=data.levels[levelId]
9089
conststageId=stageList.find((id:string)=>!currentProgress.stages[id])||stageList[stageList.length-1]
90+
console.log('position stepList')
91+
console.log(data.stages[stageId])
9192
const{ stepList}=data.stages[stageId]
9293
conststepId=stepList.find((id:string)=>!currentProgress.steps[id])||stepList[stepList.length-1]
9394

‎src/state/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ interface Props {
1212
classStateMachine{
1313
privatedispatch:CR.EditorDispatch
1414
privatemachineOptions={
15-
logger:console.log,
1615
devTools:true,
1716
deferEvents:true,
1817
execute:true,
@@ -24,10 +23,10 @@ class StateMachine {
2423
this.service=interpret(machine,this.machineOptions)
2524
// logging
2625
.onTransition(state=>{
27-
console.log('onTransition',state)
26+
//console.log('onTransition', state)
2827
if(state.changed){
29-
console.log('next state')
30-
console.log(state.value)
28+
//console.log('next state')
29+
//console.log(state.value)
3130
dispatch('coderoad.send_state',{state:state.value,data:state.context})
3231
}else{
3332
dispatch('coderoad.send_data',{data:state.context})
@@ -43,6 +42,7 @@ class StateMachine {
4342
}
4443
publicrefresh(){
4544
console.log('service refresh')
45+
console.log(this.service.state)
4646
const{ value, context}=this.service.state
4747
this.dispatch('coderoad.send_state',{state:value,data:context})
4848
}

‎web-app/src/containers/Tutorial/StagePage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ import DataContext from '../../utils/DataContext'
33
importStagefrom'../../components/Stage'
44

55
interfacePageProps{
6-
send(action:string):void
76
state:any
7+
send(action:string):void
88
}
99

1010
constStagePage=(props:PageProps)=>{
1111
const{ position, data, progress}=React.useContext(DataContext)
1212
const{ stageId}=position
1313
conststage=data.stages[stageId]
1414

15+
if(!stage){
16+
// may throw if no stage is supplied on restart
17+
return<div>No Stage!</div>
18+
}
19+
1520
conststageComplete=progress.stages[stageId]||false
1621

1722
constonNextStage=():void=>{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp