Skip to content

Commit

Permalink
fix(contact): fix fetching contact info when sending a CR
Browse files Browse the repository at this point in the history
Fixes #15205
  • Loading branch information
jrainville committed Dec 18, 2024
1 parent 8aebb81 commit a598ddd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ui/app/AppLayouts/Profile/stores/ContactsStore.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import utils 1.0
QtObject {
id: root

signal contactInfoRequestFinished(string publicKey, bool ok)

readonly property QtObject _d: QtObject {
id: d

Expand All @@ -18,6 +20,7 @@ QtObject {
Component.onCompleted: {
mainModuleInst.resolvedENS.connect(root.resolvedENS)
contactsModuleInst.trustStatusRemoved.connect(root.trustStatusRemoved)
contactsModuleInst.contactInfoRequestFinished.connect(root.contactInfoRequestFinished)
}
}

Expand Down
12 changes: 8 additions & 4 deletions ui/imports/shared/popups/SendContactRequestModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import StatusQ.Controls.Validators 0.1
import StatusQ.Popups.Dialog 0.1
import StatusQ.Core.Utils 0.1 as SQUtils

import AppLayouts.stores 1.0 as AppLayoutStores

Expand Down Expand Up @@ -44,13 +45,16 @@ CommonContactDialog {
}

readonly property var _conn: Connections {
target: root.rootStore.contactStore.contactsModule
enabled: root.loadingContactDetails
target: root.rootStore.contactStore

function onContactInfoRequestFinished(publicKey, ok) {
if (publicKey !== root.publicKey)
if (publicKey !== root.publicKey) {
return
if (ok)
root.contactDetails = Utils.getContactDetailsAsJson(root.publicKey, false)
}
if (ok) {
root.contactDetails = SQUtils.ModelUtils.getByKey(root.rootStore.contactStore.contactsModel, "pubKey", root.publicKey)
}
root.loadingContactDetails = false
}
}
Expand Down

0 comments on commit a598ddd

Please sign in to comment.