diff --git a/client/app/scripts/actions/app-actions.js b/client/app/scripts/actions/app-actions.js index 1cd740407..03350c590 100644 --- a/client/app/scripts/actions/app-actions.js +++ b/client/app/scripts/actions/app-actions.js @@ -405,7 +405,8 @@ export function clickTopology(topologyId) { export function cacheZoomState(zoomState) { return { type: ActionTypes.CACHE_ZOOM_STATE, - zoomState + // Make sure only proper numerical values are cached. + zoomState: zoomState.filter(value => !window.isNaN(value)), }; } diff --git a/client/app/scripts/reducers/root.js b/client/app/scripts/reducers/root.js index 9bbe144f1..1cfafc5bf 100644 --- a/client/app/scripts/reducers/root.js +++ b/client/app/scripts/reducers/root.js @@ -88,7 +88,8 @@ export const initialState = makeMap({ topologyViewMode: GRAPH_VIEW_MODE, version: '...', versionUpdate: null, - viewport: makeMap(), + // Set some initial numerical values to prevent NaN in case of edgy race conditions. + viewport: makeMap({ width: 0, height: 0 }), websocketClosed: false, zoomCache: makeMap(), serviceImages: makeMap()