We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 326b870 + 24c1867 commit 7fc4213Copy full SHA for 7fc4213
src/shared/hooks/useCases/useDiscussionMessagesById.ts
@@ -311,7 +311,15 @@ export const useDiscussionMessagesById = ({
311
312
useDeepCompareEffect(() => {
313
(async () => {
314
- if (!state.data || state.data.length === 0) {
+ 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) {
323
setDiscussionMessagesWithOwners([]);
324
return;
325
}
0 commit comments