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

Commit9e2d05a

Browse files
committed
fix level continue issue
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentae49579 commit9e2d05a

File tree

6 files changed

+22
-7
lines changed

6 files changed

+22
-7
lines changed

‎src/channel/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ class Channel implements Channel {
297297
vscode.commands.executeCommand(COMMANDS.RUN_TEST)
298298
return
299299

300+
case'EDITOR_SYNC_PROGRESS':
301+
// update progress when a level is deemed complete in the client
302+
awaitthis.context.progress.syncProgress(action.payload.progress)
303+
return
304+
300305
default:
301306
logger(`No match for action type:${actionType}`)
302307
return

‎src/channel/state/Progress.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ class Progress {
3939
publicreset=()=>{
4040
this.set(defaultValue)
4141
}
42+
publicsyncProgress=(progress:T.Progress):T.Progress=>{
43+
constnext={ ...this.value, ...progress}
44+
returnthis.set(next)
45+
}
4246
publicsetStepComplete=(tutorial:TT.Tutorial,stepId:string):T.Progress=>{
4347
constnext=this.value
4448
// mark step complete

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Menu } from '@alifd/next'
55
import*asselectorsfrom'../../services/selectors'
66
importIconfrom'../../components/Icon'
77
importLevelfrom'./components/Level'
8-
importloggerfrom'services/logger'
8+
importloggerfrom'../../services/logger'
99

1010
interfacePageProps{
1111
context:T.MachineContext

‎web-app/src/environment.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ for (const required of requiredKeys) {
99
exportconstDEBUG:boolean=(process.env.REACT_APP_DEBUG||'').toLowerCase()==='true'
1010
exportconstVERSION:string=process.env.VERSION||'unknown'
1111
exportconstNODE_ENV:string=process.env.NODE_ENV||'development'
12-
exportconstLOG:boolean=
13-
(process.env.REACT_APP_LOG||'').toLowerCase()==='true'&&process.env.NODE_ENV!=='production'
12+
exportconstLOG:boolean=(process.env.REACT_APP_LOG||'').toLowerCase()==='true'
1413
exportconstTUTORIAL_LIST_URL:string=process.env.REACT_APP_TUTORIAL_LIST_URL||''
1514
exportconstSENTRY_DSN:string|null=process.env.REACT_APP_SENTRY_DSN||null

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ export default (editorSend: any) => ({
7474
})
7575
}
7676
},
77+
syncLevelProgress(context:CR.MachineContext):void{
78+
editorSend({
79+
type:'EDITOR_SYNC_PROGRESS',
80+
payload:{
81+
progress:context.progress,
82+
},
83+
})
84+
},
7785
clearStorage():void{
7886
editorSend({type:'TUTORIAL_CLEAR'})
7987
},

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,12 @@ export const createMachine = (options: any) => {
207207
target:'Normal',
208208
actions:['loadStep'],
209209
},
210-
LEVEL_COMPLETE:{
211-
target:'LevelComplete',
212-
actions:['updateLevelProgress'],
213-
},
210+
LEVEL_COMPLETE:'LevelComplete',
214211
},
215212
},
216213
LevelComplete:{
214+
onEntry:['updateLevelProgress'],
215+
onExit:['syncLevelProgress'],
217216
on:{
218217
LEVEL_NEXT:{
219218
target:'#tutorial-load-next',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp