Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default payment account for an edited offer to null #1583

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public boolean initWithData(OfferPayload.Direction direction, TradeCurrency trad
fillPaymentAccounts();

PaymentAccount account;
PaymentAccount lastSelectedPaymentAccount = preferences.getSelectedPaymentAccountForCreateOffer();
PaymentAccount lastSelectedPaymentAccount = getPreselectedPaymentAccount();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add @nullable annotations for all nullable fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

if (lastSelectedPaymentAccount != null &&
user.getPaymentAccounts() != null &&
user.getPaymentAccounts().contains(lastSelectedPaymentAccount)) {
Expand Down Expand Up @@ -286,6 +286,10 @@ public boolean initWithData(OfferPayload.Direction direction, TradeCurrency trad
return true;
}

protected PaymentAccount getPreselectedPaymentAccount() {
return preferences.getSelectedPaymentAccountForCreateOffer();
}

void onTabSelected(boolean isSelected) {
this.isTabSelected = isSelected;
if (isTabSelected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import bisq.core.offer.OpenOffer;
import bisq.core.offer.OpenOfferManager;
import bisq.core.payment.AccountAgeWitnessService;
import bisq.core.payment.PaymentAccount;
import bisq.core.provider.fee.FeeService;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.user.Preferences;
Expand Down Expand Up @@ -61,6 +62,11 @@ public void initWithData(OpenOffer openOffer) {
this.allowAmountUpdate = false;
}

@Override
protected PaymentAccount getPreselectedPaymentAccount() {
return null;
}

public void populateData() {
Offer offer = openOffer.getOffer();

Expand Down