Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/app/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,23 @@ class App extends Component {

// time travel bar change
handleBarChange(e) {
const { data } = this.state;
const { data, isPlayingIndex } = this.state;
const { id, action, state } = data[e.target.value];

// forward or past
const currentIsPlayingIndex = e.target.value;
const forward = currentIsPlayingIndex > isPlayingIndex;
this.setState({
id,
action,
state,
isPlayingIndex: parseInt(e.target.value),
isPlayingIndex: parseInt(currentIsPlayingIndex),
});
// Displays to screen
if (forward) {
this.toTheFuture();
} else {
this.toThePast();
}
}

// function to travel to the FUTURE
Expand Down