mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-05 12:44:09 +01:00
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:
@@ -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}) {
|
||||
|
||||
Reference in New Issue
Block a user