1
1
import * as T from 'typings'
2
- import * as G from 'typings/graphql '
2
+ import * as TT from 'typings/tutorial '
3
3
import * as vscode from 'vscode'
4
4
import saveCommit from '../actions/saveCommit'
5
5
import setupActions from '../actions/setupActions'
@@ -54,10 +54,10 @@ class Channel implements Channel {
54
54
return
55
55
// continue from tutorial from local storage
56
56
case 'EDITOR_TUTORIAL_LOAD' :
57
- const tutorial : G . Tutorial | null = this . context . tutorial . get ( )
57
+ const tutorial : TT . Tutorial | null = this . context . tutorial . get ( )
58
58
59
59
// new tutorial
60
- if ( ! tutorial || ! tutorial . id || ! tutorial . version ) {
60
+ if ( ! tutorial || ! tutorial . id ) {
61
61
this . send ( { type : 'START_NEW_TUTORIAL' } )
62
62
return
63
63
}
@@ -81,23 +81,23 @@ class Channel implements Channel {
81
81
return
82
82
// configure test runner, language, git
83
83
case 'EDITOR_TUTORIAL_CONFIG' :
84
- const tutorialData : G . Tutorial = action . payload . tutorial
84
+ const tutorialData : TT . Tutorial = action . payload . tutorial
85
85
// setup tutorial config (save watcher, test runner, etc)
86
86
this . context . setTutorial ( this . workspaceState , tutorialData )
87
87
88
- const data : G . TutorialData = tutorialData . version . data
88
+ const data : TT . TutorialData = tutorialData . data
89
89
90
90
await tutorialConfig ( { config : data . config } , onError )
91
91
92
92
// report back to the webview that setup is complete
93
93
this . send ( { type : 'TUTORIAL_CONFIGURED' } )
94
94
return
95
95
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 ( )
97
97
if ( ! tutorialContinue ) {
98
98
throw new Error ( 'Invalid tutorial to continue' )
99
99
}
100
- const continueConfig : T . TutorialConfig = tutorialContinue . version . data . config
100
+ const continueConfig : TT . TutorialConfig = tutorialContinue . data . config
101
101
await tutorialConfig (
102
102
{
103
103
config : continueConfig ,
@@ -148,7 +148,7 @@ class Channel implements Channel {
148
148
throw new Error ( 'Error with current tutorial' )
149
149
}
150
150
// 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 )
152
152
this . context . position . setPositionFromProgress ( tutorial , progress )
153
153
saveCommit ( )
154
154
}
0 commit comments