mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-25 09:41:00 +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.mute" = "Mute";
|
||||||
"account.reject-follow-request-button.accessibility-label" = "Reject follow request";
|
"account.reject-follow-request-button.accessibility-label" = "Reject follow request";
|
||||||
"account.request" = "Request";
|
"account.request" = "Request";
|
||||||
|
"account.request.cancel" = "Cancel follow request";
|
||||||
"account.statuses.post" = "Posts";
|
"account.statuses.post" = "Posts";
|
||||||
"account.statuses.toot" = "Toots";
|
"account.statuses.toot" = "Toots";
|
||||||
"account.statuses-and-replies.post" = "Posts & Replies";
|
"account.statuses-and-replies.post" = "Posts & Replies";
|
||||||
|
|
|
@ -53,8 +53,13 @@ final class AccountHeaderView: UIView {
|
||||||
accountViewModel.isLocked ? "account.request" : "account.follow",
|
accountViewModel.isLocked ? "account.request" : "account.follow",
|
||||||
comment: ""),
|
comment: ""),
|
||||||
for: .normal)
|
for: .normal)
|
||||||
followButton.isHidden = relationship.following
|
followButton.isHidden = relationship.following || relationship.requested
|
||||||
unfollowButton.isHidden = !relationship.following
|
unfollowButton.isHidden = !(relationship.following || relationship.requested)
|
||||||
|
unfollowButton.setTitle(
|
||||||
|
NSLocalizedString(
|
||||||
|
relationship.requested ? "account.request.cancel" : "account.unfollow",
|
||||||
|
comment: ""),
|
||||||
|
for: .normal)
|
||||||
|
|
||||||
relationshipButtonsStackView.isHidden = false
|
relationshipButtonsStackView.isHidden = false
|
||||||
unavailableLabel.isHidden = !relationship.blockedBy
|
unavailableLabel.isHidden = !relationship.blockedBy
|
||||||
|
@ -269,7 +274,7 @@ private extension AccountHeaderView {
|
||||||
guard let accountViewModel = self?.viewModel.accountViewModel else { return }
|
guard let accountViewModel = self?.viewModel.accountViewModel else { return }
|
||||||
|
|
||||||
let unfollowAction = UIAction(
|
let unfollowAction = UIAction(
|
||||||
title: NSLocalizedString("account.unfollow", comment: ""),
|
title: self?.unfollowButton.title(for: .normal) ?? "",
|
||||||
image: UIImage(systemName: "person.badge.minus"),
|
image: UIImage(systemName: "person.badge.minus"),
|
||||||
attributes: .destructive) { _ in
|
attributes: .destructive) { _ in
|
||||||
accountViewModel.unfollow()
|
accountViewModel.unfollow()
|
||||||
|
|
Loading…
Reference in a new issue