From 2ca8fd04e2b461c913e2a6efab1584bb9184d514 Mon Sep 17 00:00:00 2001 From: Pascal Precht <445106+0x-r4bbit@users.noreply.github.com> Date: Thu, 9 Mar 2023 17:54:44 +0100 Subject: [PATCH] fix: apply proxy model to collectiblesModel This is needed to render commnity NFT artwork --- ui/app/AppLayouts/Chat/stores/RootStore.qml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/app/AppLayouts/Chat/stores/RootStore.qml b/ui/app/AppLayouts/Chat/stores/RootStore.qml index e083a3a711..9e62235821 100644 --- a/ui/app/AppLayouts/Chat/stores/RootStore.qml +++ b/ui/app/AppLayouts/Chat/stores/RootStore.qml @@ -82,8 +82,17 @@ QtObject { } } - property var collectiblesModel: chatCommunitySectionModule.collectiblesModel + property var collectiblesModel: SortFilterProxyModel { + sourceModel: chatCommunitySectionModule.collectiblesModel + proxyRoles: ExpressionRole { + function icon(icon) { + return !!icon ? icon : Style.png("tokens/DEFAULT-TOKEN") + } + name: "iconSource" + expression: icon(model.icon) + } + } // Since qml component doesn't follow encaptulation from the backend side, we're introducing // a method which will return appropriate chat content module for selected chat/channel function currentChatContentModule(){