Merge pull request #26 from taylorhakes/sweep

Fixed bug in sweep
This commit is contained in:
Dan Abramov 2015-07-23 16:33:40 +03:00
commit a297a3606a

View File

@ -129,7 +129,7 @@ function liftReducer(reducer, initialState) {
case ActionTypes.SWEEP:
stagedActions = stagedActions.filter((_, i) => !skippedActions[i]);
skippedActions = {};
currentStateIndex = Math.max(currentStateIndex, stagedActions.length - 1);
currentStateIndex = Math.min(currentStateIndex, stagedActions.length - 1);
break;
case ActionTypes.PERFORM_ACTION:
if (currentStateIndex === stagedActions.length - 1) {