@@ -38,6 +38,7 @@ class Channel implements Channel {
3838 public receive = async ( action : EditorEvents ) => {
3939 // action may be an object.type or plain string
4040 const actionType : string = typeof action === 'string' ? action : action . type
41+ // @ts -ignore TODO: actual error, fix !
4142 const onError = ( error : CR . ErrorMessage ) => this . send ( { type : 'ERROR' , payload : { error } } )
4243
4344 switch ( actionType ) {
@@ -48,17 +49,18 @@ class Channel implements Channel {
4849 env : {
4950 machineId : vscode . env . machineId ,
5051 sessionId : vscode . env . sessionId ,
52+ token : '' ,
5153 } ,
5254 } ,
5355 } )
5456 return
5557 // continue from tutorial from local storage
56- case 'EDITOR_TUTORIAL_LOAD ' :
58+ case 'EDITOR_LOAD_STORED_TUTORIAL ' :
5759 const tutorial : G . Tutorial | null = this . context . tutorial . get ( )
5860
5961 // new tutorial
6062 if ( ! tutorial || ! tutorial . id || ! tutorial . version ) {
61- this . send ( { type : 'NEW_TUTORIAL ' } )
63+ this . send ( { type : 'NO_CONTINUE ' } )
6264 return
6365 }
6466
@@ -67,21 +69,22 @@ class Channel implements Channel {
6769
6870 if ( progress . complete ) {
6971 // tutorial is already complete
70- this . send ( { type : 'NEW_TUTORIAL ' } )
72+ this . send ( { type : 'NO_CONTINUE ' } )
7173 return
7274 }
7375
7476 // communicate to client the tutorial & stepProgress state
75- this . send ( { type : 'CONTINUE_TUTORIAL ' , payload : { tutorial, progress, position } } )
77+ this . send ( { type : 'CAN_CONTINUE ' , payload : { tutorial, progress, position } } )
7678
7779 return
7880 // clear tutorial local storage
79- case 'TUTORIAL_CLEAR ' :
81+ case 'EDITOR_CLEAR_TUTORIAL_STORAGE ' :
8082 // clear current progress/position/tutorial
8183 this . context . reset ( )
8284 return
8385 // configure test runner, language, git
8486 case 'EDITOR_TUTORIAL_CONFIG' :
87+ // @ts -ignore TODO: fix typings
8588 const tutorialData : G . Tutorial = action . payload . tutorial
8689 // setup tutorial config (save watcher, test runner, etc)
8790 this . context . setTutorial ( this . workspaceState , tutorialData )
@@ -107,17 +110,22 @@ class Channel implements Channel {
107110 onError ,
108111 )
109112 // update the current stepId on startup
113+ // @ts -ignore TODO: fix typings
110114 vscode . commands . executeCommand ( COMMANDS . SET_CURRENT_STEP , action . payload )
111115 return
112116 // load step actions (git commits, commands, open files)
113117 case 'SETUP_ACTIONS' :
118+ // @ts -ignore TODO: fix typings
114119 await vscode . commands . executeCommand ( COMMANDS . SET_CURRENT_STEP , action . payload )
120+ // @ts -ignore TODO: fix typings
115121 setupActions ( this . workspaceRoot , action . payload , this . send )
116122 return
117123 // load solution step actions (git commits, commands, open files)
118124 case 'SOLUTION_ACTIONS' :
125+ // @ts -ignore TODO: fix typings
119126 await solutionActions ( this . workspaceRoot , action . payload , this . send )
120127 // run test following solution to update position
128+ // @ts -ignore TODO: fix typings
121129 vscode . commands . executeCommand ( COMMANDS . RUN_TEST , action . payload )
122130 return
123131
@@ -133,6 +141,7 @@ class Channel implements Channel {
133141 switch ( actionType ) {
134142 case 'TEST_PASS' :
135143 // update local storage stepProgress
144+ // @ts -ignore TODO: fix typings
136145 const progress = this . context . progress . setStepComplete ( action . payload . stepId )
137146 const tutorial = this . context . tutorial . get ( )
138147 if ( ! tutorial ) {
0 commit comments