fix
This commit is contained in:
parent
ad2ef39ace
commit
6915d19fb4
|
@ -633,7 +633,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||
UiUtils.confirmToggleBlockDomain(getActivity(), accountID, account, relationship.domainBlocking, ()->{
|
||||
relationship.domainBlocking=!relationship.domainBlocking;
|
||||
updateRelationship();
|
||||
});
|
||||
}, this::updateRelationship);
|
||||
}else if(id==R.id.hide_boosts){
|
||||
new SetAccountFollowed(account.id, true, !relationship.showingReblogs)
|
||||
.setCallback(new Callback<>(){
|
||||
|
|
|
@ -426,7 +426,7 @@ public class UiUtils{
|
|||
}
|
||||
}
|
||||
|
||||
public static void confirmToggleBlockDomain(Activity activity, String accountID, Account account, boolean currentlyBlocked, Runnable resultCallback){
|
||||
public static void confirmToggleBlockDomain(Activity activity, String accountID, Account account, boolean currentlyBlocked, Runnable resultCallback, Consumer<Relationship> callbackInCaseUserWasBlockedInstead){
|
||||
if(!currentlyBlocked){
|
||||
new BlockDomainConfirmationSheet(activity, account, (onSuccess, onError)->{
|
||||
new SetDomainBlocked(account.getDomain(), true)
|
||||
|
@ -449,7 +449,7 @@ public class UiUtils{
|
|||
.setCallback(new Callback<>(){
|
||||
@Override
|
||||
public void onSuccess(Relationship result){
|
||||
resultCallback.run();
|
||||
callbackInCaseUserWasBlockedInstead.accept(result);
|
||||
onSuccess.run();
|
||||
E.post(new RemoveAccountPostsEvent(accountID, account.id, false));
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ public class AccountViewHolder extends BindableViewHolder<AccountViewModel> impl
|
|||
UiUtils.confirmToggleBlockDomain(fragment.getActivity(), accountID, account, relationship.domainBlocking, ()->{
|
||||
relationship.domainBlocking=!relationship.domainBlocking;
|
||||
bindRelationship();
|
||||
});
|
||||
}, this::updateRelationship);
|
||||
}else if(id==R.id.hide_boosts){
|
||||
new SetAccountFollowed(account.id, true, !relationship.showingReblogs)
|
||||
.setCallback(new Callback<>(){
|
||||
|
|
Loading…
Reference in New Issue