Skip to content

Commit

Permalink
Removed if statement to force filter reset if url params are provided
Browse files Browse the repository at this point in the history
  • Loading branch information
bo-lu authored Sep 17, 2024
1 parent 3982122 commit 6c229c4
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/reducers/localStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,13 @@ export const loadState = (): StoreEnhancer<unknown, unknown> | undefined => {
return undefined;
}
const state = JSON.parse(serializedState);
if (!checkNestedProperty(state, 'mappingReducer.spatempfilter')) {
state['mappingReducer'].spatempfilter = [];
}
if (!checkNestedProperty(state, 'mappingReducer.spatialfilter')) {
state['mappingReducer'].spatialfilter = [];
}
state['mappingReducer'].spatempfilter = [];
state['mappingReducer'].spatialfilter = [];
state['mappingReducer'].metasrcfilter = { sources: [], dataCollection: '', polarization: '', orbitDirection: '' };
state['mappingReducer'].stacfilter = [];
if (!checkNestedProperty(state, 'mappingReducer.center')) {
state['mappingReducer'].center = [];
}
if (!checkNestedProperty(state, 'mappingReducer.zoom')) {
state['mappingReducer'].zoom = [];
}
if (!checkNestedProperty(state, 'mappingReducer.freezeMapSearch')) {
state['mappingReducer'].freezeMapSearch = { freeze: true };
}
state['mappingReducer'].center = [];
state['mappingReducer'].zoom = [];
state['mappingReducer'].freezeMapSearch = { freeze: true };
return state;
}
} catch (err) {
Expand Down

0 comments on commit 6c229c4

Please sign in to comment.