Skip to content

Commit

Permalink
fix: 🐛 Remove periodicReload for removeAmounts provider
Browse files Browse the repository at this point in the history
  • Loading branch information
redDwarf03 committed Jan 8, 2025
1 parent 553b976 commit 6b5f32b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions lib/application/aeswap/dex_token.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions lib/modules/aeswap/application/pool/dex_pool_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Future<List<DexPool>> _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);

Expand Down Expand Up @@ -41,10 +40,10 @@ Future<List<DexPool>> _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;
Expand Down
1 change: 1 addition & 0 deletions lib/ui/views/main/bloc/providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class HomePage extends _$HomePage {
@override
Future<void> build() async {
ref
..watch(environmentProvider)
..watch(DexPoolProviders.getPoolList)
..watch(DexPoolProviders.getPoolListRaw)
..watch(DexTokensProviders.tokensCommonBases)
Expand Down

0 comments on commit 6b5f32b

Please sign in to comment.