mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-01-31 19:54:35 +03:00
don't auto-commit an error
This commit is contained in:
parent
2ae9279171
commit
c883e837ba
|
@ -235,15 +235,18 @@ function liftReducerWith(reducer, initialCommittedState, monitorReducer, options
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ActionTypes.PERFORM_ACTION: {
|
case ActionTypes.PERFORM_ACTION: {
|
||||||
if (options.maxAge && stagedActionIds.length === options.maxAge) {
|
if (
|
||||||
|
options.maxAge &&
|
||||||
|
stagedActionIds.length === options.maxAge &&
|
||||||
|
!computedStates[1].error
|
||||||
|
) {
|
||||||
// If maxAge has been reached, auto-commit earliest non-@@INIT action.
|
// If maxAge has been reached, auto-commit earliest non-@@INIT action.
|
||||||
delete actionsById[stagedActionIds[1]];
|
delete actionsById[stagedActionIds[1]];
|
||||||
skippedActionIds = skippedActionIds.filter(id => id !== stagedActionIds[1]);
|
skippedActionIds = skippedActionIds.filter(id => id !== stagedActionIds[1]);
|
||||||
stagedActionIds = [0].concat(stagedActionIds.slice(2));
|
stagedActionIds = [0].concat(stagedActionIds.slice(2));
|
||||||
committedState = computedStates[1].state;
|
committedState = computedStates[1].state;
|
||||||
computedStates = computedStates.slice(1);
|
computedStates = computedStates.slice(1);
|
||||||
}
|
} else if (currentStateIndex === stagedActionIds.length - 1) {
|
||||||
if (currentStateIndex === stagedActionIds.length - 1) {
|
|
||||||
currentStateIndex++;
|
currentStateIndex++;
|
||||||
}
|
}
|
||||||
const actionId = nextActionId++;
|
const actionId = nextActionId++;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user