From f9782d68635c571ee38b69da73bccca0254e42d9 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 28 Mar 2024 19:49:14 +0200 Subject: [PATCH] fix(SendModal) missing icons for assets In case of assets the symbol doesn't have an icon representation in resources, hence we use the image of the asset itself. Same fix used for header and delegate Closes: #14218 --- .../send/controls/TokenBalancePerChainDelegate.qml | 5 ++++- .../shared/popups/send/panels/HoldingSelector.qml | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ui/imports/shared/popups/send/controls/TokenBalancePerChainDelegate.qml b/ui/imports/shared/popups/send/controls/TokenBalancePerChainDelegate.qml index fa3ac531ff..b9e305e89f 100644 --- a/ui/imports/shared/popups/send/controls/TokenBalancePerChainDelegate.qml +++ b/ui/imports/shared/popups/send/controls/TokenBalancePerChainDelegate.qml @@ -48,7 +48,10 @@ StatusListItem { let balance = !!model && !!model.currentCurrencyBalance ? model.currentCurrencyBalance : 0 return root.formatCurrentCurrencyAmount(balance) } - asset.name: symbol ? Style.png("tokens/" + symbol) : "" + // Community assets have a dedicated image streamed from status-go + asset.name: !!model.image + ? model.image + : Constants.tokenIcon(symbol) asset.isImage: true asset.width: 32 asset.height: 32 diff --git a/ui/imports/shared/popups/send/panels/HoldingSelector.qml b/ui/imports/shared/popups/send/panels/HoldingSelector.qml index 5a39e0afd1..a4e076eda6 100644 --- a/ui/imports/shared/popups/send/panels/HoldingSelector.qml +++ b/ui/imports/shared/popups/send/panels/HoldingSelector.qml @@ -98,7 +98,15 @@ Item { } property var assetIconSourceFn: function (asset) { - return !!asset && asset.symbol ? Style.png("tokens/%1".arg(asset.symbol)) : "" + if (!asset) { + return "" + } else if (asset.image) { + // Community assets have a dedicated image streamed from status-go + return asset.image + } else { + return Constants.tokenIcon(asset.symbol) + } + return "" } property var collectibleTextFn: function (item) {