Skip to content

Commit

Permalink
fix: 🐛 Bugs fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
redDwarf03 committed Oct 8, 2024
1 parent 8ccee56 commit 49b5a4b
Show file tree
Hide file tree
Showing 17 changed files with 307 additions and 276 deletions.
3 changes: 2 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -712,5 +712,6 @@
"earnHeaderStartEarningBtn": "Start earning",
"earnHeaderAddLiquidityTxt": "To get LP token you have to provide liquidity here :",
"liquidityAddDesc": "Add liquidity to the pool and receive LP Tokens representing your share",
"keychainAddressCopied": "Keychain address copied"
"keychainAddressCopied": "Keychain address copied",
"farmLockTokensSummaryMoreInfo": "More info"
}
3 changes: 2 additions & 1 deletion lib/l10n/intl_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -692,5 +692,6 @@
"keychainAddressCopied": "Adresse de la keychain copiée",
"withdrawFarmLockDone": "Retrait complété avec succès",
"claimFarmLockDone": "Réclamation complétée avec succès",
"levelUpFarmLockDone": "Montée de niveau complétée avec succès"
"levelUpFarmLockDone": "Montée de niveau complétée avec succès",
"farmLockTokensSummaryMoreInfo": "Plus d'infos"
}
46 changes: 24 additions & 22 deletions lib/ui/views/aeswap_earn/bloc/provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ FarmLockFormBalances farmLockFormBalances(
}

@riverpod
FarmLockFormSummary farmLockFormSummary(
Future<FarmLockFormSummary> farmLockFormSummary(
FarmLockFormSummaryRef ref,
) {
) async {
final farmLock = ref.watch(farmLockFormFarmLockProvider).value;

if (farmLock == null) return const FarmLockFormSummary();
Expand All @@ -66,26 +66,28 @@ FarmLockFormSummary farmLockFormSummary(
rewardsEarned = rewardsEarned + userInfos.rewardAmount;
});

farmedTokensCapitalInFiat = ref
.watch(
DexTokensProviders.estimateLPTokenInFiat(
farmLock.lpTokenPair!.token1.address,
farmLock.lpTokenPair!.token2.address,
capitalInvested,
farmLock.poolAddress,
),
)
.value ??
0;

price = ref
.watch(
DexTokensProviders.estimateTokenInFiat(
farmLock.rewardToken!.address,
),
)
.value ??
0;
final farmedTokensCapitalInFiatFuture = ref.watch(
DexTokensProviders.estimateLPTokenInFiat(
farmLock.lpTokenPair!.token1.address,
farmLock.lpTokenPair!.token2.address,
capitalInvested,
farmLock.poolAddress,
).future,
);

final priceFuture = ref.watch(
DexTokensProviders.estimateTokenInFiat(
farmLock.rewardToken!.address,
).future,
);

final results = await Future.wait([
farmedTokensCapitalInFiatFuture,
priceFuture,
]);

farmedTokensCapitalInFiat = results[0];
price = results[1];

return FarmLockFormSummary(
farmedTokensCapital: capitalInvested,
Expand Down
7 changes: 4 additions & 3 deletions lib/ui/views/aeswap_earn/bloc/provider.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Loading

0 comments on commit 49b5a4b

Please sign in to comment.