mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
fix: hide add to group button when not subscribed
This commit is contained in:
parent
bf33dcd054
commit
d7abfcfe7f
@ -26,9 +26,10 @@ fun TextView.setupSubscriptionButton(
|
|||||||
|
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
subscribed = isSubscribed ?: SubscriptionHelper.isSubscribed(channelId)
|
subscribed = isSubscribed ?: SubscriptionHelper.isSubscribed(channelId)
|
||||||
subscribed?.let { subscribed -> onIsSubscribedChange(subscribed) }
|
|
||||||
|
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
|
subscribed?.let { subscribed -> onIsSubscribedChange(subscribed) }
|
||||||
|
|
||||||
if (subscribed == true) {
|
if (subscribed == true) {
|
||||||
this@setupSubscriptionButton.text = context.getString(R.string.unsubscribe)
|
this@setupSubscriptionButton.text = context.getString(R.string.unsubscribe)
|
||||||
} else {
|
} else {
|
||||||
|
@ -160,7 +160,9 @@ class ChannelFragment : DynamicLayoutManagerFragment() {
|
|||||||
channelId,
|
channelId,
|
||||||
channelName,
|
channelName,
|
||||||
binding.notificationBell
|
binding.notificationBell
|
||||||
)
|
) { isSubscribed ->
|
||||||
|
_binding?.addToGroup?.isVisible = isSubscribed
|
||||||
|
}
|
||||||
|
|
||||||
binding.channelShare.setOnClickListener {
|
binding.channelShare.setOnClickListener {
|
||||||
val bundle = bundleOf(
|
val bundle = bundleOf(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user