From cc7a2e9d320f74899bb6cb1a49ec7877a86045c8 Mon Sep 17 00:00:00 2001 From: Cuteivist Date: Mon, 12 Jun 2023 11:08:37 +0200 Subject: [PATCH] fix(@desktop/wallet): Several fixes (#10971) --- ui/app/AppLayouts/Wallet/addaccount/states/Main.qml | 6 +++--- ui/app/AppLayouts/Wallet/views/LeftTabView.qml | 2 +- ui/imports/utils/Constants.qml | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/addaccount/states/Main.qml b/ui/app/AppLayouts/Wallet/addaccount/states/Main.qml index ea3e6b657a..6e3c69997f 100644 --- a/ui/app/AppLayouts/Wallet/addaccount/states/Main.qml +++ b/ui/app/AppLayouts/Wallet/addaccount/states/Main.qml @@ -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 } ] diff --git a/ui/app/AppLayouts/Wallet/views/LeftTabView.qml b/ui/app/AppLayouts/Wallet/views/LeftTabView.qml index 83b109f955..d78c1cbf62 100644 --- a/ui/app/AppLayouts/Wallet/views/LeftTabView.qml +++ b/ui/app/AppLayouts/Wallet/views/LeftTabView.qml @@ -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) diff --git a/ui/imports/utils/Constants.qml b/ui/imports/utils/Constants.qml index b2b7e8c4c5..ac5f50640d 100644 --- a/ui/imports/utils/Constants.qml +++ b/ui/imports/utils/Constants.qml @@ -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") }