diff options
| author | Jason <jason.daurus@gmail.com> | 2016-06-27 18:36:21 +0800 |
|---|---|---|
| committer | Jason <jason.daurus@gmail.com> | 2016-06-27 18:42:20 +0800 |
| commit | 37c2b47c26dea9b143b2720761cdce21dafd3884 (patch) | |
| tree | 5ec4f45e38e69b3af96ecc4372d70cda5bbe0c83 /web/src/js/ducks/utils/view.js | |
| parent | 28531a4dd7acd6dfd32dafca99dcad286041003b (diff) | |
| download | mitmproxy-37c2b47c26dea9b143b2720761cdce21dafd3884.tar.gz mitmproxy-37c2b47c26dea9b143b2720761cdce21dafd3884.tar.bz2 mitmproxy-37c2b47c26dea9b143b2720761cdce21dafd3884.zip | |
[web] add tests for utils
Diffstat (limited to 'web/src/js/ducks/utils/view.js')
| -rwxr-xr-x | web/src/js/ducks/utils/view.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/src/js/ducks/utils/view.js b/web/src/js/ducks/utils/view.js index 2296e454..0349a398 100755 --- a/web/src/js/ducks/utils/view.js +++ b/web/src/js/ducks/utils/view.js @@ -29,7 +29,7 @@ export default function reduce(state = defaultState, action) { return { ...state, data, - indexOf: _.fromPairs(data.map((item, index) => [item.id, index])) + indexOf: _.fromPairs(data.map((item, index) => [item.id, index])), } } @@ -43,7 +43,7 @@ export default function reduce(state = defaultState, action) { } case REMOVE: - if (state.indexOf[action.item.id] == null) { + if (state.indexOf[action.id] == null) { return state } return { @@ -52,7 +52,7 @@ export default function reduce(state = defaultState, action) { } case UPDATE: { - if (state.indexOf[action.item.id] == null) { + if (state.indexOf[action.id] == null) { return } const nextState = { |
