Skip to content

Commit 9627f7b

Browse files
committed
Fix for the loading status which did not return to false when the list of attachments or pinned messages was empty
1 parent bacabd9 commit 9627f7b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

examples/SampleApp/src/hooks/usePaginatedAttachments.ts

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const usePaginatedAttachments = (
3131

3232
if (!hasMoreResults.current) {
3333
queryInProgress.current = false;
34+
setLoading(false);
3435
return;
3536
}
3637

@@ -50,6 +51,7 @@ export const usePaginatedAttachments = (
5051

5152
if (!newMessages) {
5253
queryInProgress.current = false;
54+
setLoading(false);
5355
return;
5456
}
5557

examples/SampleApp/src/hooks/usePaginatedPinnedMessages.ts

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const usePaginatedPinnedMessages = (channel: Channel<StreamChatGenerics>)
3030

3131
if (!hasMoreResults.current) {
3232
queryInProgress.current = false;
33+
setLoading(false);
3334
return;
3435
}
3536

@@ -48,6 +49,7 @@ export const usePaginatedPinnedMessages = (channel: Channel<StreamChatGenerics>)
4849

4950
if (!newMessages) {
5051
queryInProgress.current = false;
52+
setLoading(false);
5153
return;
5254
}
5355

0 commit comments

Comments
 (0)