Skip to content

Commit

Permalink
fix: average dip
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbulat committed Jan 2, 2025
1 parent a513115 commit 374e07f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/app/src/library/Graphs/PayoutLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const PayoutLine = ({
datasets: [
{
label: t('payout'),
data: combinedPayouts.map(({ reward }) => reward),
data: combinedPayouts.map(({ reward }: { reward: number }) => reward),
borderColor: color,
pointStyle: undefined,
pointRadius: 0,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/library/Graphs/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const calculateDailyPayouts = (

// Calculate average payouts per day
export const calculatePayoutAverages = (
payouts: RewardResults,
payouts: AnyJson,
fromDate: Date,
days: number,
avgDays: number
Expand Down Expand Up @@ -162,7 +162,7 @@ export const calculatePayoutAverages = (
// If on last reward and is a zero (current era still processing), use previous reward to
// prevent misleading dip
const reward =
i === payouts.length - 1 && payouts[i].reward === '0'
i === payouts.length - 1 && payouts[i].reward === 0
? payoutsAverages[i - 1].reward
: total / num

Expand Down

0 comments on commit 374e07f

Please sign in to comment.