From 41ee555e882cb6629a2e26977cad0dcdf6d3a406 Mon Sep 17 00:00:00 2001 From: Ahtisham Shahid Date: Mon, 29 Aug 2022 11:56:08 +0500 Subject: [PATCH] fix: Updated state logic for reported content (#264) --- src/discussions/posts/data/slices.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/discussions/posts/data/slices.js b/src/discussions/posts/data/slices.js index dfbe947e..afbfcb0e 100644 --- a/src/discussions/posts/data/slices.js +++ b/src/discussions/posts/data/slices.js @@ -127,7 +127,11 @@ const threadsSlice = createSlice({ }, updateThreadSuccess: (state, { payload }) => { state.postStatus = RequestStatus.SUCCESSFUL; - state.threadsById[payload.id] = { ...state.threadsById[payload.id], ...payload }; + state.threadsById[payload.id] = { + ...state.threadsById[payload.id], + ...payload, + abuseFlaggedCount: state.threadsById[payload.id].abuseFlaggedCount || false, + }; state.avatars = { ...state.avatars, ...payload.avatars }; state.threadDraft = null; },