Skip to content

Commit

Permalink
Fix piecharts
Browse files Browse the repository at this point in the history
  • Loading branch information
prevetal committed Feb 14, 2024
1 parent 59522a8 commit 32384e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/components/account/Charts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@
network.total.rewards += amount
// Calc tokens rewards price
network.totalRewardsPrice += amountCurrentDenom * el.price
network.totalRewardsPrice += amount * el.price
// Calc tokens price
network.totalTokensPrice += amountCurrentDenom * el.price
network.totalTokensPrice += amount * el.price
// Group by denom
if (store.prices.find(e => e.symbol == el.symbol)) {
Expand Down Expand Up @@ -347,6 +347,8 @@
}
}
console.log(store.account)
// Hide loader
loading.value = false
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/account/charts/ChartAssets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<script setup>
import { onBeforeMount, computed, reactive, ref, watch } from 'vue'
import { useGlobalStore } from '@/stores'
import { currencyСonversion } from '@/utils'
import { currencyСonversion, formatTokenAmount } from '@/utils'
import { Chart as ChartJS, ArcElement } from 'chart.js'
import { Doughnut } from 'vue-chartjs'
Expand Down Expand Up @@ -239,7 +239,7 @@
token = currentData.value.groupByDenom.find(e => e.symbol == symbol)
if(currentData.value.totalTokensPrice) {
result = currencyСonversion(token.symbol == 'BOOT' ? token.amount / Math.pow(10, store.networks.bostrom.exponent) : token.amount, token.symbol) / currentData.value.totalTokensPrice * 100
result = currencyСonversion(formatTokenAmount(token.amount, token.symbol), token.symbol) / currentData.value.totalTokensPrice * 100
}
return result
Expand Down

0 comments on commit 32384e4

Please sign in to comment.