From a32e08101159c411b7159241dc3ec25e361e9e44 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Mon, 18 Sep 2023 09:26:46 +0200 Subject: [PATCH] fix: wrong channel group shown as selected --- .../github/libretube/ui/fragments/SubscriptionsFragment.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt index d3eafe0051..4c01a90069 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt @@ -193,9 +193,6 @@ class SubscriptionsFragment : Fragment() { val groups = DatabaseHolder.Database.subscriptionGroupsDao().getAll() .sortedBy { it.index } channelGroupsModel.groups.postValue(groups) - withContext(Dispatchers.Main) { - initChannelGroups() - } } } @@ -241,12 +238,13 @@ class SubscriptionsFragment : Fragment() { setOnLongClickListener { // the index must be increased by one to skip the "all channels" group button playByGroup(index + 1) - true } } binding.channelGroups.addView(chip) + + if (index + 1 == selectedFilterGroup) binding.channelGroups.check(chip.id) } }