FollowButton: show "Follows You" if they follow you

Changelog-Changed: Show "Follow Back" button on profile page
This commit is contained in:
William Casarin
2023-02-07 10:21:21 -08:00
parent b882a96206
commit 09f12845c0
3 changed files with 16 additions and 8 deletions

View File

@@ -19,7 +19,7 @@ enum FollowState {
case unfollows
}
func follow_btn_txt(_ fs: FollowState) -> String {
func follow_btn_txt(_ fs: FollowState, follows_you: Bool) -> String {
switch fs {
case .follows:
return NSLocalizedString("Unfollow", comment: "Button to unfollow a user.")
@@ -28,7 +28,11 @@ func follow_btn_txt(_ fs: FollowState) -> String {
case .unfollowing:
return NSLocalizedString("Unfollowing...", comment: "Label to indicate that the user is in the process of unfollowing another user.")
case .unfollows:
return NSLocalizedString("Follow", comment: "Button to follow a user.")
if follows_you {
return NSLocalizedString("Follow Back", comment: "Button to follow a user back.")
} else {
return NSLocalizedString("Follow", comment: "Button to follow a user.")
}
}
}