File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -172,15 +172,23 @@ class App extends Component {
172172
173173 // time travel bar change
174174 handleBarChange ( e ) {
175- const { data } = this . state ;
175+ const { data, isPlayingIndex } = this . state ;
176176 const { id, action, state } = data [ e . target . value ] ;
177-
177+ // forward or past
178+ const currentIsPlayingIndex = e . target . value ;
179+ const forward = currentIsPlayingIndex > isPlayingIndex ;
178180 this . setState ( {
179181 id,
180182 action,
181183 state,
182- isPlayingIndex : parseInt ( e . target . value ) ,
184+ isPlayingIndex : parseInt ( currentIsPlayingIndex ) ,
183185 } ) ;
186+ // Displays to screen
187+ if ( forward ) {
188+ this . toTheFuture ( ) ;
189+ } else {
190+ this . toThePast ( ) ;
191+ }
184192 }
185193
186194 // function to travel to the FUTURE
You can’t perform that action at this time.
0 commit comments