fix(@desktop/wallet): Several fixes (#10971)

This commit is contained in:
Cuteivist 2023-06-12 11:08:37 +02:00 committed by GitHub
parent 82dced8826
commit cc7a2e9d32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -25,7 +25,7 @@ Item {
colorSelection.selectedColorIndex = Math.floor(Math.random() * colorSelection.model.length)
}
else {
let ind = d.evaluateColorIndex(root.store.addAccountModule.selectedColorId)
let ind = d.evaluateColorIndex(Utils.getColorForId(root.store.addAccountModule.selectedColorId))
colorSelection.selectedColorIndex = ind
}
@ -130,8 +130,8 @@ Item {
errorMessage: Utils.getErrorMessage(accountName.errors, qsTr("wallet account name"))
},
StatusRegularExpressionValidator {
regularExpression: Constants.regularExpressions.alphanumerical
errorMessage: Constants.errorMessages.alphanumericalRegExp
regularExpression: Constants.regularExpressions.alphanumericalWithSpace
errorMessage: Constants.errorMessages.alphanumericalWithSpaceRegExp
}
]

View File

@ -198,7 +198,7 @@ Rectangle {
readonly property bool itemLoaded: !model.assetsLoading // needed for e2e tests
width: ListView.view.width - Style.current.padding * 2
highlighted: !ListView.view.footerItem.button.highlighted &&
RootStore.overview.name === model.name
RootStore.overview.mixedcaseAddress.toLowerCase() === model.address.toLowerCase()
anchors.horizontalCenter: !!parent ? parent.horizontalCenter : undefined
title: model.name
subTitle: LocaleUtils.currencyAmountToLocaleString(model.currencyBalance)

View File

@ -596,6 +596,7 @@ QtObject {
readonly property QtObject regularExpressions: QtObject {
readonly property var alphanumerical: /^$|^[a-zA-Z0-9]+$/
readonly property var alphanumericalExpanded: /^$|^[a-zA-Z0-9\-_ ]+$/
readonly property var alphanumericalWithSpace: /^$|^[a-zA-Z0-9\s]+$/
readonly property var asciiPrintable: /^$|^[!-~]+$/
readonly property var ascii: /^$|^[\x00-\x7F]+$/
readonly property var capitalOnly: /^$|^[A-Z]+$/
@ -604,6 +605,7 @@ QtObject {
readonly property QtObject errorMessages: QtObject {
readonly property string alphanumericalRegExp: qsTr("Only letters and numbers allowed")
readonly property string alphanumericalWithSpaceRegExp: qsTr("Special characters are not allowed")
readonly property string alphanumericalExpandedRegExp: qsTr("Only letters, numbers, underscores, whitespaces and hyphens allowed")
readonly property string asciiRegExp: qsTr("Only letters, numbers and ASII characters allowed")
}