Skip to content

Commit

Permalink
fix(queryParsing): make sure we always parse the current search query
Browse files Browse the repository at this point in the history
  • Loading branch information
BowlingX committed Dec 5, 2019
1 parent 2a008c1 commit 0e2a64a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ export const immerWithPatches = config => (set, get, api) =>
)

export const converter = (historyInstance: History) => (set, get) => {
const initialQueries = parse(historyInstance.location.search)
const unregisterListener = historyInstance.listen((location, action) => {
// don't handle our own actions
if (
Expand Down Expand Up @@ -283,7 +282,7 @@ export const converter = (historyInstance: History) => (set, get) => {
state.values = { ...initialValues }
state.query = applyFlatConfigToState(
mappedConfig,
initialQueries,
parse(historyInstance.location.search),
ns,
state.values,
state.initialValues
Expand Down

0 comments on commit 0e2a64a

Please sign in to comment.