From 7ee902620e1b7915a77fa8d699c34aab2e8c3fad Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 26 Sep 2024 02:17:44 +1000 Subject: [PATCH] MediaGallery: Don't create scroll observer if we're still loading --- ts/components/conversation/media-gallery/MediaGallery.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ts/components/conversation/media-gallery/MediaGallery.tsx b/ts/components/conversation/media-gallery/MediaGallery.tsx index 00a8d93655..b3b449bc6c 100644 --- a/ts/components/conversation/media-gallery/MediaGallery.tsx +++ b/ts/components/conversation/media-gallery/MediaGallery.tsx @@ -185,7 +185,7 @@ export function MediaGallery({ } useEffect(() => { - if (!scrollObserverRef.current) { + if (loading || !scrollObserverRef.current) { return; } @@ -228,6 +228,7 @@ export function MediaGallery({ conversationId, haveOldestDocument, haveOldestMedia, + loading, loadMoreDocuments, loadMoreMedia, ]);