Skip to content

Commit

Permalink
fix for missing proportion on hidden users
Browse files Browse the repository at this point in the history
  • Loading branch information
huumn committed Dec 18, 2024
1 parent f9138f3 commit afe4b26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fragments/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export const TOP_USERS = gql`
photoId
ncomments(when: $when, from: $from, to: $to)
nposts(when: $when, from: $from, to: $to)
proportion
optional {
stacked(when: $when, from: $from, to: $to)
spent(when: $when, from: $from, to: $to)
Expand Down
1 change: 1 addition & 0 deletions pages/rewards/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default function Rewards ({ ssrData }) {
if (!dat) return <PageLoading />

function EstimatedReward ({ rank, user }) {
if (!user) return null
const referrerReward = Math.max(Math.floor(total * user.proportion * 0.2), 0)
const reward = Math.max(Math.floor(total * user.proportion) - referrerReward, 0)

Expand Down

0 comments on commit afe4b26

Please sign in to comment.