Skip to content

Commit

Permalink
Merge pull request #6049 from jmacxx/fix_issue_6046
Browse files Browse the repository at this point in the history
Show buyer/seller in terms of BTC
  • Loading branch information
ripcurlx authored Feb 17, 2022
2 parents 12a797d + d5cccfa commit 70d9188
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private void addContent() {
DisplayUtils.formatDateTime(offer.getDate()) + " / " + DisplayUtils.formatDateTime(dispute.getTradeDate()));
String currencyCode = offer.getCurrencyCode();
addConfirmationLabelTextField(gridPane, ++rowIndex, Res.get("shared.offerType"),
DisplayUtils.getDirectionBothSides(offer.getDirection(), currencyCode));
DisplayUtils.getDirectionBothSides(offer.getDirection()));
addConfirmationLabelTextField(gridPane, ++rowIndex, Res.get("shared.tradePrice"),
FormattingUtils.formatPrice(contract.getTradePrice()));
addConfirmationLabelTextField(gridPane, ++rowIndex, Res.get("shared.tradeAmount"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private void addContent() {
btcDirectionInfo = direction == OfferDirection.BUY ? toReceive : toSpend;
} else {
addConfirmationLabelLabel(gridPane, rowIndex, offerTypeLabel,
DisplayUtils.getDirectionBothSides(direction, currencyCode), firstRowDistance);
DisplayUtils.getDirectionBothSides(direction), firstRowDistance);
}
String btcAmount = Res.get("shared.btcAmount");
if (takeOfferHandlerOptional.isPresent()) {
Expand Down
16 changes: 5 additions & 11 deletions desktop/src/main/java/bisq/desktop/util/DisplayUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,11 @@ public static String getDirectionWithCode(OfferDirection direction, String curre
return (direction == OfferDirection.SELL) ? Res.get("shared.buyCurrency", currencyCode) : Res.get("shared.sellCurrency", currencyCode);
}

public static String getDirectionBothSides(OfferDirection direction, String currencyCode) {
if (CurrencyUtil.isFiatCurrency(currencyCode)) {
currencyCode = Res.getBaseCurrencyCode();
return direction == OfferDirection.BUY ?
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.buyer"), currencyCode, Res.get("shared.seller")) :
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.seller"), currencyCode, Res.get("shared.buyer"));
} else {
return direction == OfferDirection.SELL ?
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.buyer"), currencyCode, Res.get("shared.seller")) :
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.seller"), currencyCode, Res.get("shared.buyer"));
}
public static String getDirectionBothSides(OfferDirection direction) {
String currencyCode = Res.getBaseCurrencyCode();
return direction == OfferDirection.BUY ?
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.buyer"), currencyCode, Res.get("shared.seller")) :
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.seller"), currencyCode, Res.get("shared.buyer"));
}

public static String getDirectionForBuyer(boolean isMyOffer, String currencyCode) {
Expand Down

0 comments on commit 70d9188

Please sign in to comment.