@@ -75,24 +75,22 @@ class Channel implements Channel {
7575 // continue from tutorial from local storage
7676 const tutorial : 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 } = await this . 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 const error = {
9896 type : 'UnknownError' ,
0 commit comments