From 6b5f32bf8dc23e5d73860fc396626aff864edffa Mon Sep 17 00:00:00 2001 From: redDwarf03 Date: Wed, 8 Jan 2025 14:15:56 +0100 Subject: [PATCH] fix: :bug: Remove periodicReload for removeAmounts provider --- lib/application/aeswap/dex_token.dart | 10 ---------- lib/modules/aeswap/application/pool/dex_pool_list.dart | 5 ++--- lib/ui/views/main/bloc/providers.dart | 1 + 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/application/aeswap/dex_token.dart b/lib/application/aeswap/dex_token.dart index b44109143..3fa0a3f5f 100644 --- a/lib/application/aeswap/dex_token.dart +++ b/lib/application/aeswap/dex_token.dart @@ -1,11 +1,9 @@ import 'package:aewallet/application/account/accounts_notifier.dart'; import 'package:aewallet/application/api_service.dart'; -import 'package:aewallet/application/connectivity_status.dart'; import 'package:aewallet/modules/aeswap/application/session/provider.dart'; import 'package:aewallet/modules/aeswap/domain/models/dex_token.dart'; import 'package:aewallet/modules/aeswap/infrastructure/dex_token.repository.dart'; import 'package:aewallet/modules/aeswap/infrastructure/pool_factory.repository.dart'; -import 'package:aewallet/modules/aeswap/util/riverpod.dart'; import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:collection/collection.dart'; @@ -108,14 +106,6 @@ Future<({double token1, double token2})> _getRemoveAmounts( String poolAddress, double lpTokenAmount, ) async { - ref.periodicReload( - const Duration(minutes: 1), - shouldReload: () { - return ref.read(connectivityStatusProviders) == - ConnectivityStatus.isConnected; - }, - ); - final apiService = ref.watch(apiServiceProvider); final amounts = await PoolFactoryRepositoryImpl(poolAddress, apiService) .getRemoveAmounts(lpTokenAmount); diff --git a/lib/modules/aeswap/application/pool/dex_pool_list.dart b/lib/modules/aeswap/application/pool/dex_pool_list.dart index dc55a7a4c..507c23259 100644 --- a/lib/modules/aeswap/application/pool/dex_pool_list.dart +++ b/lib/modules/aeswap/application/pool/dex_pool_list.dart @@ -7,7 +7,6 @@ Future> _getPoolList( ) async { final environment = ref.watch(environmentProvider); log('environment ${environment.endpoint}', name: '_getPoolList'); - final aeETHUCOPoolAddress = environment.aeETHUCOPoolAddress; final dexConf = await ref.watch(DexConfigProviders.dexConfig.future); @@ -41,10 +40,10 @@ Future> _getPoolList( }).toList() ..sort((a, b) { if (a.poolAddress.toUpperCase() == - aeETHUCOPoolAddress.toUpperCase()) { + environment.aeETHUCOPoolAddress.toUpperCase()) { return -1; } else if (b.poolAddress.toUpperCase() == - aeETHUCOPoolAddress.toUpperCase()) { + environment.aeETHUCOPoolAddress.toUpperCase()) { return 1; } else { return 0; diff --git a/lib/ui/views/main/bloc/providers.dart b/lib/ui/views/main/bloc/providers.dart index ad5aa3a99..7dfb22368 100644 --- a/lib/ui/views/main/bloc/providers.dart +++ b/lib/ui/views/main/bloc/providers.dart @@ -25,6 +25,7 @@ class HomePage extends _$HomePage { @override Future build() async { ref + ..watch(environmentProvider) ..watch(DexPoolProviders.getPoolList) ..watch(DexPoolProviders.getPoolListRaw) ..watch(DexTokensProviders.tokensCommonBases)