mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
MediaGallery: Load only once with no attachments to show
This commit is contained in:
@@ -160,12 +160,24 @@ export function MediaGallery({
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (media.length > 0 || documents.length > 0) {
|
||||
if (
|
||||
media.length > 0 ||
|
||||
documents.length > 0 ||
|
||||
haveOldestDocument ||
|
||||
haveOldestMedia
|
||||
) {
|
||||
return;
|
||||
}
|
||||
initialLoad(conversationId);
|
||||
loadingRef.current = true;
|
||||
}, [conversationId, initialLoad, media, documents]);
|
||||
}, [
|
||||
conversationId,
|
||||
haveOldestDocument,
|
||||
haveOldestMedia,
|
||||
initialLoad,
|
||||
media,
|
||||
documents,
|
||||
]);
|
||||
|
||||
const previousLoading = usePrevious(loading, loading);
|
||||
if (previousLoading && !loading) {
|
||||
|
||||
Reference in New Issue
Block a user