From 3eb2d04aac114ca4b3adf2211b8c0f8d98c9798c Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 26 Jun 2016 01:45:45 -0700 Subject: minor fixes --- web/src/js/ducks/utils/list.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web/src/js/ducks/utils') 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') } -- cgit v1.2.3