From fb420b2ff70a930129251ae50bf40d245487d948 Mon Sep 17 00:00:00 2001 From: Kateryna Kostiuk Date: Wed, 21 Jun 2023 17:03:42 -0400 Subject: [PATCH] addmemberpanel: simplify and avoid extra model resets Change-Id: I3989f386127c55c224311afc0aa0b89303579dec --- src/app/mainview/components/AddMemberPanel.qml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/app/mainview/components/AddMemberPanel.qml b/src/app/mainview/components/AddMemberPanel.qml index a958615c..839c9046 100644 --- a/src/app/mainview/components/AddMemberPanel.qml +++ b/src/app/mainview/components/AddMemberPanel.qml @@ -57,20 +57,8 @@ Rectangle { Layout.leftMargin: 4 Layout.rightMargin: 4 - model: ContactAdapter.getContactSelectableModel(type) - - Connections { - target: CurrentConversationMembers - - function onCountChanged() { - contactPickerListView.model = ContactAdapter.getContactSelectableModel(type); - } - } - - onVisibleChanged: { - if (visible) - model = ContactAdapter.getContactSelectableModel(type); - } + // Reset the model if visible or the CurrentConversationMembers.count changes (0 or greater) + model: visible && CurrentConversationMembers.count >= 0 ? ContactAdapter.getContactSelectableModel(type) : null delegate: ContactPickerItemDelegate { id: contactPickerItemDelegate