From 27bfe22af0702e30824792c4422d524882843976 Mon Sep 17 00:00:00 2001 From: Alex Jbanca Date: Tue, 14 May 2024 11:15:15 +0300 Subject: [PATCH] fix: Reload contact info whenever the profile dirty flag is dropped We need to manually request the contact information again because the contact object is not live --- ui/imports/shared/views/ProfileDialogView.qml | 11 ++++++++--- .../shared/views/profile/ProfileShowcaseView.qml | 10 ++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ui/imports/shared/views/ProfileDialogView.qml b/ui/imports/shared/views/ProfileDialogView.qml index 260eab236a..d660a4114f 100644 --- a/ui/imports/shared/views/ProfileDialogView.qml +++ b/ui/imports/shared/views/ProfileDialogView.qml @@ -129,6 +129,11 @@ Pane { d.reload() } + onDirtyChanged: { + if (!dirty) + d.reload() + } + Component { id: btnEditProfileComponent StatusButton { @@ -504,8 +509,7 @@ Pane { font.bold: true font.pixelSize: 22 elide: Text.ElideRight - text: root.dirty ? root.dirtyValues.displayName - : StatusQUtils.Emoji.parse(d.mainDisplayName, StatusQUtils.Emoji.size.middle) + text: StatusQUtils.Emoji.parse(root.dirty ? root.dirtyValues.displayName : d.mainDisplayName, StatusQUtils.Emoji.size.middle) } StatusContactVerificationIcons { id: verificationIcons @@ -633,7 +637,8 @@ Pane { Layout.preferredHeight: 300 currentTabIndex: showcaseTabBar.currentIndex - mainDisplayName: d.mainDisplayName + mainDisplayName: root.dirty ? root.dirtyValues.displayName + : d.mainDisplayName readOnly: root.readOnly communitiesModel: root.showcaseCommunitiesModel diff --git a/ui/imports/shared/views/profile/ProfileShowcaseView.qml b/ui/imports/shared/views/profile/ProfileShowcaseView.qml index be501598f8..c8fbe3748d 100644 --- a/ui/imports/shared/views/profile/ProfileShowcaseView.qml +++ b/ui/imports/shared/views/profile/ProfileShowcaseView.qml @@ -50,6 +50,8 @@ Control { property int delegateHeightS: 152 property int delegateWidthM: 202 property int delegateHeightM: 160 + + readonly property string displayNameVerySmallEmoji: StatusQUtils.Emoji.parse(root.mainDisplayName, StatusQUtils.Emoji.size.verySmall) } component PositionSFPM: SortFilterProxyModel { @@ -127,7 +129,7 @@ Control { cellWidth: d.delegateWidthM cellHeight: d.delegateHeightM - mainDisplayName: root.mainDisplayName + mainDisplayName: d.displayNameVerySmallEmoji readOnly: root.readOnly globalAssetsModel: root.globalAssetsModel globalCollectiblesModel: root.globalCollectiblesModel @@ -142,7 +144,7 @@ Control { width: parent.width height: parent.height - mainDisplayName: root.mainDisplayName + mainDisplayName: d.displayNameVerySmallEmoji sendToAccountEnabled: root.sendToAccountEnabled accountsModel: accountsProxyModel walletStore: root.walletStore @@ -160,7 +162,7 @@ Control { cellWidth: d.delegateWidthS cellHeight: d.delegateHeightS - mainDisplayName: root.mainDisplayName + mainDisplayName: d.displayNameVerySmallEmoji collectiblesModel: collectiblesProxyModel walletStore: root.walletStore @@ -199,7 +201,7 @@ Control { cellWidth: d.delegateWidthS cellHeight: d.delegateHeightS - mainDisplayName: root.mainDisplayName + mainDisplayName: d.displayNameVerySmallEmoji socialLinksModel: socialLinksProxyModel onCopyToClipboard: root.copyToClipboard(text)