CWA-169 | translated error messages for limits

This commit is contained in:
Oleksandr Sobol
2020-02-07 15:14:06 +02:00
parent 10cd15229e
commit d80123d960
13 changed files with 102 additions and 10 deletions
+6 -10
View File
@@ -188,15 +188,13 @@ abstract class ExchangeStoreBase with Store {
currency = depositCurrency;
}
if (limitsState is LimitsLoadedSuccessfully) {
if (limitsState is LimitsLoadedSuccessfully && amount != null) {
if (double.parse(amount) < limits.min) {
final error = "Trade for ${provider.description} is not created. "
"Amount is less then minimal: ${limits.min} ${currency.toString()}";
tradeState = TradeIsCreatedFailure(error: error);
tradeState = TradeIsCreatedFailure(error: S.current.error_text_minimal_limit("${provider.description}",
"${limits.min}", currency.toString()));
} else if (limits.max != null && double.parse(amount) > limits.max) {
final error = "Trade for ${provider.description} is not created. "
"Amount is more then maximum: ${limits.max} ${currency.toString()}";
tradeState = TradeIsCreatedFailure(error: error);
tradeState = TradeIsCreatedFailure(error: S.current.error_text_maximum_limit("${provider.description}",
"${limits.max}", currency.toString()));
} else {
try {
tradeState = TradeIsCreating();
@@ -209,9 +207,7 @@ abstract class ExchangeStoreBase with Store {
}
}
} else {
final error = "Trade for ${provider.description} is not created. "
"Limits loading failed";
tradeState = TradeIsCreatedFailure(error: error);
tradeState = TradeIsCreatedFailure(error: S.current.error_text_limits_loading_failed("${provider.description}"));
}
}