mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-21 15:50:59 +00:00
Fix cancel follow request state
This commit is contained in:
parent
aa9842f283
commit
ec20a3072f
2 changed files with 9 additions and 3 deletions
|
@ -25,6 +25,7 @@
|
|||
"account.mute" = "Mute";
|
||||
"account.reject-follow-request-button.accessibility-label" = "Reject follow request";
|
||||
"account.request" = "Request";
|
||||
"account.request.cancel" = "Cancel follow request";
|
||||
"account.statuses.post" = "Posts";
|
||||
"account.statuses.toot" = "Toots";
|
||||
"account.statuses-and-replies.post" = "Posts & Replies";
|
||||
|
|
|
@ -53,8 +53,13 @@ final class AccountHeaderView: UIView {
|
|||
accountViewModel.isLocked ? "account.request" : "account.follow",
|
||||
comment: ""),
|
||||
for: .normal)
|
||||
followButton.isHidden = relationship.following
|
||||
unfollowButton.isHidden = !relationship.following
|
||||
followButton.isHidden = relationship.following || relationship.requested
|
||||
unfollowButton.isHidden = !(relationship.following || relationship.requested)
|
||||
unfollowButton.setTitle(
|
||||
NSLocalizedString(
|
||||
relationship.requested ? "account.request.cancel" : "account.unfollow",
|
||||
comment: ""),
|
||||
for: .normal)
|
||||
|
||||
relationshipButtonsStackView.isHidden = false
|
||||
unavailableLabel.isHidden = !relationship.blockedBy
|
||||
|
@ -269,7 +274,7 @@ private extension AccountHeaderView {
|
|||
guard let accountViewModel = self?.viewModel.accountViewModel else { return }
|
||||
|
||||
let unfollowAction = UIAction(
|
||||
title: NSLocalizedString("account.unfollow", comment: ""),
|
||||
title: self?.unfollowButton.title(for: .normal) ?? "",
|
||||
image: UIImage(systemName: "person.badge.minus"),
|
||||
attributes: .destructive) { _ in
|
||||
accountViewModel.unfollow()
|
||||
|
|
Loading…
Reference in a new issue