From 8d7ff095dd52de55bbe4847bdfe20b2bdace3029 Mon Sep 17 00:00:00 2001 From: Noelia Date: Thu, 8 Jun 2023 14:50:33 +0200 Subject: [PATCH] fix(MintToken): App crash when trying to create new token Accounts `color` role was changed to `colorId` so, `CommunityNewTokenView` has been updated accordingly. Closes #10991 --- .../communities/CommunityNewTokenView.qml | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ui/app/AppLayouts/Chat/views/communities/CommunityNewTokenView.qml b/ui/app/AppLayouts/Chat/views/communities/CommunityNewTokenView.qml index fe40d73f27..692dcbc2f2 100644 --- a/ui/app/AppLayouts/Chat/views/communities/CommunityNewTokenView.qml +++ b/ui/app/AppLayouts/Chat/views/communities/CommunityNewTokenView.qml @@ -10,11 +10,12 @@ import StatusQ.Core.Utils 0.1 as SQUtils import utils 1.0 - import AppLayouts.Wallet.controls 1.0 import shared.panels 1.0 import shared.popups 1.0 +import SortFilterProxyModel 0.2 + StatusScrollView { id: root @@ -150,7 +151,22 @@ StatusScrollView { readonly property string address: SQUtils.ModelUtils.get(root.accounts, currentIndex, "address") Layout.fillWidth: true - model: root.accounts + model: SortFilterProxyModel { + sourceModel: root.accounts + proxyRoles: [ + ExpressionRole { + name: "color" + + function getColor(colorId) { + return Utils.getColorForId(colorId) + } + + // Direct call for singleton function is not handled properly by + // SortFilterProxyModel that's why helper function is used instead. + expression: { return getColor(model.colorId) } + } + ] + } type: StatusComboBox.Type.Secondary size: StatusComboBox.Size.Small implicitHeight: 44