[bisq-network/bisq] Move Payment account creation and removal from UI to core (#3586)
Bernard Labno
notifications at github.com
Tue Nov 12 11:17:29 UTC 2019
blabno commented on this pull request.
> }
public boolean onDeleteAccount(PaymentAccount paymentAccount) {
- boolean isPaymentAccountUsed = openOfferManager.getObservableList().stream()
- .filter(o -> o.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()))
- .findAny()
- .isPresent();
- isPaymentAccountUsed = isPaymentAccountUsed || tradeManager.getTradableList().stream()
- .filter(t -> t.getOffer().getMakerPaymentAccountId().equals(paymentAccount.getId()) ||
- paymentAccount.getId().equals(t.getTakerPaymentAccountId()))
- .findAny()
- .isPresent();
- if (!isPaymentAccountUsed)
- user.removePaymentAccount(paymentAccount);
- return isPaymentAccountUsed;
+ try {
+ paymentAccountManager.removePaymentAccount(paymentAccount.getId());
Because this method is going to be reused also by the API. I can create 2 methods, one working with PaymentAccount and the other with working with id and delegating to the first one after the lookup.
However I thought it's better to have less code, especially that the performance penalty is insignificant.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3586#discussion_r345148430
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191112/859f6bfc/attachment.html>
More information about the bisq-github
mailing list