Skip to content

Commit

Permalink
fix inverted buy/sell label on make or take crypto offer
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Nov 15, 2024
1 parent c9e9924 commit 264cb5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public void initWithData(OfferDirection direction, TradeCurrency tradeCurrency,
if (CurrencyUtil.isTraditionalCurrency(tradeCurrency.getCode())) {
placeOfferButtonLabel = Res.get("createOffer.placeOfferButton", Res.get("shared.buy"));
} else {
placeOfferButtonLabel = Res.get("createOffer.placeOfferButtonCrypto", Res.get("shared.buy"), tradeCurrency.getCode());
placeOfferButtonLabel = Res.get("createOffer.placeOfferButtonCrypto", Res.get("shared.sell"), tradeCurrency.getCode());
}
nextButton.setId("buy-button");
fundFromSavingsWalletButton.setId("buy-button");
Expand All @@ -317,7 +317,7 @@ public void initWithData(OfferDirection direction, TradeCurrency tradeCurrency,
if (CurrencyUtil.isTraditionalCurrency(tradeCurrency.getCode())) {
placeOfferButtonLabel = Res.get("createOffer.placeOfferButton", Res.get("shared.sell"));
} else {
placeOfferButtonLabel = Res.get("createOffer.placeOfferButtonCrypto", Res.get("shared.sell"), tradeCurrency.getCode());
placeOfferButtonLabel = Res.get("createOffer.placeOfferButtonCrypto", Res.get("shared.buy"), tradeCurrency.getCode());
}
nextButton.setId("sell-button");
fundFromSavingsWalletButton.setId("sell-button");
Expand Down Expand Up @@ -707,10 +707,10 @@ private void createListeners() {
triggerPriceInputTextField.clear();
if (!CurrencyUtil.isTraditionalCurrency(newValue)) {
if (model.isShownAsBuyOffer()) {
placeOfferButton.updateText(Res.get("createOffer.placeOfferButtonCrypto", Res.get("shared.buy"),
placeOfferButton.updateText(Res.get("createOffer.placeOfferButtonCrypto", Res.get("shared.sell"),
model.getTradeCurrency().getCode()));
} else {
placeOfferButton.updateText(Res.get("createOffer.placeOfferButtonCrypto", Res.get("shared.sell"),
placeOfferButton.updateText(Res.get("createOffer.placeOfferButtonCrypto", Res.get("shared.buy"),
model.getTradeCurrency().getCode()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ public void initWithData(Offer offer) {
takeOfferButton.setId("buy-button-big");
nextButton.setId("buy-button");
fundFromSavingsWalletButton.setId("buy-button");
takeOfferButton.updateText(getTakeOfferLabel(offer, Res.get("shared.buy")));
takeOfferButton.updateText(getTakeOfferLabel(offer, false));
} else {
takeOfferButton.setId("sell-button-big");
nextButton.setId("sell-button");
fundFromSavingsWalletButton.setId("sell-button");
takeOfferButton.updateText(getTakeOfferLabel(offer, Res.get("shared.sell")));
takeOfferButton.updateText(getTakeOfferLabel(offer, true));
}
priceAsPercentageDescription.setText(model.getPercentagePriceDescription());

Expand Down Expand Up @@ -1232,11 +1232,11 @@ private GridPane createInfoPopover() {
}

@NotNull
private String getTakeOfferLabel(Offer offer, String direction) {
private String getTakeOfferLabel(Offer offer, boolean isBuyOffer) {
return offer.isTraditionalOffer() ?
Res.get("takeOffer.takeOfferButton", direction) :
Res.get("takeOffer.takeOfferButton", isBuyOffer ? Res.get("shared.sell") : Res.get("shared.buy")) :
Res.get("takeOffer.takeOfferButtonCrypto",
direction,
isBuyOffer ? Res.get("shared.buy") : Res.get("shared.sell"),
offer.getCurrencyCode());
}

Expand Down

0 comments on commit 264cb5f

Please sign in to comment.