fix: message when username is locked, and remove preferred username when released

This commit is contained in:
Richard Ramos 2021-08-10 13:40:10 -04:00 committed by Iuri Matias
parent 80343446ec
commit efcbb023a6
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -141,9 +141,7 @@ Item {
anchors.topMargin: 2
anchors.left: parent.left
anchors.leftMargin: 24
text: profileModel.ens.preferredUsername != username ?
qsTr("Username locked. You wont 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 wont be able to release it until %1").arg(Utils.formatShortDateStr(new Date(expiration).toDateString()))
color: Style.current.darkGrey
}