diff options
| author | Ashm Walia <40498934+ashmgarv@users.noreply.github.com> | 2021-01-03 08:56:41 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-03 11:56:41 -0500 |
| commit | 73d0580871b919d6b2f32b753dd04d48cc86fbea (patch) | |
| tree | 527f58564d9f3ecc78b134c898e10e04ac545a9d /src/store/reducers | |
| parent | ecd10fc394f2d2b6be08cee55f7b9a75ab276ac7 (diff) | |
[TMA - 459] - Fix for ghost image bug (#159)
* Fixed
* Fix
Diffstat (limited to 'src/store/reducers')
| -rw-r--r-- | src/store/reducers/userMomentsReducer.ts | 12 |
1 files changed, 11 insertions, 1 deletions
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; |
