From 73d0580871b919d6b2f32b753dd04d48cc86fbea Mon Sep 17 00:00:00 2001 From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> Date: Sun, 3 Jan 2021 08:56:41 -0800 Subject: [TMA - 459] - Fix for ghost image bug (#159) * Fixed * Fix --- src/store/reducers/userMomentsReducer.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/store/reducers') diff --git a/src/store/reducers/userMomentsReducer.ts b/src/store/reducers/userMomentsReducer.ts index 456ca2fa..97c9a1fd 100644 --- a/src/store/reducers/userMomentsReducer.ts +++ b/src/store/reducers/userMomentsReducer.ts @@ -8,8 +8,18 @@ const userMomentsSlice = createSlice({ userMomentsFetched: (state, action) => { state.moments = action.payload; }, + + momentCategoryDeleted: (state, action) => { + const category = action.payload; + state.moments = state.moments.filter( + (moment) => moment.moment_category !== category, + ); + }, }, }); -export const {userMomentsFetched} = userMomentsSlice.actions; +export const { + userMomentsFetched, + momentCategoryDeleted, +} = userMomentsSlice.actions; export const userMomentsReducer = userMomentsSlice.reducer; -- cgit v1.2.3-70-g09d2