Skip to content

Commit

Permalink
Fix: narrative dataset filters
Browse files Browse the repository at this point in the history
When users change to a slide in a narrative that has the same dataset as
the previous slide, `restoreQueryableStateToDefaults` resets controls
to the _app_ default state which updates the filters state to an empty
object. This leads to the bug described in #1492.

Calling `modifyStateViaMetadata` after `restoreQueryableStateToDefaults`
ensures that all _dataset_ default controls are restored as well.

Resolves #1492.
  • Loading branch information
joverlee521 committed Mar 23, 2022
1 parent 70ac16e commit aa00480
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/actions/recomputeReduxState.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ export const createStateFromQueryOrJSONs = ({
metadata = {...oldState.metadata};
frequencies = {...oldState.frequencies};
controls = restoreQueryableStateToDefaults(controls);
controls = modifyStateViaMetadata(controls, metadata);
}

/* For the creation of state, we want to parse out URL query parameters
Expand Down

0 comments on commit aa00480

Please sign in to comment.