@@ -32,7 +32,7 @@ export default (editorSend: any) => ({
3232 const step : TT . Step | null = selectors . currentStep ( context )
3333 // load step actions
3434 editorSend ( {
35- type : 'SETUP_ACTIONS ' ,
35+ type : 'EDITOR_LEVEL_ENTER ' ,
3636 payload : {
3737 position : {
3838 stepId : step ?. id || null ,
@@ -48,7 +48,7 @@ export default (editorSend: any) => ({
4848 if ( step && step . setup ) {
4949 // load step actions
5050 editorSend ( {
51- type : 'SETUP_ACTIONS ' ,
51+ type : 'EDITOR_STEP_ENTER ' ,
5252 payload : {
5353 // set position here
5454 position : {
@@ -76,7 +76,7 @@ export default (editorSend: any) => ({
7676 // tell editor to load solution commit
7777 if ( step && step . solution ) {
7878 editorSend ( {
79- type : 'SOLUTION_ACTIONS ' ,
79+ type : 'EDITOR_SOLUTION_ENTER ' ,
8080 payload : {
8181 position : {
8282 stepId : step . id ,
@@ -133,4 +133,29 @@ export default (editorSend: any) => ({
133133 } ,
134134 } )
135135 } ,
136+ onStepComplete ( context : T . MachineContext ) : void {
137+ editorSend ( {
138+ type : 'EDITOR_STEP_COMPLETE' ,
139+ payload : {
140+ levelId : context . position . levelId ,
141+ stepId : context . position . levelId ,
142+ } ,
143+ } )
144+ } ,
145+ onLevelComplete ( context : T . MachineContext ) : void {
146+ editorSend ( {
147+ type : 'EDITOR_LEVEL_COMPLETE' ,
148+ payload : {
149+ levelId : context . position . levelId ,
150+ } ,
151+ } )
152+ } ,
153+ onTutorialComplete ( context : T . MachineContext ) : void {
154+ editorSend ( {
155+ type : 'EDITOR_TUTORIAL_COMPLETE' ,
156+ payload : {
157+ tutorialId : context . tutorial ?. id ,
158+ } ,
159+ } )
160+ } ,
136161} )
0 commit comments