fix confirm unfollow
This commit is contained in:
@@ -804,25 +804,32 @@ public class UiUtils {
|
|||||||
} else if (relationship.muting) {
|
} else if (relationship.muting) {
|
||||||
confirmToggleMuteUser(activity, accountID, account, true, resultCallback);
|
confirmToggleMuteUser(activity, accountID, account, true, resultCallback);
|
||||||
} else {
|
} else {
|
||||||
progressCallback.accept(true);
|
Runnable action=()->{
|
||||||
new SetAccountFollowed(account.id, !relationship.following && !relationship.requested, true, false)
|
progressCallback.accept(true);
|
||||||
.setCallback(new Callback<>() {
|
new SetAccountFollowed(account.id, !relationship.following && !relationship.requested, true)
|
||||||
@Override
|
.setCallback(new Callback<>(){
|
||||||
public void onSuccess(Relationship result) {
|
@Override
|
||||||
resultCallback.accept(result);
|
public void onSuccess(Relationship result){
|
||||||
progressCallback.accept(false);
|
resultCallback.accept(result);
|
||||||
if(!result.following && !result.requested){
|
progressCallback.accept(false);
|
||||||
E.post(new RemoveAccountPostsEvent(accountID, account.id, true));
|
if(!result.following && !result.requested){
|
||||||
|
E.post(new RemoveAccountPostsEvent(accountID, account.id, true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(ErrorResponse error) {
|
public void onError(ErrorResponse error){
|
||||||
error.showToast(activity);
|
error.showToast(activity);
|
||||||
progressCallback.accept(false);
|
progressCallback.accept(false);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.exec(accountID);
|
.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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user