Skip to content

Commit

Permalink
Exit time travel mode as a part of the app shutdown().
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarl committed Aug 10, 2017
1 parent f19e4c5 commit 0c78962
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 10 additions & 4 deletions client/app/scripts/actions/app-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,10 +798,16 @@ export function changeInstance() {
}

export function shutdown() {
stopPolling();
teardownWebsockets();
return {
type: ActionTypes.SHUTDOWN
return (dispatch) => {
stopPolling();
teardownWebsockets();
// Exit the time travel mode before unmounting the app.
dispatch({
type: ActionTypes.RESUME_TIME
});
dispatch({
type: ActionTypes.SHUTDOWN
});
};
}

Expand Down
5 changes: 0 additions & 5 deletions client/app/scripts/components/time-travel.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ class TimeTravel extends React.Component {
this.setState(getTimestampStates(props.pausedAt));
}

componentWillUnmount() {
// TODO: Get rid of this somehow. See: https://github.com/weaveworks/service-ui/issues/814
this.props.resumeTime();
}

handleInputChange(ev) {
const timestamp = moment(ev.target.value);
this.setState({ inputValue: ev.target.value });
Expand Down

0 comments on commit 0c78962

Please sign in to comment.