mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 19:26:37 +00:00
Selecting Receive amount is disabled when Estimated rate is active. Display "-" in the Receive amount field in that case
This commit is contained in:
parent
a899e97ae2
commit
f81784c1c3
2 changed files with 8 additions and 7 deletions
|
@ -232,7 +232,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
|
|||
? ref.read(estimatedRateExchangeFormProvider).fromAmountString
|
||||
: ref.read(fixedRateExchangeFormProvider).fromAmountString;
|
||||
_receiveController.text = isEstimated
|
||||
? ref.read(estimatedRateExchangeFormProvider).toAmountString
|
||||
? "-" //ref.read(estimatedRateExchangeFormProvider).toAmountString
|
||||
: ref.read(fixedRateExchangeFormProvider).toAmountString;
|
||||
|
||||
_sendFocusNode.addListener(() async {
|
||||
|
@ -325,7 +325,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
|
|||
: fixedRateExchangeFormProvider.select(
|
||||
(value) => value.toAmountString), (previous, String next) {
|
||||
if (!_receiveFocusNode.hasFocus) {
|
||||
_receiveController.text = next;
|
||||
_receiveController.text = isEstimated ? "-" : next;
|
||||
debugPrint("RECEIVE AMOUNT LISTENER ACTIVATED");
|
||||
if (_swapLock) {
|
||||
_sendController.text = isEstimated
|
||||
|
@ -345,7 +345,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
|
|||
debugPrint("SEND AMOUNT LISTENER ACTIVATED");
|
||||
if (_swapLock) {
|
||||
_receiveController.text = isEstimated
|
||||
? ref.read(estimatedRateExchangeFormProvider).toAmountString
|
||||
? "-" //ref.read(estimatedRateExchangeFormProvider).toAmountString
|
||||
: ref.read(fixedRateExchangeFormProvider).toAmountString;
|
||||
}
|
||||
}
|
||||
|
@ -737,7 +737,7 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> {
|
|||
.exchangeRateType ==
|
||||
ExchangeRateType.estimated,
|
||||
onTap: () {
|
||||
if (_receiveController.text == "-") {
|
||||
if (!isEstimated && _receiveController.text == "-") {
|
||||
_receiveController.text = "";
|
||||
}
|
||||
},
|
||||
|
|
|
@ -329,7 +329,7 @@ class _WalletInitiatedExchangeViewState
|
|||
: fixedRateExchangeFormProvider.select(
|
||||
(value) => value.toAmountString), (previous, String next) {
|
||||
if (!_receiveFocusNode.hasFocus) {
|
||||
_receiveController.text = next;
|
||||
_receiveController.text = isEstimated ? "-" : next;
|
||||
debugPrint("RECEIVE AMOUNT LISTENER ACTIVATED");
|
||||
if (_swapLock) {
|
||||
_sendController.text = isEstimated
|
||||
|
@ -349,7 +349,7 @@ class _WalletInitiatedExchangeViewState
|
|||
debugPrint("SEND AMOUNT LISTENER ACTIVATED");
|
||||
if (_swapLock) {
|
||||
_receiveController.text = isEstimated
|
||||
? ref.read(estimatedRateExchangeFormProvider).toAmountString
|
||||
? "-" //ref.read(estimatedRateExchangeFormProvider).toAmountString
|
||||
: ref.read(fixedRateExchangeFormProvider).toAmountString;
|
||||
}
|
||||
}
|
||||
|
@ -808,7 +808,8 @@ class _WalletInitiatedExchangeViewState
|
|||
.exchangeRateType ==
|
||||
ExchangeRateType.estimated,
|
||||
onTap: () {
|
||||
if (_receiveController.text == "-") {
|
||||
if (!isEstimated &&
|
||||
_receiveController.text == "-") {
|
||||
_receiveController.text = "";
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue