prevent double loading of data

This commit is contained in:
julian 2023-05-02 08:24:37 -06:00
parent e81521e374
commit 89f806f394

View file

@ -13,7 +13,6 @@ import 'package:stackwallet/utilities/amount/amount.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/show_loading.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/utilities/util.dart';
@ -76,17 +75,18 @@ class _ExchangeProviderOptionState
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
if (!selected) { if (!selected) {
showLoading( // showLoading(
whileFuture: ref.read(exchangeFormStateProvider).updateExchange( // whileFuture:
exchange: widget.exchange, ref.read(exchangeFormStateProvider).updateExchange(
shouldUpdateData: true, exchange: widget.exchange,
shouldNotifyListeners: true, shouldUpdateData: true,
providerName: widget.exchangeProvider, shouldNotifyListeners: true,
), providerName: widget.exchangeProvider,
context: context, // ),
message: "Updating rates", // context: context,
isDesktop: isDesktop, // message: "Updating rates",
); // isDesktop: isDesktop,
);
} }
}, },
child: Container( child: Container(
@ -113,7 +113,7 @@ class _ExchangeProviderOptionState
if (!selected) { if (!selected) {
ref.read(exchangeFormStateProvider).updateExchange( ref.read(exchangeFormStateProvider).updateExchange(
exchange: widget.exchange, exchange: widget.exchange,
shouldUpdateData: true, shouldUpdateData: false,
shouldNotifyListeners: true, shouldNotifyListeners: true,
providerName: widget.exchangeProvider, providerName: widget.exchangeProvider,
); );