File tree 4 files changed +13
-13
lines changed
4 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -320,17 +320,17 @@ class Channel implements Channel {
320
320
case 'EDITOR_RUN_TEST' :
321
321
vscode . commands . executeCommand ( COMMANDS . RUN_TEST , action ?. payload )
322
322
return
323
- case 'EDITOR_RUN_RESET_SCRIPT' :
324
- const tutorial : TT . Tutorial | null = this . context . tutorial . get ( )
323
+ case 'EDITOR_RUN_RESET' :
324
+ // reset to timeline
325
+ // 1. get last pass commit
326
+ // 2. load timeline until last pass commit
327
+
325
328
// if tutorial.config.reset.command, run it
329
+ const tutorial : TT . Tutorial | null = this . context . tutorial . get ( )
326
330
if ( tutorial ?. config ?. reset ?. command ) {
327
331
await exec ( { command : tutorial . config . reset . command } )
328
332
}
329
333
return
330
- case 'EDITOR_RUN_RESET_TO_LAST_PASS' :
331
- return
332
- case 'EDITOR_RUN_RESET_TO_TIMELINE' :
333
- return
334
334
default :
335
335
logger ( `No match for action type: ${ actionType } ` )
336
336
return
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import StepProgress from './components/StepProgress'
12
12
import { DISPLAY_RUN_TEST_BUTTON } from '../../environment'
13
13
import formatLevels from './formatLevels'
14
14
// import SettingsPage from './containers/Settings'
15
- // import Reset from './components/Reset'
15
+ import Reset from './components/Reset'
16
16
17
17
const styles = {
18
18
header : {
@@ -95,7 +95,7 @@ const TutorialPage = (props: PageProps) => {
95
95
}
96
96
97
97
const onReset = ( ) : void => {
98
- // TODO
98
+ props . send ( { type : 'RUN_RESET' } )
99
99
}
100
100
101
101
const [ menuVisible , setMenuVisible ] = React . useState ( false )
@@ -148,7 +148,7 @@ const TutorialPage = (props: PageProps) => {
148
148
149
149
{ /* Center */ }
150
150
< div css = { { flex : 1 , display : 'flex' , justifyContent : 'center' } } >
151
- { /* <Reset onReset={onReset} disabled={processes.length > 0} /> */ }
151
+ < Reset onReset = { onReset } disabled = { processes . length > 0 } />
152
152
</ div >
153
153
154
154
{ /* Right */ }
Original file line number Diff line number Diff line change @@ -117,9 +117,9 @@ export default (editorSend: any) => ({
117
117
payload : { position : context . position } ,
118
118
} )
119
119
} ,
120
- runResetScript ( ) {
120
+ runReset ( ) {
121
121
editorSend ( {
122
- type : 'EDITOR_RUN_RESET_SCRIPT ' ,
122
+ type : 'EDITOR_RUN_RESET ' ,
123
123
} )
124
124
} ,
125
125
} )
Original file line number Diff line number Diff line change @@ -168,8 +168,8 @@ export const createMachine = (options: any) => {
168
168
RUN_TEST : {
169
169
actions : [ 'runTest' ] ,
170
170
} ,
171
- RESET_SCRIPT : {
172
- actions : [ 'runResetScript ' ] ,
171
+ RUN_RESET : {
172
+ actions : [ 'runReset ' ] ,
173
173
} ,
174
174
} ,
175
175
} ,
You can’t perform that action at this time.
0 commit comments