Skip to content

Commit 7fc4213

Browse files
authored
Merge pull request #2709 from daostack/CW-Infinite-spinner-on-proposal-creation
Infinite spinner in an empty chat of proposal
2 parents 326b870 + 24c1867 commit 7fc4213

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/shared/hooks/useCases/useDiscussionMessagesById.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,15 @@ export const useDiscussionMessagesById = ({
311311

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

0 commit comments

Comments
 (0)