mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-29 06:38:45 +01:00
CAKE-278 | applied fixed rate mode only for pair xmr-btc; added _defineIsReceiveAmountEditable() to exchange_view_model.dart; added reaction on isReceiveAmountEditable to exchange_page.dart
This commit is contained in:
@@ -57,10 +57,8 @@ abstract class ExchangeViewModelBase with Store {
|
||||
_onPairChange();
|
||||
}
|
||||
});
|
||||
|
||||
isReceiveAmountEditable = provider is ChangeNowExchangeProvider;
|
||||
_defineIsReceiveAmountEditable();
|
||||
isFixedRateMode = false;
|
||||
|
||||
isReceiveAmountEntered = false;
|
||||
loadLimits();
|
||||
}
|
||||
@@ -136,8 +134,8 @@ abstract class ExchangeViewModelBase with Store {
|
||||
this.provider = provider;
|
||||
depositAmount = '';
|
||||
receiveAmount = '';
|
||||
isReceiveAmountEditable = provider is ChangeNowExchangeProvider;
|
||||
isFixedRateMode = false;
|
||||
_defineIsReceiveAmountEditable();
|
||||
loadLimits();
|
||||
}
|
||||
|
||||
@@ -380,7 +378,7 @@ abstract class ExchangeViewModelBase with Store {
|
||||
}
|
||||
}
|
||||
|
||||
depositAddress = depositCurrency == wallet.currency ? wallet.address : '';
|
||||
_defineIsReceiveAmountEditable();
|
||||
depositAmount = '';
|
||||
receiveAmount = '';
|
||||
loadLimits();
|
||||
@@ -405,4 +403,14 @@ abstract class ExchangeViewModelBase with Store {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void _defineIsReceiveAmountEditable() {
|
||||
if ((provider is ChangeNowExchangeProvider)
|
||||
&&(depositCurrency == CryptoCurrency.xmr)
|
||||
&&(receiveCurrency == CryptoCurrency.btc)) {
|
||||
isReceiveAmountEditable = true;
|
||||
} else {
|
||||
isReceiveAmountEditable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user