11import * as CR from 'typings'
2+ import * as selectors from '../../selectors'
23import channel from '../../channel'
34
45export default {
5- tutorialConfig ( context :CR . MachineContext ) {
6+ initializeTutorial ( context :CR . MachineContext ) {
67// setup test runner and git
78const { tutorial} = context
89if ( ! tutorial ) {
@@ -29,13 +30,34 @@ export default {
2930}
3031} )
3132} ,
32- loadLevel ( ) :void {
33- // load step actions
33+ loadLevel ( context :CR . MachineContext ) :void {
34+ const level = selectors . currentLevel ( context )
35+ if ( level . setup ) {
36+ // load step actions
37+ channel . editorSend ( {
38+ type :'STEP_ACTIONS' ,
39+ payload :level . setup ,
40+ } )
41+ }
3442} ,
35- loadStage ( ) :void {
36- // load step actions
43+ loadStage ( context :CR . MachineContext ) :void {
44+ const stage = selectors . currentStage ( context )
45+ if ( stage . setup ) {
46+ // load step actions
47+ channel . editorSend ( {
48+ type :'STEP_ACTIONS' ,
49+ payload :stage . setup ,
50+ } )
51+ }
3752} ,
38- loadStep ( ) :void {
39- // load step actions
53+ loadStep ( context :CR . MachineContext ) :void {
54+ const step = selectors . currentStep ( context )
55+ if ( step . setup ) {
56+ // load step actions
57+ channel . editorSend ( {
58+ type :'STEP_ACTIONS' ,
59+ payload :step . setup ,
60+ } )
61+ }
4062} ,
4163}