fix inverted buy/sell label on make or take crypto offer

This commit is contained in:
woodser 2024-11-15 10:41:42 -05:00
parent c9e992442c
commit 264cb5f0ac
2 changed files with 9 additions and 9 deletions

View file

@ -308,7 +308,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
if (CurrencyUtil.isTraditionalCurrency(tradeCurrency.getCode())) { if (CurrencyUtil.isTraditionalCurrency(tradeCurrency.getCode())) {
placeOfferButtonLabel = Res.get("createOffer.placeOfferButton", Res.get("shared.buy")); placeOfferButtonLabel = Res.get("createOffer.placeOfferButton", Res.get("shared.buy"));
} else { } 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"); nextButton.setId("buy-button");
fundFromSavingsWalletButton.setId("buy-button"); fundFromSavingsWalletButton.setId("buy-button");
@ -317,7 +317,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
if (CurrencyUtil.isTraditionalCurrency(tradeCurrency.getCode())) { if (CurrencyUtil.isTraditionalCurrency(tradeCurrency.getCode())) {
placeOfferButtonLabel = Res.get("createOffer.placeOfferButton", Res.get("shared.sell")); placeOfferButtonLabel = Res.get("createOffer.placeOfferButton", Res.get("shared.sell"));
} else { } 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"); nextButton.setId("sell-button");
fundFromSavingsWalletButton.setId("sell-button"); fundFromSavingsWalletButton.setId("sell-button");
@ -707,10 +707,10 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
triggerPriceInputTextField.clear(); triggerPriceInputTextField.clear();
if (!CurrencyUtil.isTraditionalCurrency(newValue)) { if (!CurrencyUtil.isTraditionalCurrency(newValue)) {
if (model.isShownAsBuyOffer()) { 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())); model.getTradeCurrency().getCode()));
} else { } else {
placeOfferButton.updateText(Res.get("createOffer.placeOfferButtonCrypto", Res.get("shared.sell"), placeOfferButton.updateText(Res.get("createOffer.placeOfferButtonCrypto", Res.get("shared.buy"),
model.getTradeCurrency().getCode())); model.getTradeCurrency().getCode()));
} }
} }

View file

@ -306,12 +306,12 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
takeOfferButton.setId("buy-button-big"); takeOfferButton.setId("buy-button-big");
nextButton.setId("buy-button"); nextButton.setId("buy-button");
fundFromSavingsWalletButton.setId("buy-button"); fundFromSavingsWalletButton.setId("buy-button");
takeOfferButton.updateText(getTakeOfferLabel(offer, Res.get("shared.buy"))); takeOfferButton.updateText(getTakeOfferLabel(offer, false));
} else { } else {
takeOfferButton.setId("sell-button-big"); takeOfferButton.setId("sell-button-big");
nextButton.setId("sell-button"); nextButton.setId("sell-button");
fundFromSavingsWalletButton.setId("sell-button"); fundFromSavingsWalletButton.setId("sell-button");
takeOfferButton.updateText(getTakeOfferLabel(offer, Res.get("shared.sell"))); takeOfferButton.updateText(getTakeOfferLabel(offer, true));
} }
priceAsPercentageDescription.setText(model.getPercentagePriceDescription()); priceAsPercentageDescription.setText(model.getPercentagePriceDescription());
@ -1232,11 +1232,11 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
} }
@NotNull @NotNull
private String getTakeOfferLabel(Offer offer, String direction) { private String getTakeOfferLabel(Offer offer, boolean isBuyOffer) {
return offer.isTraditionalOffer() ? 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", Res.get("takeOffer.takeOfferButtonCrypto",
direction, isBuyOffer ? Res.get("shared.buy") : Res.get("shared.sell"),
offer.getCurrencyCode()); offer.getCurrencyCode());
} }