Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #283 from open-apparel-registry/ki/dump-filter-opt…
Browse files Browse the repository at this point in the history
…ions-on-log-out

Reset filter options state on logout

Connects #278
  • Loading branch information
kellyi committed Mar 11, 2019
2 parents 8473fa1 + a9ac1fa commit cb7bf13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/src/reducers/FacilitiesReducer.js
Expand Up @@ -26,6 +26,8 @@ import {

import { makeFeatureCollectionFromSingleFeature } from '../util/util';

import { completeSubmitLogOut } from '../actions/auth';

const initialState = Object.freeze({
facilities: Object.freeze({
data: null,
Expand Down Expand Up @@ -126,4 +128,5 @@ export default createReducer({
[updateCountryFilter]: clearFacilitiesDataOnFilterChange,
[resetAllFilters]: clearFacilitiesDataOnFilterChange,
[updateAllFilters]: clearFacilitiesDataOnFilterChange,
[completeSubmitLogOut]: clearFacilitiesDataOnFilterChange,
}, initialState);
3 changes: 3 additions & 0 deletions src/app/src/reducers/FiltersReducer.js
Expand Up @@ -16,6 +16,8 @@ import {
completeFetchCountryOptions,
} from '../actions/filterOptions';

import { completeSubmitLogOut } from '../actions/auth';

import {
updateListWithLabels,
} from '../util/util';
Expand Down Expand Up @@ -59,4 +61,5 @@ export default createReducer({
[completeFetchContributorOptions]: maybeSetFromQueryString('contributors'),
[completeFetchContributorTypeOptions]: maybeSetFromQueryString('contributorTypes'),
[completeFetchCountryOptions]: maybeSetFromQueryString('countries'),
[completeSubmitLogOut]: () => initialState,
}, initialState);
3 changes: 3 additions & 0 deletions src/app/src/reducers/UIReducer.js
Expand Up @@ -11,6 +11,8 @@ import {

import { completeFetchFacilities } from '../actions/facilities';

import { completeSubmitLogOut } from '../actions/auth';

import { filterSidebarTabsEnum } from '../util/constants';

const initialState = Object.freeze({
Expand Down Expand Up @@ -65,4 +67,5 @@ export default createReducer({
},
},
}),
[completeSubmitLogOut]: () => initialState,
}, initialState);

0 comments on commit cb7bf13

Please sign in to comment.