From 2c8141c8bb73325da038c9d582bf106b9af8c4c1 Mon Sep 17 00:00:00 2001 From: jubb Date: Mon, 28 Jun 2021 10:42:34 +1000 Subject: [PATCH] fix: don't let the attachment open to preview if in progress or pending download --- .../securesms/conversation/v2/AlbumThumbnailView.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/AlbumThumbnailView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/AlbumThumbnailView.kt index d895e50743..3df431f446 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/AlbumThumbnailView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/AlbumThumbnailView.kt @@ -71,6 +71,9 @@ class AlbumThumbnailView : FrameLayout { if (Rect.intersects(rawRect, testRect)) { // hit intersects with this particular child val slide = slides.getOrNull(index) ?: return + // only open to downloaded images + if (slide.isInProgress || slide.isPendingDownload) return + ActivityDispatcher.get(context)?.dispatchIntent { context -> MediaPreviewActivity.getPreviewIntent(context, slide, mms) }