fix confirm unfollow

This commit is contained in:
sk
2023-10-16 00:11:47 +02:00
parent d5d06af614
commit 98e003437c

View File

@@ -804,8 +804,9 @@ public class UiUtils {
} else if (relationship.muting) {
confirmToggleMuteUser(activity, accountID, account, true, resultCallback);
} else {
Runnable action=()->{
progressCallback.accept(true);
new SetAccountFollowed(account.id, !relationship.following && !relationship.requested, true, false)
new SetAccountFollowed(account.id, !relationship.following && !relationship.requested, true)
.setCallback(new Callback<>(){
@Override
public void onSuccess(Relationship result){
@@ -823,6 +824,12 @@ public class UiUtils {
}
})
.exec(accountID);
};
if(relationship.following && GlobalUserPreferences.confirmUnfollow){
showConfirmationAlert(activity, null, activity.getString(R.string.unfollow_confirmation, account.getDisplayUsername()), activity.getString(R.string.unfollow), R.drawable.ic_fluent_person_delete_24_regular, action);
}else{
action.run();
}
}
}