From efcbb023a6d362542050a82213cd4192cdd8b583 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Tue, 10 Aug 2021 13:40:10 -0400 Subject: [PATCH] fix: message when username is locked, and remove preferred username when released --- src/app/profile/views/ens_manager.nim | 4 ++++ ui/app/AppLayouts/Profile/Sections/Ens/ENSDetails.qml | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/profile/views/ens_manager.nim b/src/app/profile/views/ens_manager.nim index e146b2e240..ac5f9ad6da 100644 --- a/src/app/profile/views/ens_manager.nim +++ b/src/app/profile/views/ens_manager.nim @@ -267,6 +267,10 @@ QtObject: self.transactionWasSent(response) self.pendingUsernames.excl(username) self.remove(username) + let preferredUsername = self.status.settings.getSetting[:string](Setting.PreferredUsername, "") + if username == preferredUsername: + self.setPreferredUsername("") + proc setPubKeyGasEstimate(self: EnsManager, ensUsername: string, address: string): int {.slot.} = var success: bool diff --git a/ui/app/AppLayouts/Profile/Sections/Ens/ENSDetails.qml b/ui/app/AppLayouts/Profile/Sections/Ens/ENSDetails.qml index 7887b12502..2229cfc421 100644 --- a/ui/app/AppLayouts/Profile/Sections/Ens/ENSDetails.qml +++ b/ui/app/AppLayouts/Profile/Sections/Ens/ENSDetails.qml @@ -141,9 +141,7 @@ Item { anchors.topMargin: 2 anchors.left: parent.left anchors.leftMargin: 24 - text: profileModel.ens.preferredUsername != username ? - qsTr("Username locked. You won’t be able to release it until %1").arg(Utils.formatShortDateStr(new Date(expiration).toDateString())): - qsTr("This is current preferred username. It can't be released") + text: qsTr("Username locked. You won’t be able to release it until %1").arg(Utils.formatShortDateStr(new Date(expiration).toDateString())) color: Style.current.darkGrey }