[SES-2733] Preventing files from being selected in media overview

This commit is contained in:
SessionHero01 2024-09-17 11:18:53 +10:00
parent 01a702ba9c
commit 06095ceeab
No known key found for this signature in database

View File

@ -171,6 +171,11 @@ class MediaOverviewViewModel(
fun onItemClicked(item: MediaOverviewItem) { fun onItemClicked(item: MediaOverviewItem) {
if (inSelectionMode.value) { if (inSelectionMode.value) {
if (item.slide.hasDocument()) {
// We don't support selecting documents in selection mode
return
}
val newSet = mutableSelectedItemIDs.value.toMutableSet() val newSet = mutableSelectedItemIDs.value.toMutableSet()
if (item.id in newSet) { if (item.id in newSet) {
newSet.remove(item.id) newSet.remove(item.id)
@ -213,11 +218,6 @@ class MediaOverviewViewModel(
} }
fun onTabItemClicked(tab: MediaOverviewTab) { fun onTabItemClicked(tab: MediaOverviewTab) {
if (inSelectionMode.value) {
// Not allowing to switch tabs while in selection mode
return
}
mutableSelectedTab.value = tab mutableSelectedTab.value = tab
} }