From 39c95a97c361ff14928f072ec494c23a7bbff6ca Mon Sep 17 00:00:00 2001 From: Filip Barl Date: Thu, 18 Jan 2018 14:50:24 +0100 Subject: [PATCH] Correctly handle Time Travel resuming in Monitor. --- client/app/scripts/actions/app-actions.js | 10 ++++++++++ client/app/scripts/reducers/root.js | 3 --- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/app/scripts/actions/app-actions.js b/client/app/scripts/actions/app-actions.js index 0c9a83916..4816ec1d5 100644 --- a/client/app/scripts/actions/app-actions.js +++ b/client/app/scripts/actions/app-actions.js @@ -788,6 +788,16 @@ export function route(urlState) { state: urlState, type: ActionTypes.ROUTE_TOPOLOGY }); + // Handle Time Travel state update through separate actions as it's more complex. + // This is mostly to handle switching contexts Explore <-> Monitor in WC while + // the timestamp keeps changing - e.g. if we were Time Travelling in Scope and + // then went live in Monitor, switching back to Explore should properly close + // the Time Travel etc, not just update the pausedAt state directly. + if (!urlState.pausedAt) { + dispatch(resumeTime()); + } else { + dispatch(startTimeTravel(urlState.pausedAt)); + } // update all request workers with new options getTopologies(getState, dispatch); getNodes(getState, dispatch); diff --git a/client/app/scripts/reducers/root.js b/client/app/scripts/reducers/root.js index eadefb6f8..8d9e4ad68 100644 --- a/client/app/scripts/reducers/root.js +++ b/client/app/scripts/reducers/root.js @@ -692,9 +692,6 @@ export function rootReducer(state = initialState, action) { pinnedMetricType: action.state.pinnedMetricType }); state = state.set('topologyViewMode', action.state.topologyViewMode); - if (action.state.pausedAt) { - state = state.set('pausedAt', action.state.pausedAt); - } if (action.state.gridSortedBy) { state = state.set('gridSortedBy', action.state.gridSortedBy); }