fix(@desktop/chat): fix identicon in transaction preview

fixes: #5477
This commit is contained in:
Patryk Osmaczko 2022-04-13 15:39:19 +02:00 committed by Iuri Matias
parent 24a662676e
commit f59f0f69c5
3 changed files with 13 additions and 9 deletions

View File

@ -333,7 +333,8 @@ Item {
return { return {
address: Constants.zeroAddress, // Setting as zero address since we don't have the address yet address: Constants.zeroAddress, // Setting as zero address since we don't have the address yet
alias: chatContentModule.chatDetails.name, // Do we need the alias for real or name works? alias: chatContentModule.chatDetails.name, // Do we need the alias for real or name works?
identicon: chatContentModule.chatDetails.icon, pubKey: chatContentModule.chatDetails.id,
icon: chatContentModule.chatDetails.icon,
name: chatContentModule.chatDetails.name, name: chatContentModule.chatDetails.name,
type: RecipientSelector.Type.Contact, type: RecipientSelector.Type.Contact,
ensVerified: true ensVerified: true
@ -367,7 +368,8 @@ Item {
return { return {
address: Constants.zeroAddress, // Setting as zero address since we don't have the address yet address: Constants.zeroAddress, // Setting as zero address since we don't have the address yet
alias: chatContentModule.chatDetails.name, // Do we need the alias for real or name works? alias: chatContentModule.chatDetails.name, // Do we need the alias for real or name works?
identicon: chatContentModule.chatDetails.icon, pubKey: chatContentModule.chatDetails.id,
icon: chatContentModule.chatDetails.icon,
name: chatContentModule.chatDetails.name, name: chatContentModule.chatDetails.name,
type: RecipientSelector.Type.Contact type: RecipientSelector.Type.Contact
} }

View File

@ -189,8 +189,8 @@ Item {
if (!selectedContact || !selAddressSource.selectedSource || !selectedContact.address || (selAddressSource.selectedSource && selAddressSource.selectedSource.value !== RecipientSelector.Type.Contact)) { if (!selectedContact || !selAddressSource.selectedSource || !selectedContact.address || (selAddressSource.selectedSource && selAddressSource.selectedSource.value !== RecipientSelector.Type.Contact)) {
return return
} }
const { address, name, alias, isContact, ensVerified } = selectedContact const { address, name, alias, pubKey, icon, isContact, ensVerified } = selectedContact
root.selectedRecipient = { address, name, alias, isContact, ensVerified, type: RecipientSelector.Type.Contact } root.selectedRecipient = { address, name, alias, pubKey, icon, isContact, ensVerified, type: RecipientSelector.Type.Contact }
} }
onIsValidChanged: root.validate() onIsValidChanged: root.validate()
} }

View File

@ -4,14 +4,16 @@ import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13 import QtGraphicalEffects 1.13
import StatusQ.Controls 0.1 as StatusQ import StatusQ.Controls 0.1 as StatusQ
import StatusQ.Components 0.1
import utils 1.0 import utils 1.0
import "../status" import "../status"
import "../panels" import "../panels"
import "../controls" import "../controls"
import "../popups" import "../popups"
import shared.controls.chat 1.0
import StatusQ.Components 0.1
Item { Item {
id: root id: root
@ -161,7 +163,6 @@ Item {
} }
PropertyChanges { PropertyChanges {
target: idtToContact target: idtToContact
image.source: root.toAccount.identicon
visible: true visible: true
} }
PropertyChanges { PropertyChanges {
@ -255,14 +256,15 @@ Item {
visible: false visible: false
source: imgToWallet source: imgToWallet
} }
StatusSmartIdenticon { UserImage {
id: idtToContact id: idtToContact
visible: false visible: false
anchors.right: toInvalid.visible ? toInvalid.left : parent.right anchors.right: toInvalid.visible ? toInvalid.left : parent.right
anchors.rightMargin: toInvalid.visible ? Style.current.halfPadding : 0 anchors.rightMargin: toInvalid.visible ? Style.current.halfPadding : 0
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
image.width: 32 name: root.toAccount.name
image.height: 32 pubkey: root.toAccount.pubKey
image: root.toAccount.icon
} }
SVGImage { SVGImage {
id: toInvalid id: toInvalid