Skip to content

Commit af530cd

Browse files
committed
CW-Infinite-spinner-on-proposal-creation Added condition for end loading in empty chats
1 parent 326b870 commit af530cd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/shared/hooks/useCases/useDiscussionMessagesById.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,13 @@ export const useDiscussionMessagesById = ({
311311

312312
useDeepCompareEffect(() => {
313313
(async () => {
314+
if(Array.isArray(state.data) && state.data.length === 0) {
315+
setIsFirstBatchLoaded((prev) => ({
316+
...prev,
317+
[discussionId]: true,
318+
}));
319+
}
320+
314321
if (!state.data || state.data.length === 0) {
315322
setDiscussionMessagesWithOwners([]);
316323
return;

0 commit comments

Comments
 (0)