fix: Updated state logic for reported content (#264)

This commit is contained in:
Ahtisham Shahid
2022-08-29 11:56:08 +05:00
committed by GitHub
parent eb2ece323c
commit 41ee555e88

View File

@@ -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;
},