fix: provider refresh causing issues

This commit is contained in:
julian 2024-06-19 13:54:14 -06:00
parent 318932022e
commit 9285027006

View file

@ -882,7 +882,9 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
_cryptoFocus.addListener(() {
if (!_cryptoFocus.hasFocus && !_baseFocus.hasFocus) {
if (ref.read(pSendAmount) == null) {
ref.refresh(sendAmountProvider);
if (ref.read(sendAmountProvider) != Amount.zero && mounted) {
ref.read(sendAmountProvider.state).state = Amount.zero;
}
} else {
ref.read(sendAmountProvider.state).state = ref.read(pSendAmount)!;
}