Fix asset value in HoldingsDropdown when adding an asset (#14920)

When creating or editing a community permission, if you add a holding token that has already been added,
the amount value displayed is in basic units (long value) of that token instead of primary units
This commit is contained in:
mdias 2024-05-29 18:59:13 +01:00 committed by GitHub
parent e15fea7927
commit 2c1806434a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -313,7 +313,10 @@ StatusDropdown {
d.collectibleAmountText = ""
if (checkedKeys.includes(key)) {
const amount = root.usedTokens.find(entry => entry.key === key).amount
const amountBasicUnit = root.usedTokens.find(entry => entry.key === key).amount
const decimals = PermissionsHelpers.getTokenByKey(root.assetsModel, key).decimals
const amount = AmountsArithmetic.toNumber(amountBasicUnit, decimals)
if(d.extendedDropdownType === ExtendedDropdownContent.Type.Assets)
root.assetAmount = amount