11import * as T from 'typings'
2- import * as G from 'typings/graphql '
2+ import * as TT from 'typings/tutorial '
33import * as vscode from 'vscode'
44import saveCommit from '../actions/saveCommit'
55import setupActions from '../actions/setupActions'
@@ -54,10 +54,10 @@ class Channel implements Channel {
5454 return
5555 // continue from tutorial from local storage
5656 case 'EDITOR_TUTORIAL_LOAD' :
57- const tutorial : G . Tutorial | null = this . context . tutorial . get ( )
57+ const tutorial : TT . Tutorial | null = this . context . tutorial . get ( )
5858
5959 // new tutorial
60- if ( ! tutorial || ! tutorial . id || ! tutorial . version ) {
60+ if ( ! tutorial || ! tutorial . id ) {
6161 this . send ( { type : 'START_NEW_TUTORIAL' } )
6262 return
6363 }
@@ -81,23 +81,23 @@ class Channel implements Channel {
8181 return
8282 // configure test runner, language, git
8383 case 'EDITOR_TUTORIAL_CONFIG' :
84- const tutorialData : G . Tutorial = action . payload . tutorial
84+ const tutorialData : TT . Tutorial = action . payload . tutorial
8585 // setup tutorial config (save watcher, test runner, etc)
8686 this . context . setTutorial ( this . workspaceState , tutorialData )
8787
88- const data : G . TutorialData = tutorialData . version . data
88+ const data : TT . TutorialData = tutorialData . data
8989
9090 await tutorialConfig ( { config : data . config } , onError )
9191
9292 // report back to the webview that setup is complete
9393 this . send ( { type : 'TUTORIAL_CONFIGURED' } )
9494 return
9595 case 'EDITOR_TUTORIAL_CONTINUE_CONFIG' :
96- const tutorialContinue : G . Tutorial | null = this . context . tutorial . get ( )
96+ const tutorialContinue : TT . Tutorial | null = this . context . tutorial . get ( )
9797 if ( ! tutorialContinue ) {
9898 throw new Error ( 'Invalid tutorial to continue' )
9999 }
100- const continueConfig : T . TutorialConfig = tutorialContinue . version . data . config
100+ const continueConfig : TT . TutorialConfig = tutorialContinue . data . config
101101 await tutorialConfig (
102102 {
103103 config : continueConfig ,
@@ -148,7 +148,7 @@ class Channel implements Channel {
148148 throw new Error ( 'Error with current tutorial' )
149149 }
150150 // update local storage stepProgress
151- const progress = this . context . progress . setStepComplete ( tutorial . version . data , action . payload . stepId )
151+ const progress = this . context . progress . setStepComplete ( tutorial . data , action . payload . stepId )
152152 this . context . position . setPositionFromProgress ( tutorial , progress )
153153 saveCommit ( )
154154 }
0 commit comments