fix(@desktop/wallet): Update wallet account color correctly (#11008)

This commit is contained in:
Cuteivist 2023-06-12 10:14:19 +02:00 committed by GitHub
parent a465417981
commit f0b42ad672
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 6 deletions

View File

@ -160,6 +160,10 @@ Item {
id: transactionDetailView
Layout.fillWidth: true
Layout.fillHeight: true
onVisibleChanged: {
if (!visible)
transaction = null
}
sendModal: root.sendModal
contactsStore: root.contactsStore
visible: (stack.currentIndex === 3)

View File

@ -73,11 +73,17 @@ Item {
readonly property var prefixAndAddress: Utils.splitToChainPrefixAndAddress(root.address)
readonly property bool isContact: contactData.isContact
readonly property bool isWallet: !isContact && !!walletAddressName
property var contactData: Utils.getContactDetailsAsJson(d.contactPubKey)
property string savedAddressName: !!root.rootStore ? root.rootStore.getNameForSavedWalletAddress(root.address) : ""
property string walletAddressName: !!root.rootStore ? root.rootStore.getNameForWalletAddress(root.address) : ""
property string walletAddressEmoji: !!root.rootStore ? root.rootStore.getEmojiForWalletAddress(root.address) : ""
property string walletAddressColor: !!root.rootStore ? root.rootStore.getColorForWalletAddress(root.address) : ""
property var contactData
property string savedAddressName
property string walletAddressName
property string walletAddressEmoji
property string walletAddressColor
Component.onCompleted: {
refreshContactData()
refreshSavedAddressName()
refreshWalletAddress()
}
function refreshContactData() {
d.contactData = Utils.getContactDetailsAsJson(d.contactPubKey)
@ -90,7 +96,7 @@ Item {
function refreshWalletAddress() {
d.walletAddressName = !!root.rootStore ? root.rootStore.getNameForWalletAddress(root.address) : ""
d.walletAddressEmoji = !!root.rootStore ? root.rootStore.getEmojiForWalletAddress(root.address) : ""
d.walletAddressColor = !!root.rootStore ? root.rootStore.getColorForWalletAddress(root.address) : ""
d.walletAddressColor = Utils.getColorForId(!!root.rootStore ? root.rootStore.getColorForWalletAddress(root.address) : "")
}
function getName() {