Skip to content

Commit

Permalink
fix: fixed commentsInThreads[s] is not iterable (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayesha-waris authored Apr 8, 2024
1 parent d7fcc86 commit f282da5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/discussions/post-comments/data/slices.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ const commentsSlice = createSlice({
const newState = { ...state };

newState.status = RequestStatus.SUCCESSFUL;
newState.commentsInThreads = {
...newState.commentsInThreads,
[threadId]: newState.commentsInThreads[threadId] || [],
};

newState.pagination = {
...newState.pagination,
Expand All @@ -49,7 +45,7 @@ const commentsSlice = createSlice({
if (page === 1) {
newState.commentsInThreads = {
...newState.commentsInThreads,
[threadId]: [...payload.commentsInThreads[threadId]] || [],
[threadId]: payload.commentsInThreads[threadId] ? [...payload.commentsInThreads[threadId]] : [],
};
} else {
newState.commentsInThreads = {
Expand Down

0 comments on commit f282da5

Please sign in to comment.