From 946fe6b91f912a5c8566e7f09e14e898d89b4c4c Mon Sep 17 00:00:00 2001 From: Krunal Patel Date: Tue, 29 Nov 2022 18:10:06 +0530 Subject: [PATCH] Fix channel page to display selected chip content --- .../com/github/libretube/ui/fragments/ChannelFragment.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt index fdf17ffbc..c1af87ffe 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/ChannelFragment.kt @@ -216,6 +216,12 @@ class ChannelFragment : BaseFragment() { } } } + + // Load selected chip content if it's not videos tab. + possibleTabs.firstOrNull { binding.tabChips.checkedChipId == it.chipId }?.let { + val tab = tabs.first { tab -> tab.name == it.identifierName } + loadTab(tab) + } } private fun loadTab(tab: ChannelTab) {