Skip to content

Commit

Permalink
[HOTFIX]: donors
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikolajczyk committed Jan 14, 2025
1 parent 5f6bed4 commit f648c10
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/hooks/queries/donors/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { ProjectDonor } from './types';

export function mapDataToProjectDonors(data: Response): ProjectDonor[] {
return data
.map(({ address, amount }) => ({
address,
amount: parseUnitsBigInt(amount, 'wei'),
}))
.reduce((acc, { address, amount }) => {
if (amount === '0') {return acc;}
acc.push({ address, amount: parseUnitsBigInt(amount, 'wei') });
return acc;
}, [] as ProjectDonor[])
.sort((a, b) => {
if (a.amount > b.amount) {
return -1;
Expand Down

0 comments on commit f648c10

Please sign in to comment.