From 7c786e55a5e6f98abc68a73525046d80e1f07bba Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Sat, 10 Jun 2023 14:30:29 -0300 Subject: [PATCH] fix: fix follow button on ProfileFragment --- .../main/java/org/joinmastodon/android/ui/utils/UiUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java index b4a81d770..5996a5536 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java @@ -779,6 +779,8 @@ public class UiUtils { confirmToggleBlockUser(activity, accountID, account, true, resultCallback); } else if (relationship.muting) { confirmToggleMuteUser(activity, accountID, account, true, resultCallback); + } else if (!relationship.following && !relationship.requested) { + follow(activity, accountID, account, true, progressCallback, resultCallback); } else { showConfirmationAlert(activity, activity.getString(R.string.mo_confirm_unfollow_title), @@ -792,6 +794,7 @@ public class UiUtils { } private static void follow(Activity activity, String accountID, Account account, boolean followed, Consumer progressCallback, Consumer resultCallback) { + progressCallback.accept(true); new SetAccountFollowed(account.id, followed, true, false) .setCallback(new Callback<>(){ @Override