Skip to content

Commit

Permalink
Sort amount correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeating authored and apbendi committed Jul 1, 2023
1 parent 750c081 commit d6fce29
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions frontend/src/components/AccountReceiveTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,15 @@ function useReceivedFundsTable(announcements: UserAnnouncement[], spendingKeyPai
name: 'amount',
sortable: true,
format: toString,
sort: (a: BigNumber, b: BigNumber, rowA: { token: string }, rowB: { token: string }) => {
const tokenA = tokens.value.find((token) => {
return token.address === rowA.token;
});
const tokenB = tokens.value.find((token) => {
return token.address === rowB.token;
});
return parseFloat(formatUnits(a, tokenA?.decimals)) - parseFloat(formatUnits(b, tokenB?.decimals));
},
},
{
align: 'left',
Expand Down

0 comments on commit d6fce29

Please sign in to comment.