File tree Expand file tree Collapse file tree 4 files changed +10
-5
lines changed
web-app/src/services/state/actions Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import setupActions from './actions/setupActions'
66import solutionActions from './actions/solutionActions'
77
88interface Channel {
9- receive ( action : CR . Action ) : void
9+ receive ( action : CR . Action ) : Promise < void >
1010 send ( action : CR . Action ) : Promise < void >
1111}
1212
@@ -27,14 +27,14 @@ class Channel implements Channel {
2727 }
2828
2929 // receive from webview
30- public receive = ( action : CR . Action ) => {
30+ public receive = async ( action : CR . Action ) => {
3131 const actionType : string = typeof action === 'string' ? action : action . type
3232 console . log ( 'RECEIVED:' , actionType )
3333 switch ( actionType ) {
3434 // continue from tutorial from local storage
3535 case 'TUTORIAL_LOAD_STORED' :
36- const tutorial = this . storage . tutorial . get ( )
37- const stepProgress = this . storage . stepProgress . get ( )
36+ const tutorial = await this . storage . tutorial . get ( )
37+ const stepProgress = await this . storage . stepProgress . get ( )
3838
3939 console . log ( 'looking at stored' )
4040 console . log ( JSON . stringify ( tutorial ) )
Original file line number Diff line number Diff line change @@ -15,13 +15,15 @@ class Storage<T> {
1515 }
1616 public get = async ( ) : Promise < T | null > => {
1717 const value : string | undefined = await this . storage . get ( this . key )
18+ // console.log(`STORAGE.get ${this.key} : ${JSON.stringify(value)}`)
1819 if ( value ) {
1920 return JSON . parse ( value )
2021 }
2122 return null
2223 }
2324 public set = ( value : T ) : void => {
2425 const stringValue = JSON . stringify ( value )
26+ // console.log(`STORAGE.set ${this.key} ${JSON.stringify(value)}`)
2527 this . storage . update ( this . key , stringValue )
2628 }
2729 public update = async ( value : T ) : Promise < void > => {
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ import * as selectors from '../../selectors'
66export default {
77 continueTutorial : ( context : CR . MachineContext , event : CR . MachineEvent ) => {
88
9- const { tutorial, stepProgress} = event . data . payload
9+ const { tutorial, stepProgress} = event . payload
10+ // NOTE: tutorial does not contain levels/stages/steps etc.
1011
1112 const progress : CR . Progress = {
1213 steps : stepProgress ,
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ export default {
1616 throw new Error ( 'Invalid tutorial for tutorial config' )
1717 }
1818 const payload = {
19+ id : tutorial . id ,
20+ version : tutorial . version . version ,
1921 codingLanguage : tutorial . codingLanguage ,
2022 testRunner : tutorial . testRunner ,
2123 repo : tutorial . repo ,
You can’t perform that action at this time.
0 commit comments