diff --git a/client/app/scripts/utils/router-utils.js b/client/app/scripts/utils/router-utils.js index ce35ca468..d3576f0f0 100644 --- a/client/app/scripts/utils/router-utils.js +++ b/client/app/scripts/utils/router-utils.js @@ -1,5 +1,4 @@ import page from 'page'; -import { each } from 'lodash'; import { route } from '../actions/app-actions'; import { storageGet, storageSet } from './storage-utils'; @@ -89,20 +88,6 @@ export function updateRoute(getState) { } } -// Temporarily detect old topology options to avoid breaking things between releases -// Related to https://github.com/weaveworks/scope/pull/2404 -function detectOldOptions(topologyOptions) { - let bad = false; - each(topologyOptions, (topology) => { - each(topology, (option) => { - if (typeof option === 'string') { - bad = true; - } - }); - }); - return bad; -} - export function getRouter(dispatch, initialState) { // strip any trailing '/'s. @@ -112,16 +97,11 @@ export function getRouter(dispatch, initialState) { // recover from storage state on empty URL const storageState = storageGet(STORAGE_STATE_KEY); if (storageState) { + // push storage state to URL + window.location.hash = `!/state/${storageState}`; const parsedState = JSON.parse(decodeURL(storageState)); - const dirtyOptions = detectOldOptions(parsedState.topologyOptions); - if (dirtyOptions) { - dispatch(route(initialState)); - } else { - const mergedState = Object.assign(initialState, parsedState); - // push storage state to URL - window.location.hash = `!/state/${JSON.stringify(mergedState)}`; - dispatch(route(mergedState)); - } + const mergedState = Object.assign(initialState, parsedState); + dispatch(route(mergedState)); } else { dispatch(route(initialState)); } @@ -129,12 +109,7 @@ export function getRouter(dispatch, initialState) { page('/state/:state', (ctx) => { const state = JSON.parse(decodeURL(ctx.params.state)); - const dirtyOptions = detectOldOptions(state.topologyOptions); - if (dirtyOptions) { - dispatch(route(initialState)); - } else { - dispatch(route(state)); - } + dispatch(route(state)); }); return page;