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 {
5454return
5555// continue from tutorial from local storage
5656case '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 ) {
6161this . send ( { type :'START_NEW_TUTORIAL' } )
6262return
6363}
@@ -81,23 +81,23 @@ class Channel implements Channel {
8181return
8282// configure test runner, language, git
8383case '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)
8686this . context . setTutorial ( this . workspaceState , tutorialData )
8787
88- const data :G . TutorialData = tutorialData . version . data
88+ const data :TT . TutorialData = tutorialData . data
8989
9090await tutorialConfig ( { config :data . config } , onError )
9191
9292// report back to the webview that setup is complete
9393this . send ( { type :'TUTORIAL_CONFIGURED' } )
9494return
9595case 'EDITOR_TUTORIAL_CONTINUE_CONFIG' :
96- const tutorialContinue :G . Tutorial | null = this . context . tutorial . get ( )
96+ const tutorialContinue :TT . Tutorial | null = this . context . tutorial . get ( )
9797if ( ! tutorialContinue ) {
9898throw new Error ( 'Invalid tutorial to continue' )
9999}
100- const continueConfig :T . TutorialConfig = tutorialContinue . version . data . config
100+ const continueConfig :TT . TutorialConfig = tutorialContinue . data . config
101101await tutorialConfig (
102102{
103103config :continueConfig ,
@@ -148,7 +148,7 @@ class Channel implements Channel {
148148throw 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 )
152152this . context . position . setPositionFromProgress ( tutorial , progress )
153153saveCommit ( )
154154}