mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Fix sorting issue for Altcoins
This commit is contained in:
parent
d41235cebd
commit
be161669f1
2 changed files with 8 additions and 5 deletions
|
@ -881,13 +881,14 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
||||||
private HBox getPriceAndPercentage(OfferBookListItem item) {
|
private HBox getPriceAndPercentage(OfferBookListItem item) {
|
||||||
Offer offer = item.getOffer();
|
Offer offer = item.getOffer();
|
||||||
boolean useMarketBasedPrice = offer.isUseMarketBasedPrice();
|
boolean useMarketBasedPrice = offer.isUseMarketBasedPrice();
|
||||||
|
boolean isShownAsBuyOffer = OfferViewUtil.isShownAsBuyOffer(offer);
|
||||||
MaterialDesignIcon icon = useMarketBasedPrice ? MaterialDesignIcon.CHART_LINE : MaterialDesignIcon.LOCK;
|
MaterialDesignIcon icon = useMarketBasedPrice ? MaterialDesignIcon.CHART_LINE : MaterialDesignIcon.LOCK;
|
||||||
String info;
|
String info;
|
||||||
|
|
||||||
if (useMarketBasedPrice) {
|
if (useMarketBasedPrice) {
|
||||||
double marketPriceMargin = offer.getMarketPriceMargin();
|
double marketPriceMargin = offer.getMarketPriceMargin();
|
||||||
if (marketPriceMargin == 0) {
|
if (marketPriceMargin == 0) {
|
||||||
if (offer.isBuyOffer()) {
|
if (isShownAsBuyOffer) {
|
||||||
info = Res.get("offerbook.info.sellAtMarketPrice");
|
info = Res.get("offerbook.info.sellAtMarketPrice");
|
||||||
} else {
|
} else {
|
||||||
info = Res.get("offerbook.info.buyAtMarketPrice");
|
info = Res.get("offerbook.info.buyAtMarketPrice");
|
||||||
|
@ -895,13 +896,13 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
||||||
} else {
|
} else {
|
||||||
String absolutePriceMargin = model.getAbsolutePriceMargin(offer);
|
String absolutePriceMargin = model.getAbsolutePriceMargin(offer);
|
||||||
if (marketPriceMargin > 0) {
|
if (marketPriceMargin > 0) {
|
||||||
if (offer.isBuyOffer()) {
|
if (isShownAsBuyOffer) {
|
||||||
info = Res.get("offerbook.info.sellBelowMarketPrice", absolutePriceMargin);
|
info = Res.get("offerbook.info.sellBelowMarketPrice", absolutePriceMargin);
|
||||||
} else {
|
} else {
|
||||||
info = Res.get("offerbook.info.buyAboveMarketPrice", absolutePriceMargin);
|
info = Res.get("offerbook.info.buyAboveMarketPrice", absolutePriceMargin);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (offer.isBuyOffer()) {
|
if (isShownAsBuyOffer) {
|
||||||
info = Res.get("offerbook.info.sellAboveMarketPrice", absolutePriceMargin);
|
info = Res.get("offerbook.info.sellAboveMarketPrice", absolutePriceMargin);
|
||||||
} else {
|
} else {
|
||||||
info = Res.get("offerbook.info.buyBelowMarketPrice", absolutePriceMargin);
|
info = Res.get("offerbook.info.buyBelowMarketPrice", absolutePriceMargin);
|
||||||
|
@ -909,7 +910,7 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (offer.isBuyOffer()) {
|
if (isShownAsBuyOffer) {
|
||||||
info = Res.get("offerbook.info.sellAtFixedPrice");
|
info = Res.get("offerbook.info.sellAtFixedPrice");
|
||||||
} else {
|
} else {
|
||||||
info = Res.get("offerbook.info.buyAtFixedPrice");
|
info = Res.get("offerbook.info.buyAtFixedPrice");
|
||||||
|
|
|
@ -421,7 +421,9 @@ abstract class OfferBookViewModel extends ActivatableViewModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<Double> getMarketBasedPrice(Offer offer) {
|
public Optional<Double> getMarketBasedPrice(Offer offer) {
|
||||||
return priceUtil.getMarketBasedPrice(offer, direction);
|
OfferDirection displayDirection = offer.isFiatOffer() ? direction :
|
||||||
|
direction.equals(OfferDirection.BUY) ? OfferDirection.SELL : OfferDirection.BUY;
|
||||||
|
return priceUtil.getMarketBasedPrice(offer, displayDirection);
|
||||||
}
|
}
|
||||||
|
|
||||||
String formatMarketPriceMargin(Offer offer) {
|
String formatMarketPriceMargin(Offer offer) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue