Skip to content

Commit

Permalink
Prevent loosing the global state
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof committed Mar 4, 2020
1 parent 8b2d85a commit 9347c43
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ export const syncQueryStateWithUrl = (
stateContainer: {
...globalQueryStateContainer,
set: state => {
globalQueryStateContainer.set(state || defaultState);
if (typeof state !== 'object' || state === null) {
return;
}
globalQueryStateContainer.set(state);
},
},
storageKey: GLOBAL_STATE_STORAGE_KEY,
Expand Down

0 comments on commit 9347c43

Please sign in to comment.