Skip to content

Commit

Permalink
fix Redux related issue
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenWizard2015 committed Feb 9, 2024
1 parent 71b8b59 commit 9ccad0e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { combineReducers, configureStore } from "@reduxjs/toolkit";
import { Provider } from "react-redux";
import { persistStore, persistReducer } from 'redux-persist';
import {
persistReducer, persistStore,
FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER
} from "redux-persist";
import storage from 'redux-persist/lib/storage'; // defaults to localStorage for web

// slices
Expand Down Expand Up @@ -50,6 +53,11 @@ const AppStore = ({ children, preloadedState = {}, returnStore = false }) => {
const store = configureStore({
reducer: persistedReducer,
preloadedState: state,
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
serializableCheck: {
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
}
})
});
const persistor = persistStore(store);

Expand Down

0 comments on commit 9ccad0e

Please sign in to comment.