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

Commitcc0d642

Browse files
committed
check tutorial.id locally
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parente577682 commitcc0d642

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

‎src/channel/index.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,22 @@ class Channel implements Channel {
7575
// continue from tutorial from local storage
7676
consttutorial:TT.Tutorial|null=this.context.tutorial.get()
7777

78-
// new tutorial
79-
this.send({type:'START_NEW_TUTORIAL',payload:{ env}})
80-
return
81-
82-
// disable continue until fixed
83-
84-
// // set tutorial
85-
// const { position, progress } = await this.context.setTutorial(this.workspaceState, tutorial)
78+
// no stored tutorial, must start new tutorial
79+
if(!tutorial||!tutorial.id){
80+
this.send({type:'START_NEW_TUTORIAL',payload:{ env}})
81+
return
82+
}
8683

87-
// if (progress.complete) {
88-
// // tutorial is already complete
89-
// this.send({ type: 'TUTORIAL_ALREADY_COMPLETE', payload: { env }})
90-
// return
91-
// }
92-
// // communicate to client the tutorial & stepProgress state
93-
// this.send({ type: 'LOAD_STORED_TUTORIAL', payload: { env, tutorial, progress, position }})
84+
// load continued tutorial position & progress
85+
const{ position, progress}=awaitthis.context.setTutorial(this.workspaceState,tutorial)
9486

95-
// return
87+
if(progress.complete){
88+
// tutorial is already complete
89+
this.send({type:'TUTORIAL_ALREADY_COMPLETE',payload:{ env}})
90+
return
91+
}
92+
// communicate to client the tutorial & stepProgress state
93+
this.send({type:'LOAD_STORED_TUTORIAL',payload:{ env, tutorial, progress, position}})
9694
}catch(e){
9795
consterror={
9896
type:'UnknownError',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp