mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-01-09 04:20:33 +00:00
When amount is below minimum for order, show warning on the text field instead of popup.
This commit is contained in:
parent
f78a9cd907
commit
f401f72896
1 changed files with 14 additions and 7 deletions
|
@ -687,6 +687,11 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
|
||||||
if (minAmount.get() != null)
|
if (minAmount.get() != null)
|
||||||
minAmountValidationResult.set(isXmrInputValid(minAmount.get()));
|
minAmountValidationResult.set(isXmrInputValid(minAmount.get()));
|
||||||
} else if (amount.get() != null && xmrValidator.getMaxTradeLimit() != null && xmrValidator.getMaxTradeLimit().longValueExact() == OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.longValueExact()) {
|
} else if (amount.get() != null && xmrValidator.getMaxTradeLimit() != null && xmrValidator.getMaxTradeLimit().longValueExact() == OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.longValueExact()) {
|
||||||
|
|
||||||
|
if (Double.parseDouble(amount.get()) < HavenoUtils.atomicUnitsToXmr(Restrictions.getMinTradeAmount())){
|
||||||
|
amountValidationResult.set(result);
|
||||||
|
}
|
||||||
|
else{
|
||||||
amount.set(HavenoUtils.formatXmr(xmrValidator.getMaxTradeLimit()));
|
amount.set(HavenoUtils.formatXmr(xmrValidator.getMaxTradeLimit()));
|
||||||
boolean isBuy = dataModel.getDirection() == OfferDirection.BUY;
|
boolean isBuy = dataModel.getDirection() == OfferDirection.BUY;
|
||||||
new Popup().information(Res.get(isBuy ? "popup.warning.tradeLimitDueAccountAgeRestriction.buyer" : "popup.warning.tradeLimitDueAccountAgeRestriction.seller",
|
new Popup().information(Res.get(isBuy ? "popup.warning.tradeLimitDueAccountAgeRestriction.buyer" : "popup.warning.tradeLimitDueAccountAgeRestriction.seller",
|
||||||
|
@ -695,6 +700,8 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
|
||||||
.width(900)
|
.width(900)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
// We want to trigger a recalculation of the volume
|
// We want to trigger a recalculation of the volume
|
||||||
UserThread.execute(() -> {
|
UserThread.execute(() -> {
|
||||||
onFocusOutVolumeTextField(true, false);
|
onFocusOutVolumeTextField(true, false);
|
||||||
|
|
Loading…
Reference in a new issue