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