fix: fix broken Ask before unfollowing option

This commit is contained in:
LucasGGamerM 2023-08-30 11:36:17 -03:00
parent 323018daa9
commit d871d2cad8
2 changed files with 4 additions and 3 deletions

View File

@ -173,7 +173,7 @@ public class SettingsBehaviorFragment extends BaseSettingsFragment<Void> impleme
GlobalUserPreferences.overlayMedia=overlayMediaItem.checked;
GlobalUserPreferences.useCustomTabs=customTabsItem.checked;
GlobalUserPreferences.altTextReminders=altTextItem.checked;
GlobalUserPreferences.confirmUnfollow=customTabsItem.checked;
GlobalUserPreferences.confirmUnfollow=confirmUnfollowItem.checked;
GlobalUserPreferences.confirmBoost=confirmBoostItem.checked;
GlobalUserPreferences.confirmDeletePost=confirmDeleteItem.checked;
GlobalUserPreferences.forwardReportDefault=forwardReportsItem.checked;

View File

@ -792,7 +792,7 @@ public class UiUtils {
confirmToggleMuteUser(activity, accountID, account, true, resultCallback);
} else if (!relationship.following && !relationship.requested) {
follow(activity, accountID, account, true, progressCallback, resultCallback);
} else {
} else if (GlobalUserPreferences.confirmUnfollow){
showConfirmationAlert(activity,
activity.getString(R.string.mo_confirm_unfollow_title),
activity.getString(R.string.mo_confirm_unfollow, account.getDisplayUsername()),
@ -800,8 +800,9 @@ public class UiUtils {
0,
() -> follow(activity, accountID, account, false, progressCallback, resultCallback),
() -> progressCallback.accept(false));
} else {
follow(activity, accountID, account, false, progressCallback, resultCallback);
}
}
private static void follow(Activity activity, String accountID, Account account, boolean followed, Consumer<Boolean> progressCallback, Consumer<Relationship> resultCallback) {