mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 10:41:14 +00:00
Merge pull request #2801 from weaveworks/dont-resume-time-when-timeline-unmounted
Time Travel: unmount in the shutdown() action
This commit is contained in:
@@ -574,14 +574,16 @@ export function receiveNodesDelta(delta) {
|
||||
|
||||
export function resumeTime() {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({
|
||||
type: ActionTypes.RESUME_TIME
|
||||
});
|
||||
// After unpausing, all of the following calls will re-activate polling.
|
||||
getTopologies(getState, dispatch);
|
||||
getNodes(getState, dispatch, true);
|
||||
if (isResourceViewModeSelector(getState())) {
|
||||
getResourceViewNodesSnapshot(getState(), dispatch);
|
||||
if (isPausedSelector(getState())) {
|
||||
dispatch({
|
||||
type: ActionTypes.RESUME_TIME
|
||||
});
|
||||
// After unpausing, all of the following calls will re-activate polling.
|
||||
getTopologies(getState, dispatch);
|
||||
getNodes(getState, dispatch, true);
|
||||
if (isResourceViewModeSelector(getState())) {
|
||||
getResourceViewNodesSnapshot(getState(), dispatch);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -796,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
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user