fix: use profit value instead of commission-only for the analytics screen

This commit is contained in:
Sérgio Salgado 2022-11-17 02:36:12 +00:00
parent b7b9daf08c
commit c0cca33984

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 => {