Skip to content

Commit

Permalink
ActivityNotificationMessage/Chat.RootStore: remove dependency on nim …
Browse files Browse the repository at this point in the history
…model's onItemChanged signal

Closes: #16754
  • Loading branch information
micieslak committed Nov 14, 2024
1 parent ea584f0 commit 325d358
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
16 changes: 6 additions & 10 deletions ui/app/AppLayouts/Chat/stores/RootStore.qml
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ QtObject {
}
}

readonly property QtObject _d: QtObject {
readonly property QtObject _d: StatusQUtils.QObject {
id: d

readonly property var userProfileInst: userProfile
Expand Down Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 325d358

Please sign in to comment.