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 = { ...@@ -18,11 +18,9 @@ var update = {
}, },
DESTROY_FRAME: function (state, action) { DESTROY_FRAME: function (state, action) {
var index = state.frames.indexOf(action.frame); return {
if (index >= 0) { frames: state.frames.filter(f => f !== action.frame),
state.frames.splice(index, 1); };
}
return {frames: state.frames};
}, },
UPDATE_FRAME_ANNOTATION_FETCH_STATUS: function (state, action) { 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