aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/ducks/utils
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js/ducks/utils')
-rw-r--r--web/src/js/ducks/utils/list.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/web/src/js/ducks/utils/list.js b/web/src/js/ducks/utils/list.js
index a93b2d45..71042d91 100644
--- a/web/src/js/ducks/utils/list.js
+++ b/web/src/js/ducks/utils/list.js
@@ -26,6 +26,7 @@ export default function reduce(state = defaultState, action) {
const data = [...state.data]
const index = state.indexOf[action.id]
+ // FIXME: We should just swallow this
if (index == null) {
throw new Error('Item not found')
}
@@ -35,8 +36,7 @@ export default function reduce(state = defaultState, action) {
return {
...state,
data,
- byId: { ...state.byId, [action.id]: null, [action.item.id]: action.item },
- indexOf: { ...state.indexOf, [action.id]: null, [action.item.id]: index },
+ byId: { ...state.byId, [action.item.id]: action.item },
}
}
@@ -45,6 +45,7 @@ export default function reduce(state = defaultState, action) {
const indexOf = { ...state.indexOf }
const index = indexOf[action.id]
+ // FIXME: We should just swallow this
if (index == null) {
throw new Error('Item not found')
}