Skip to content

Commit

Permalink
Merge pull request #6166 from Bnyro/master
Browse files Browse the repository at this point in the history
fix: hide add to group button when not subscribed
  • Loading branch information
Bnyro authored Jun 21, 2024
2 parents dc029bd + d7abfcf commit 500ae3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ class ChannelFragment : DynamicLayoutManagerFragment() {
channelId,
channelName,
binding.notificationBell
)
) { isSubscribed ->
_binding?.addToGroup?.isVisible = isSubscribed
}

binding.channelShare.setOnClickListener {
val bundle = bundleOf(
Expand Down

0 comments on commit 500ae3a

Please sign in to comment.