From 085fa71c7a5cd36ad34cf54a756f6f20967b5cab Mon Sep 17 00:00:00 2001 From: Serhii Date: Tue, 30 Jan 2024 13:55:54 +0200 Subject: [PATCH] minor fixes --- lib/exchange/provider/thorchain_exchange.provider.dart | 3 ++- lib/src/screens/exchange/exchange_page.dart | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/exchange/provider/thorchain_exchange.provider.dart b/lib/exchange/provider/thorchain_exchange.provider.dart index fca787b0f..bd1084765 100644 --- a/lib/exchange/provider/thorchain_exchange.provider.dart +++ b/lib/exchange/provider/thorchain_exchange.provider.dart @@ -25,6 +25,7 @@ class ThorChainExchangeProvider extends ExchangeProvider { CryptoCurrency.btc, CryptoCurrency.eth, CryptoCurrency.ltc, + CryptoCurrency.bch, ].contains(element)) .toList()) ]; @@ -46,7 +47,7 @@ class ThorChainExchangeProvider extends ExchangeProvider { bool get isEnabled => true; @override - bool get supportsFixedRate => true; + bool get supportsFixedRate => false; @override ExchangeProviderDescription get description => ExchangeProviderDescription.thorChain; diff --git a/lib/src/screens/exchange/exchange_page.dart b/lib/src/screens/exchange/exchange_page.dart index 6715a62e7..f1ef7257c 100644 --- a/lib/src/screens/exchange/exchange_page.dart +++ b/lib/src/screens/exchange/exchange_page.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/exchange/exchange_provider_description.dart'; +import 'package:cake_wallet/exchange/provider/thorchain_exchange.provider.dart'; import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/core/auth_service.dart'; @@ -61,7 +62,7 @@ class ExchangePage extends BasePage { final _receiveAmountFocus = FocusNode(); final _receiveAddressFocus = FocusNode(); final _receiveAmountDebounce = Debounce(Duration(milliseconds: 500)); - final _depositAmountDebounce = Debounce(Duration(milliseconds: 500)); + Debounce _depositAmountDebounce = Debounce(Duration(milliseconds: 500)); var _isReactionsSet = false; final arrowBottomPurple = Image.asset( @@ -471,6 +472,13 @@ class ExchangePage extends BasePage { depositAmountController.addListener(() { if (depositAmountController.text != exchangeViewModel.depositAmount) { + final isThorChain = exchangeViewModel.selectedProviders + .any((provider) => provider is ThorChainExchangeProvider); + + _depositAmountDebounce = isThorChain + ? Debounce(Duration(milliseconds: 1000)) + : Debounce(Duration(milliseconds: 500)); + _depositAmountDebounce.run(() { exchangeViewModel.changeDepositAmount(amount: depositAmountController.text); exchangeViewModel.isReceiveAmountEntered = false;