From 06095ceeab810ae02bc2cdcaa679ce12e321cea1 Mon Sep 17 00:00:00 2001 From: SessionHero01 <180888785+SessionHero01@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:18:53 +1000 Subject: [PATCH] [SES-2733] Preventing files from being selected in media overview --- .../securesms/media/MediaOverviewViewModel.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/media/MediaOverviewViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/media/MediaOverviewViewModel.kt index 9eb97a0660..b856745e47 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/media/MediaOverviewViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/media/MediaOverviewViewModel.kt @@ -171,6 +171,11 @@ class MediaOverviewViewModel( fun onItemClicked(item: MediaOverviewItem) { if (inSelectionMode.value) { + if (item.slide.hasDocument()) { + // We don't support selecting documents in selection mode + return + } + val newSet = mutableSelectedItemIDs.value.toMutableSet() if (item.id in newSet) { newSet.remove(item.id) @@ -213,11 +218,6 @@ class MediaOverviewViewModel( } fun onTabItemClicked(tab: MediaOverviewTab) { - if (inSelectionMode.value) { - // Not allowing to switch tabs while in selection mode - return - } - mutableSelectedTab.value = tab }