show wallets
This commit is contained in:
@@ -82,6 +82,7 @@ import { usePriceWithoutType } from '@/utils/usePrice'
|
||||
import { useConfigStore } from '@/store/configStore'
|
||||
import { useWalletAssets } from '@/composables/useWalletAssets'
|
||||
import type { WalletMetalTotal } from '@/models/walletAssets'
|
||||
import { resolveSummaryMetalWeight } from '@/utils/productAssets'
|
||||
|
||||
const nameProject = useConfigStore().config.name
|
||||
const { assetsSummary, loadWalletAssets } = useWalletAssets()
|
||||
@@ -107,16 +108,8 @@ onMounted(async () => {
|
||||
}
|
||||
})
|
||||
|
||||
function summaryMetalWeight(metal: WalletMetalTotal) {
|
||||
if (inventoryCards.value.length > 0) {
|
||||
return metal.product_weight
|
||||
}
|
||||
|
||||
return metal.total_weight
|
||||
}
|
||||
|
||||
function formatMetalTotal(metal: WalletMetalTotal) {
|
||||
return `${summaryMetalWeight(metal)}${metal.unit}`
|
||||
return `${resolveSummaryMetalWeight(metal, inventoryCards.value)}${metal.unit}`
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user