From a68e874fef85d3f7f4fa23137eeda597079f4214 Mon Sep 17 00:00:00 2001 From: ray Date: Tue, 9 Jan 2024 16:29:10 -0800 Subject: [PATCH] DBC22-1469: store config fix --- src/frontend/src/store.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/frontend/src/store.js b/src/frontend/src/store.js index 2e4c306ef..39d7dc889 100644 --- a/src/frontend/src/store.js +++ b/src/frontend/src/store.js @@ -18,30 +18,20 @@ import { } from 'redux-persist'; import localforage from 'localforage'; -import expireReducer from 'redux-persist-expire'; +import storage from 'redux-persist/lib/storage'; -const getConfig = (key, lifeInSeconds) => { - const config = { +const getConfig = (key) => { + return { key: key, storage: localforage, - }; - - if (lifeInSeconds) { - config.transforms = [ - expireReducer('preference', { - expireSeconds: lifeInSeconds, - }) - ]; } - - return config; } const store = configureStore({ reducer: { - cameras: persistReducer(getConfig('cameras', 60), camerasReducer), - cms: persistReducer(getConfig('cms', 60), cmsReducer), - events: persistReducer(getConfig('events', 60), eventsReducer), + cameras: persistReducer(getConfig('cameras'), camerasReducer), + cms: persistReducer(getConfig('cms'), cmsReducer), + events: persistReducer(getConfig('events'), eventsReducer), routes: persistReducer(getConfig('routes'), routesReducer), map: persistReducer(getConfig('map'), mapReducer), },