fix: wrong channel group shown as selected

This commit is contained in:
Bnyro 2023-09-18 09:26:46 +02:00
parent 7641024bc9
commit a32e081011

View File

@ -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)
}
}