mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-26 04:26:00 +00:00
Update exchange_page.dart
This commit is contained in:
parent
a70a31ba40
commit
da97dac105
1 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
import 'package:cake_wallet/exchange/exchange_provider_description.dart';
|
import 'package:cake_wallet/exchange/exchange_provider_description.dart';
|
||||||
import 'package:cake_wallet/exchange/provider/thorchain_exchange.provider.dart';
|
import 'package:cake_wallet/exchange/provider/thorchain_exchange.provider.dart';
|
||||||
|
import 'package:cake_wallet/exchange/provider/mayachain_exchange.provider.dart';
|
||||||
import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
|
import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
|
||||||
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
|
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
|
||||||
import 'package:cake_wallet/core/auth_service.dart';
|
import 'package:cake_wallet/core/auth_service.dart';
|
||||||
|
@ -442,7 +443,7 @@ class ExchangePage extends BasePage {
|
||||||
}
|
}
|
||||||
if (state is TradeIsCreatedSuccessfully) {
|
if (state is TradeIsCreatedSuccessfully) {
|
||||||
exchangeViewModel.reset();
|
exchangeViewModel.reset();
|
||||||
(exchangeViewModel.tradesStore.trade?.provider == ExchangeProviderDescription.thorChain)
|
(exchangeViewModel.tradesStore.trade?.provider == ExchangeProviderDescription.thorChain || exchangeViewModel.tradesStore.trade?.provider == ExchangeProviderDescription.mayaChain)
|
||||||
? Navigator.of(context).pushReplacementNamed(Routes.exchangeTrade)
|
? Navigator.of(context).pushReplacementNamed(Routes.exchangeTrade)
|
||||||
: Navigator.of(context).pushReplacementNamed(Routes.exchangeConfirm);
|
: Navigator.of(context).pushReplacementNamed(Routes.exchangeConfirm);
|
||||||
}
|
}
|
||||||
|
@ -485,11 +486,14 @@ class ExchangePage extends BasePage {
|
||||||
exchangeViewModel.isSendAllEnabled = false;
|
exchangeViewModel.isSendAllEnabled = false;
|
||||||
final isThorChain = exchangeViewModel.selectedProviders
|
final isThorChain = exchangeViewModel.selectedProviders
|
||||||
.any((provider) => provider is ThorChainExchangeProvider);
|
.any((provider) => provider is ThorChainExchangeProvider);
|
||||||
|
final isMayaChain = exchangeViewModel.selectedProviders
|
||||||
|
.any((provider) => provider is MayaChainExchangeProvider);
|
||||||
|
|
||||||
_depositAmountDebounce = isThorChain
|
_depositAmountDebounce = (isThorChain || isMayaChain)
|
||||||
? Debounce(Duration(milliseconds: 1000))
|
? Debounce(Duration(milliseconds: 1000))
|
||||||
: Debounce(Duration(milliseconds: 500));
|
: Debounce(Duration(milliseconds: 500));
|
||||||
|
|
||||||
|
|
||||||
_depositAmountDebounce.run(() {
|
_depositAmountDebounce.run(() {
|
||||||
exchangeViewModel.changeDepositAmount(amount: depositAmountController.text);
|
exchangeViewModel.changeDepositAmount(amount: depositAmountController.text);
|
||||||
exchangeViewModel.isReceiveAmountEntered = false;
|
exchangeViewModel.isReceiveAmountEntered = false;
|
||||||
|
|
Loading…
Reference in a new issue