Skip to content

Commit

Permalink
Fix immutability check for error objects
Browse files Browse the repository at this point in the history
Avoid maximum recursion issues when checking the redux store for
immutability and an error has been dispatched.
  • Loading branch information
bjoernricks committed May 8, 2024
1 parent 82566b4 commit 35b94b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/web/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,20 @@ import {

import logger from 'redux-logger';

import Rejection from 'gmp/http/rejection';

import {isDate} from 'gmp/models/date';
import {isEvent} from 'gmp/models/event';

import rootReducer from './reducers';

const isError = obj => obj instanceof Error || obj instanceof Rejection;

const isImmutable = value =>
isDate(value) || isEvent(value) || isImmutableDefault(value);
isDate(value) ||
isEvent(value) ||
isError(value) ||
isImmutableDefault(value);

const configureStore = ({debug = false, testing = false}) => {
return reduxConfigureStore({
Expand Down

0 comments on commit 35b94b7

Please sign in to comment.