Skip to content

Commit

Permalink
CW-Infinite-spinner-on-proposal-creation Added condition for end load…
Browse files Browse the repository at this point in the history
…ing in empty chats
  • Loading branch information
MeyerPV committed Jun 27, 2024
1 parent 326b870 commit af530cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/shared/hooks/useCases/useDiscussionMessagesById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,13 @@ export const useDiscussionMessagesById = ({

useDeepCompareEffect(() => {
(async () => {
if(Array.isArray(state.data) && state.data.length === 0) {
setIsFirstBatchLoaded((prev) => ({
...prev,
[discussionId]: true,
}));
}

if (!state.data || state.data.length === 0) {
setDiscussionMessagesWithOwners([]);
return;
Expand Down

0 comments on commit af530cd

Please sign in to comment.