Skip to content

Commit

Permalink
bug/CE-232 - fixed modal state persistance (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
marqueone-ps authored Nov 16, 2023
1 parent 76c3fa5 commit 229b31b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion frontend/src/app/store/reducers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { persistReducer } from "redux-persist";
import storage from "redux-persist/lib/storage";
import { combineReducers } from "@reduxjs/toolkit";

import officers from "./reducers/officer";
Expand All @@ -7,8 +9,14 @@ import offices from "./reducers/office";
import codeTables from "./reducers/code-table";
import complaintLocations from "./reducers/complaint-locations";

const appPersistConfig = {
key: "app",
storage: storage,
whitelist: ["profile", "alerts", "notifications", "configurations"],
};

export const rootReducer = combineReducers({
app,
app: persistReducer(appPersistConfig, app),
officers,
offices,
complaints,
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/app/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { rootReducer } from "./reducers";
const persistConfig = {
key: "enforcement",
storage,
whitelist: ["app", "codeTables"],
blacklist: ["app"],
whitelist: ["codeTables"],
};

const persistedReducer = persistReducer(persistConfig, rootReducer);
Expand Down

0 comments on commit 229b31b

Please sign in to comment.