diff --git a/app/src/main/java/com/github/libretube/ui/extensions/SetupSubscriptionButton.kt b/app/src/main/java/com/github/libretube/ui/extensions/SetupSubscriptionButton.kt index 2e060a1d64..d3a1f3b827 100644 --- a/app/src/main/java/com/github/libretube/ui/extensions/SetupSubscriptionButton.kt +++ b/app/src/main/java/com/github/libretube/ui/extensions/SetupSubscriptionButton.kt @@ -26,9 +26,10 @@ fun TextView.setupSubscriptionButton( CoroutineScope(Dispatchers.IO).launch { subscribed = isSubscribed ?: SubscriptionHelper.isSubscribed(channelId) - subscribed?.let { subscribed -> onIsSubscribedChange(subscribed) } withContext(Dispatchers.Main) { + subscribed?.let { subscribed -> onIsSubscribedChange(subscribed) } + if (subscribed == true) { this@setupSubscriptionButton.text = context.getString(R.string.unsubscribe) } else { 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 a23b437045..206f1eeb94 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 @@ -160,7 +160,9 @@ class ChannelFragment : DynamicLayoutManagerFragment() { channelId, channelName, binding.notificationBell - ) + ) { isSubscribed -> + _binding?.addToGroup?.isVisible = isSubscribed + } binding.channelShare.setOnClickListener { val bundle = bundleOf(