CAKE-296 | removed xmr to xrp and xmr to xlm exchange pairs from ChangeNow pair list; disabled exchange button when pair is not exists

This commit is contained in:
OleksandrSobol
2021-04-01 21:08:11 +03:00
parent c0a12c6026
commit 753d164d6e
3 changed files with 25 additions and 8 deletions
@@ -60,6 +60,7 @@ abstract class ExchangeViewModelBase with Store {
_defineIsReceiveAmountEditable();
isFixedRateMode = false;
isReceiveAmountEntered = false;
isDisabledExchangeButton = false;
loadLimits();
}
@@ -113,6 +114,9 @@ abstract class ExchangeViewModelBase with Store {
@observable
bool isFixedRateMode;
@observable
bool isDisabledExchangeButton;
@computed
SyncStatus get status => wallet.syncStatus;
@@ -369,19 +373,20 @@ abstract class ExchangeViewModelBase with Store {
pair.from == depositCurrency && pair.to == receiveCurrency)
.isNotEmpty;
if (!isPairExist) {
if (isPairExist) {
final provider =
_providerForPair(from: depositCurrency, to: receiveCurrency);
if (provider != null) {
isDisabledExchangeButton = false;
changeProvider(provider: provider);
}
} else {
isDisabledExchangeButton = true;
depositAmount = '';
receiveAmount = '';
limitsState = LimitsLoadedFailure(error: 'Pair is not exists');
}
_defineIsReceiveAmountEditable();
depositAmount = '';
receiveAmount = '';
loadLimits();
}
ExchangeProvider _providerForPair({CryptoCurrency from, CryptoCurrency to}) {