mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-11 05:04:35 +00:00
fix when leaving and returning to exchange view
This commit is contained in:
parent
a94feef80e
commit
243acd09ba
2 changed files with 9 additions and 6 deletions
|
@ -406,6 +406,10 @@ class ExchangeFormState extends ChangeNotifier {
|
|||
}
|
||||
}
|
||||
|
||||
Future<void> refresh() => _updateRangesAndEstimate(
|
||||
shouldNotifyListeners: true,
|
||||
);
|
||||
|
||||
//============================================================================
|
||||
// private state updaters
|
||||
//============================================================================
|
||||
|
|
|
@ -682,16 +682,15 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
|||
if (walletInitiated) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
ref.read(exchangeFormStateProvider).reset(shouldNotifyListeners: true);
|
||||
// ref.read(fixedRateExchangeFormProvider);
|
||||
});
|
||||
} else {
|
||||
final rateType = (ref.read(prefsChangeNotifierProvider).exchangeRateType);
|
||||
final isEstimated = rateType == ExchangeRateType.estimated;
|
||||
_sendController.text =
|
||||
ref.read(exchangeFormStateProvider).fromAmountString;
|
||||
_receiveController.text = isEstimated
|
||||
? "-" //ref.read(estimatedRateExchangeFormProvider).toAmountString
|
||||
: ref.read(exchangeFormStateProvider).toAmountString;
|
||||
_receiveController.text =
|
||||
ref.read(exchangeFormStateProvider).toAmountString;
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
ref.read(exchangeFormStateProvider).refresh();
|
||||
});
|
||||
}
|
||||
|
||||
super.initState();
|
||||
|
|
Loading…
Reference in a new issue