mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Add comparator for sorting deposits
This commit is contained in:
parent
ad374bd6ec
commit
17fbc8d22a
1 changed files with 8 additions and 0 deletions
|
@ -246,6 +246,14 @@ public class OfferBookView extends ActivatableViewAndModel<GridPane, OfferBookVi
|
|||
volumeColumn.setComparator(Comparator.comparing(o -> o.getOffer().getMinVolume(), Comparator.nullsFirst(Comparator.naturalOrder())));
|
||||
paymentMethodColumn.setComparator(Comparator.comparing(o -> o.getOffer().getPaymentMethod()));
|
||||
avatarColumn.setComparator(Comparator.comparing(o -> o.getOffer().getOwnerNodeAddress().getFullAddress()));
|
||||
depositColumn.setComparator(Comparator.comparing(o -> {
|
||||
var isSellOffer = o.getOffer().getDirection() == OfferPayload.Direction.SELL;
|
||||
var deposit = isSellOffer ? o.getOffer().getBuyerSecurityDeposit() :
|
||||
o.getOffer().getSellerSecurityDeposit();
|
||||
|
||||
return (deposit == null) ? 0.0 : deposit.getValue() / (double) o.getOffer().getAmount().getValue();
|
||||
|
||||
}, Comparator.nullsFirst(Comparator.naturalOrder())));
|
||||
|
||||
nrOfOffersLabel = new AutoTooltipLabel("");
|
||||
nrOfOffersLabel.setId("num-offers");
|
||||
|
|
Loading…
Add table
Reference in a new issue