mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +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) {
|
||||
Offer offer = item.getOffer();
|
||||
boolean useMarketBasedPrice = offer.isUseMarketBasedPrice();
|
||||
boolean isShownAsBuyOffer = OfferViewUtil.isShownAsBuyOffer(offer);
|
||||
MaterialDesignIcon icon = useMarketBasedPrice ? MaterialDesignIcon.CHART_LINE : MaterialDesignIcon.LOCK;
|
||||
String info;
|
||||
|
||||
if (useMarketBasedPrice) {
|
||||
double marketPriceMargin = offer.getMarketPriceMargin();
|
||||
if (marketPriceMargin == 0) {
|
||||
if (offer.isBuyOffer()) {
|
||||
if (isShownAsBuyOffer) {
|
||||
info = Res.get("offerbook.info.sellAtMarketPrice");
|
||||
} else {
|
||||
info = Res.get("offerbook.info.buyAtMarketPrice");
|
||||
|
@ -895,13 +896,13 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
|||
} else {
|
||||
String absolutePriceMargin = model.getAbsolutePriceMargin(offer);
|
||||
if (marketPriceMargin > 0) {
|
||||
if (offer.isBuyOffer()) {
|
||||
if (isShownAsBuyOffer) {
|
||||
info = Res.get("offerbook.info.sellBelowMarketPrice", absolutePriceMargin);
|
||||
} else {
|
||||
info = Res.get("offerbook.info.buyAboveMarketPrice", absolutePriceMargin);
|
||||
}
|
||||
} else {
|
||||
if (offer.isBuyOffer()) {
|
||||
if (isShownAsBuyOffer) {
|
||||
info = Res.get("offerbook.info.sellAboveMarketPrice", absolutePriceMargin);
|
||||
} else {
|
||||
info = Res.get("offerbook.info.buyBelowMarketPrice", absolutePriceMargin);
|
||||
|
@ -909,7 +910,7 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (offer.isBuyOffer()) {
|
||||
if (isShownAsBuyOffer) {
|
||||
info = Res.get("offerbook.info.sellAtFixedPrice");
|
||||
} else {
|
||||
info = Res.get("offerbook.info.buyAtFixedPrice");
|
||||
|
|
|
@ -421,7 +421,9 @@ abstract class OfferBookViewModel extends ActivatableViewModel {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue