From 8d283bf07fdc218aff455c293838d85a264f1a68 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Thu, 16 Sep 2021 16:05:25 +0200 Subject: [PATCH] fix(ContactsColumn): call `itemAt` on statusChatListItems.model instead of delegate When StatusQ switched to using `DelegateModel` in `StatusChatList` to enable drag and drop, we lost the API `itemAt` which was previously exposed via the `Repeater` that was aliased as `chatListItems`. StatusQ now exposes `statusChatListItems` additionally so we can still access `model.itemAt` which is used in this commit. The only reason this is done here though, is because we need to update the profile picture of contacts when we get a contact changed signal. Ideally, we handle contact changes including the profile picture entirely in the backend and have it then just rerender the screen (instead of using a `Connection`). Fixes #3328 --- ui/StatusQ | 2 +- ui/app/AppLayouts/Chat/ContactsColumn.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/StatusQ b/ui/StatusQ index 1d12d222f3..8095610873 160000 --- a/ui/StatusQ +++ b/ui/StatusQ @@ -1 +1 @@ -Subproject commit 1d12d222f35abd3d66d124b45039d5f8e8d7d30c +Subproject commit 80956108738f9e492f2ff98d0337a8f6f792fbf0 diff --git a/ui/app/AppLayouts/Chat/ContactsColumn.qml b/ui/app/AppLayouts/Chat/ContactsColumn.qml index 30275448c4..a6a723f4c6 100644 --- a/ui/app/AppLayouts/Chat/ContactsColumn.qml +++ b/ui/app/AppLayouts/Chat/ContactsColumn.qml @@ -229,7 +229,7 @@ Item { target: profileModel.contacts.list onContactChanged: { for (var i = 0; i < channelList.chatListItems.count; i++) { - let chatItem = channelList.chatListItems.itemAt(i); + let chatItem = channelList.statusChatListItems.model.itemAt(i); if (chatItem.chatId === pubkey) { let profileImage = appMain.getProfileImage(pubkey) if (!!profileImage) {