Merge pull request #7340 from alvasw/always_show_ARS_blue_rate_popup

Always show ARS blue rate popup (account creation)
This commit is contained in:
Alejandro García 2025-01-15 20:22:33 +00:00 committed by GitHub
commit ad9c2169a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 29 deletions

View file

@ -0,0 +1,23 @@
package bisq.desktop.components.paymentmethods;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.core.locale.FiatCurrency;
import bisq.core.locale.Res;
import bisq.core.locale.TradeCurrency;
public class ArsBlueRatePopup {
public static boolean isTradeCurrencyArgentinePesos(TradeCurrency tradeCurrency) {
FiatCurrency arsCurrency = new FiatCurrency("ARS");
return tradeCurrency.equals(arsCurrency);
}
public static void show() {
new Popup()
.headLine(Res.get("popup.arsBlueMarket.title"))
.information(Res.get("popup.arsBlueMarket.info"))
.actionButtonText(Res.get("shared.iUnderstand"))
.hideCloseButton()
.show();
}
}

View file

@ -37,7 +37,6 @@ import bisq.core.offer.OfferDirection;
import bisq.core.payment.AssetAccount; import bisq.core.payment.AssetAccount;
import bisq.core.payment.PaymentAccount; import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.PaymentMethod; import bisq.core.payment.payload.PaymentMethod;
import bisq.core.user.DontShowAgainLookup;
import bisq.core.util.coin.CoinFormatter; import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator; import bisq.core.util.validation.InputValidator;
@ -68,7 +67,6 @@ import javafx.collections.FXCollections;
import javafx.util.StringConverter; import javafx.util.StringConverter;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -124,8 +122,8 @@ public abstract class PaymentMethodForm {
paymentAccount.setSingleTradeCurrency(selectedCurrency); paymentAccount.setSingleTradeCurrency(selectedCurrency);
updateFromInputs(); updateFromInputs();
if (isArgentinePesos(selectedCurrency)) { if (ArsBlueRatePopup.isTradeCurrencyArgentinePesos(selectedCurrency)) {
maybeShowArgentinePesosBlueRatePopup(); ArsBlueRatePopup.show();
} }
}); });
} }
@ -317,8 +315,8 @@ public abstract class PaymentMethodForm {
if (checkBox.isSelected()) { if (checkBox.isSelected()) {
paymentAccount.addCurrency(e); paymentAccount.addCurrency(e);
if (isArgentinePesos(e)) { if (ArsBlueRatePopup.isTradeCurrencyArgentinePesos(e)) {
maybeShowArgentinePesosBlueRatePopup(); ArsBlueRatePopup.show();
} }
} else { } else {
@ -329,8 +327,8 @@ public abstract class PaymentMethodForm {
}); });
flowPane.getChildren().add(checkBox); flowPane.getChildren().add(checkBox);
if (isCurrencySelected && isArgentinePesos(e)) { if (isCurrencySelected && ArsBlueRatePopup.isTradeCurrencyArgentinePesos(e)) {
maybeShowArgentinePesosBlueRatePopup(); ArsBlueRatePopup.show();
} }
} }
@ -372,22 +370,4 @@ public abstract class PaymentMethodForm {
void addAcceptedCountry(String countryCode) { void addAcceptedCountry(String countryCode) {
} }
public static boolean isArgentinePesos(TradeCurrency tradeCurrency) {
FiatCurrency arsCurrency = new FiatCurrency("ARS");
return tradeCurrency.equals(arsCurrency);
}
public static void maybeShowArgentinePesosBlueRatePopup() {
String key = "arsBlueMarketNotificationPopup";
if (DontShowAgainLookup.showAgain(key)) {
new Popup()
.headLine(Res.get("popup.arsBlueMarket.title"))
.information(Res.get("popup.arsBlueMarket.info"))
.actionButtonText(Res.get("shared.iUnderstand"))
.hideCloseButton()
.dontShowAgainId(key)
.show();
}
}
} }

View file

@ -24,7 +24,7 @@ import bisq.desktop.components.BisqScrollPane;
import bisq.desktop.components.BisqTextArea; import bisq.desktop.components.BisqTextArea;
import bisq.desktop.components.InfoAutoTooltipLabel; import bisq.desktop.components.InfoAutoTooltipLabel;
import bisq.desktop.components.indicator.TxConfidenceIndicator; import bisq.desktop.components.indicator.TxConfidenceIndicator;
import bisq.desktop.components.paymentmethods.PaymentMethodForm; import bisq.desktop.components.paymentmethods.ArsBlueRatePopup;
import bisq.desktop.main.MainView; import bisq.desktop.main.MainView;
import bisq.desktop.main.account.AccountView; import bisq.desktop.main.account.AccountView;
import bisq.desktop.main.account.content.fiataccounts.FiatAccountsView; import bisq.desktop.main.account.content.fiataccounts.FiatAccountsView;
@ -1108,8 +1108,8 @@ public class GUIUtil {
TradeCurrency selectedCurrency = currencyComboBox.getSelectionModel().getSelectedItem(); TradeCurrency selectedCurrency = currencyComboBox.getSelectionModel().getSelectedItem();
onTradeCurrencySelectedHandler.accept(selectedCurrency); onTradeCurrencySelectedHandler.accept(selectedCurrency);
if (PaymentMethodForm.isArgentinePesos(selectedCurrency)) { if (ArsBlueRatePopup.isTradeCurrencyArgentinePesos(selectedCurrency)) {
PaymentMethodForm.maybeShowArgentinePesosBlueRatePopup(); ArsBlueRatePopup.show();
} }
}); });