Commit 85225124 authored by Sean Roberts's avatar Sean Roberts Committed by GitHub

Merge pull request #489 from hypothesis/destroy-frame-mutation

Avoid mutating frames array in DESTROY_FRAME action.
parents 1d0f782a 5c90a9d3
......@@ -18,11 +18,9 @@ var update = {
},
DESTROY_FRAME: function (state, action) {
var index = state.frames.indexOf(action.frame);
if (index >= 0) {
state.frames.splice(index, 1);
}
return {frames: state.frames};
return {
frames: state.frames.filter(f => f !== action.frame),
};
},
UPDATE_FRAME_ANNOTATION_FETCH_STATUS: function (state, action) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment