From b434fc829a74f89f4e4a0bd17a653dc6426de183 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 12 Aug 2020 17:44:54 +0300 Subject: [PATCH] Fix item cache being deleted on fetch. --- src/store/reducers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/store/reducers.ts b/src/store/reducers.ts index 2cd9ce5..6aba920 100644 --- a/src/store/reducers.ts +++ b/src/store/reducers.ts @@ -155,7 +155,9 @@ export const items = handleActions( }, [actions.setCacheCollection.toString()]: (state: CacheItemsData, action: ActionMeta) => { if (action.payload !== undefined) { - return state.set(action.meta.colUid, ImmutableMap()); + if (!state.has(action.meta.colUid)) { + return state.set(action.meta.colUid, ImmutableMap()); + } } return state; },