Avoid throwing when purging (#4489)
* Avoid throwing when purging * Update app/store/index.ts Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com> Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
This commit is contained in:
parent
56c593d36c
commit
cfbb7d4d55
1 changed files with 4 additions and 2 deletions
|
|
@ -187,7 +187,9 @@ export default function configureStore(storage: any, preloadedState: any = {}, o
|
|||
const rootReducer: any = (state: GlobalState, action: GenericAction) => {
|
||||
if (action.type === General.OFFLINE_STORE_PURGE) {
|
||||
// eslint-disable-next-line no-underscore-dangle
|
||||
delete action.data._persist;
|
||||
if (action.data?._persist) {
|
||||
delete action?.data?._persist;
|
||||
}
|
||||
return baseReducer(action.data, action as any);
|
||||
}
|
||||
return baseReducer(state as any, action as any);
|
||||
|
|
@ -230,7 +232,7 @@ export default function configureStore(storage: any, preloadedState: any = {}, o
|
|||
|
||||
store.dispatch({
|
||||
type: General.OFFLINE_STORE_PURGE,
|
||||
state,
|
||||
data: state,
|
||||
});
|
||||
|
||||
console.log('HYDRATED FROM v4', storeKeys); // eslint-disable-line no-console
|
||||
|
|
|
|||
Loading…
Reference in a new issue