Merge pull request #1447 from chaotixkilla/fix-analytics-commission-value

Fix commission value in analytics screen
This commit is contained in:
Rafael Taranto 2022-11-21 16:04:28 +00:00 committed by GitHub
commit 3d8d0d4f9c

View file

@ -83,6 +83,7 @@ const GET_TRANSACTIONS = gql`
cryptoCode cryptoCode
toAddress toAddress
created created
profit
} }
} }
` `
@ -237,18 +238,8 @@ const Analytics = () => {
} }
const commissions = { const commissions = {
current: R.sum( current: R.sum(R.map(d => d.profit, filteredData(period.code).current)),
R.map( previous: R.sum(R.map(d => d.profit, filteredData(period.code).previous))
d => d.fiat * d.commissionPercentage,
filteredData(period.code).current
)
),
previous: R.sum(
R.map(
d => d.fiat * d.commissionPercentage,
filteredData(period.code).previous
)
)
} }
const handleRepresentationChange = newRepresentation => { const handleRepresentationChange = newRepresentation => {