From abf2224d31257b7affb2dfb6693ec41c369d38f6 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 7 Aug 2020 18:25:54 +0300 Subject: [PATCH] Store: clear cache and sync items on logout. --- src/store/reducers.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/store/reducers.ts b/src/store/reducers.ts index 75f7b11..a99426c 100644 --- a/src/store/reducers.ts +++ b/src/store/reducers.ts @@ -110,6 +110,9 @@ export const collections = handleActions( } return state; }, + [actions.logout.toString()]: (state: CacheCollectionsData, _action: any) => { + return state.clear(); + }, }, ImmutableMap({}) ); @@ -162,6 +165,9 @@ export const items = handleActions( } return state; }, + [actions.logout.toString()]: (state: CacheItemsData, _action: any) => { + return state.clear(); + }, }, ImmutableMap({}) );