diff --git a/lib/routing.js b/lib/routing.js index 73665fd..46231fd 100644 --- a/lib/routing.js +++ b/lib/routing.js @@ -80,7 +80,6 @@ export const getQueryStringState = query => { } const state = mapper.map(mappings, query) - deserializeCode(state) Object.keys(state).forEach(key => { if (state[key] === '') state[key] = undefined @@ -92,19 +91,9 @@ export const getQueryStringState = query => { export const updateQueryString = state => { if (history.location.search.indexOf('react_perf') < 0) { const mappedState = mapper.map(reverseMappings, state) - serializeCode(mappedState) history.replace({ - search: encodeURI(keysToQuery(mappedState)) + search: encodeURIComponent(keysToQuery(mappedState)) }) } } - -// private -function serializeCode(state) { - if (state.code) state.code = encodeURIComponent(state.code) -} - -function deserializeCode(state) { - if (state.code) state.code = decodeURIComponent(state.code) -}