We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7fcc86 commit f282da5Copy full SHA for f282da5
src/discussions/post-comments/data/slices.js
@@ -36,10 +36,6 @@ const commentsSlice = createSlice({
36
const newState = { ...state };
37
38
newState.status = RequestStatus.SUCCESSFUL;
39
- newState.commentsInThreads = {
40
- ...newState.commentsInThreads,
41
- [threadId]: newState.commentsInThreads[threadId] || [],
42
- };
43
44
newState.pagination = {
45
...newState.pagination,
@@ -49,7 +45,7 @@ const commentsSlice = createSlice({
49
if (page === 1) {
50
46
newState.commentsInThreads = {
51
47
...newState.commentsInThreads,
52
- [threadId]: [...payload.commentsInThreads[threadId]] || [],
48
+ [threadId]: payload.commentsInThreads[threadId] ? [...payload.commentsInThreads[threadId]] : [],
53
};
54
} else {
55
0 commit comments