ActivityNotificationMessage/Chat.RootStore: remove dependency on nim model's onItemChanged signal

Closes: #16754
This commit is contained in:
Michał Cieślak 2024-11-13 17:46:45 +01:00 committed by Michał
parent ea584f0693
commit 325d3588d3
2 changed files with 11 additions and 16 deletions

View File

@ -640,7 +640,7 @@ QtObject {
}
}
readonly property QtObject _d: QtObject {
readonly property QtObject _d: StatusQUtils.QObject {
id: d
readonly property var userProfileInst: userProfile
@ -675,16 +675,12 @@ QtObject {
d.oneToOneChatContact.displayName,
d.oneToOneChatContact.alias) : ""
//Update oneToOneChatContact when the contact is updated
readonly property var myContactsModelConnection: Connections {
target: root.contactsStore.contactsModel ?? null
enabled: d.activeChatType === Constants.chatType.oneToOne
StatusQUtils.ModelEntryChangeTracker {
model: root.contactsStore.contactsModel
role: "pubKey"
key: d.activeChatId
function onItemChanged(pubKey) {
if (pubKey === d.activeChatId) {
d.oneToOneChatContact = Utils.getContactDetailsAsJson(pubKey, false)
}
}
onItemChanged: d.oneToOneChatContact = Utils.getContactDetailsAsJson(d.activeChatId, false)
}
readonly property bool isUserAllowedToSendMessage: {

View File

@ -61,13 +61,12 @@ ActivityNotificationBase {
onContactIdChanged: root.updateContactDetails()
Connections {
target: root.store.contactsStore.contactsModel
CoreUtils.ModelEntryChangeTracker {
model: root.store.contactsStore.contactsModel
role: "pubKey"
key: root.contactId
function onItemChanged(pubKey) {
if (pubKey === root.contactId)
root.updateContactDetails()
}
onItemChanged: root.updateContactDetails()
}
bodyComponent: MouseArea {