MediaGallery: Don't create scroll observer if we're still loading

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal 2024-09-25 11:34:20 -05:00 committed by GitHub
parent eb430c46b0
commit d034bd6a08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -185,7 +185,7 @@ export function MediaGallery({
} }
useEffect(() => { useEffect(() => {
if (!scrollObserverRef.current) { if (loading || !scrollObserverRef.current) {
return; return;
} }
@ -228,6 +228,7 @@ export function MediaGallery({
conversationId, conversationId,
haveOldestDocument, haveOldestDocument,
haveOldestMedia, haveOldestMedia,
loading,
loadMoreDocuments, loadMoreDocuments,
loadMoreMedia, loadMoreMedia,
]); ]);