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 @@ -174,15 +174,23 @@ class App extends Component {
174174
175175 // time travel bar change
176176 handleBarChange ( e ) {
177- const { data } = this . state ;
177+ const { data, isPlayingIndex } = this . state ;
178178 const { id, action, state } = data [ e . target . value ] ;
179-
179+ // forward or past
180+ const currentIsPlayingIndex = e . target . value ;
181+ const forward = currentIsPlayingIndex > isPlayingIndex ;
180182 this . setState ( {
181183 id,
182184 action,
183185 state,
184- isPlayingIndex : parseInt ( e . target . value ) ,
186+ isPlayingIndex : parseInt ( currentIsPlayingIndex ) ,
185187 } ) ;
188+ // Displays to screen
189+ if ( forward ) {
190+ this . toTheFuture ( ) ;
191+ } else {
192+ this . toThePast ( ) ;
193+ }
186194 }
187195
188196 // function to travel to the FUTURE
You can’t perform that action at this time.
0 commit comments