Skip to content

Commit

Permalink
fix: op rebates claimable amounts (#932)
Browse files Browse the repository at this point in the history
* fix: op rebates claimable amounts

* fixup
  • Loading branch information
dohaki authored Dec 1, 2023
1 parent e31e15d commit 9e7223c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/views/Rewards/hooks/useRewardProgramCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function useRewardProgramCard(programName: rewardProgramTypes) {
const { summary } = useRewardSummary(programName, account);
const rewardsAmount =
summary.program === "op-rebates"
? summary.claimableRewards
? summary.unclaimedRewards
: summary.rewardsAmount;
return {
...programDetail,
Expand Down
6 changes: 3 additions & 3 deletions src/views/RewardsProgram/hooks/useGenericRewardClaimCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ export function useGenericRewardClaimCard(program: rewardProgramTypes) {
const { summary } = useRewardSummary(program, account);
const rewardsAmount =
summary.program === "op-rebates"
? summary.claimableRewards
? summary.unclaimedRewards
: summary.rewardsAmount;
const unclaimedAmount =
summary.program === "referrals"
? unclaimedReferralData?.claimableAmount
: summary.unclaimedRewards;
: summary.claimableRewards;

const formatUnits = formatUnitsFnBuilder(token.decimals);

Expand All @@ -49,7 +49,7 @@ export function useGenericRewardClaimCard(program: rewardProgramTypes) {
return {
...programDetails,
token,
rewardsAmount: BigNumber.from(rewardsAmount),
rewardsAmount: BigNumber.from(rewardsAmount ?? 0),
unclaimedAmount: BigNumber.from(unclaimedAmount ?? 0),
formatUnits,
disconnectedState,
Expand Down
8 changes: 4 additions & 4 deletions src/views/RewardsProgram/hooks/useOPRebatesProgram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export function useOPRebatesProgram() {
{
title: "Rewards",
tooltip: "Rewards earned from this Optimism program",
value: `${formatUnits(summary.claimableRewards, token.decimals)} ${
value: `${formatUnits(summary.unclaimedRewards || 0, token.decimals)} ${
token.symbol
}`,
prefix: `${formatUnits(
summary.unclaimedRewards ?? "0",
summary.claimableRewards ?? "0",
token.decimals
)} ${token.symbol} claimable`,
prefixIcon: "clock",
Expand All @@ -51,7 +51,7 @@ export function useOPRebatesProgram() {

return {
labels,
rewardsAmount: BigNumber.from(0),
claimableAmount: BigNumber.from(summary.unclaimedRewards || 0),
rewardsAmount: BigNumber.from(summary.unclaimedRewards || 0),
claimableAmount: BigNumber.from(summary.claimableRewards || 0),
};
}

2 comments on commit 9e7223c

@vercel
Copy link

@vercel vercel bot commented on 9e7223c Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

goerli-frontend-v2 – ./

goerli-frontend-v2-uma.vercel.app
goerli-frontend-v2.vercel.app
goerli-frontend-v2-git-master-uma.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 9e7223c Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.