mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-02 09:46:38 +00:00
fix(ActivityCenter): Update AC notification on contact changes
Close #8586
This commit is contained in:
parent
130a5f48b4
commit
c50cf988a7
@ -19,6 +19,16 @@ ActivityNotificationMessage {
|
||||
readonly property bool accepted: notification && notification.message.contactRequestState === Constants.contactRequestStateAccepted
|
||||
readonly property bool dismissed: notification && notification.message.contactRequestState === Constants.contactRequestStateDismissed
|
||||
|
||||
Connections {
|
||||
target: root.isOutgoingRequest ? root.store.contactsStore.sentContactRequestsModel :
|
||||
root.store.contactsStore.receivedContactRequestsModel
|
||||
|
||||
function onItemChanged(pubKey) {
|
||||
if (pubKey === root.contactId)
|
||||
root.updateContactDetails()
|
||||
}
|
||||
}
|
||||
|
||||
maximumLineCount: 5
|
||||
messageDetails.messageText: {
|
||||
if (isOutgoingRequest && contactDetails) {
|
||||
|
@ -15,6 +15,16 @@ import "../panels"
|
||||
ActivityNotificationMessage {
|
||||
id: root
|
||||
|
||||
Connections {
|
||||
target: root.isOutgoingRequest ? root.store.contactsStore.sentContactRequestsModel :
|
||||
root.store.contactsStore.receivedContactRequestsModel
|
||||
|
||||
function onItemChanged(pubKey) {
|
||||
if (pubKey === root.contactId)
|
||||
root.updateContactDetails()
|
||||
}
|
||||
}
|
||||
|
||||
messageDetails.messageText: {
|
||||
if (!notification)
|
||||
return ""
|
||||
|
@ -18,8 +18,8 @@ ActivityNotificationBase {
|
||||
new Date(notification.timestamp).toLocaleString() : ""
|
||||
readonly property bool isOutgoingRequest: notification && notification.message.amISender
|
||||
readonly property string contactId: notification ? isOutgoingRequest ? notification.chatId : notification.author : ""
|
||||
readonly property var contactDetails: notification ? Utils.getContactDetailsAsJson(contactId, false) : null
|
||||
|
||||
property var contactDetails: null
|
||||
property int maximumLineCount: 2
|
||||
|
||||
signal messageClicked()
|
||||
@ -50,6 +50,21 @@ ActivityNotificationBase {
|
||||
Global.openProfilePopup(contactId)
|
||||
}
|
||||
|
||||
function updateContactDetails() {
|
||||
contactDetails = notification ? Utils.getContactDetailsAsJson(contactId, false) : null
|
||||
}
|
||||
|
||||
onContactIdChanged: root.updateContactDetails()
|
||||
|
||||
Connections {
|
||||
target: root.store.contactsStore.myContactsModel
|
||||
|
||||
function onItemChanged(pubKey) {
|
||||
if (pubKey === root.contactId)
|
||||
root.updateContactDetails()
|
||||
}
|
||||
}
|
||||
|
||||
bodyComponent: MouseArea {
|
||||
height: messageRow.implicitHeight
|
||||
hoverEnabled: root.messageBadgeComponent
|
||||
|
Loading…
x
Reference in New Issue
Block a user