Skip to content

Commit f282da5

Browse files
authored
fix: fixed commentsInThreads[s] is not iterable (#693)
1 parent d7fcc86 commit f282da5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/discussions/post-comments/data/slices.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ const commentsSlice = createSlice({
3636
const newState = { ...state };
3737

3838
newState.status = RequestStatus.SUCCESSFUL;
39-
newState.commentsInThreads = {
40-
...newState.commentsInThreads,
41-
[threadId]: newState.commentsInThreads[threadId] || [],
42-
};
4339

4440
newState.pagination = {
4541
...newState.pagination,
@@ -49,7 +45,7 @@ const commentsSlice = createSlice({
4945
if (page === 1) {
5046
newState.commentsInThreads = {
5147
...newState.commentsInThreads,
52-
[threadId]: [...payload.commentsInThreads[threadId]] || [],
48+
[threadId]: payload.commentsInThreads[threadId] ? [...payload.commentsInThreads[threadId]] : [],
5349
};
5450
} else {
5551
newState.commentsInThreads = {

0 commit comments

Comments
 (0)