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

This commit is contained in:
Scott Nonnenberg 2024-09-26 02:17:44 +10:00 committed by GitHub
parent 01b087f056
commit 7ee902620e
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,
]);