diff --git a/ui/app/AppLayouts/Profile/popups/RenameAccontModal.qml b/ui/app/AppLayouts/Profile/popups/RenameAccontModal.qml index 70bae4e732..dddd7f70e3 100644 --- a/ui/app/AppLayouts/Profile/popups/RenameAccontModal.qml +++ b/ui/app/AppLayouts/Profile/popups/RenameAccontModal.qml @@ -66,8 +66,13 @@ StatusModal { //% "You need to enter an account name" errorMessage: qsTrId("you-need-to-enter-an-account-name") minLength: 1 + }, + StatusRegularExpressionValidator { + regularExpression: /^[^<>]+$/ + errorMessage: qsTr("This is not a valid account name") } ] + charLimit: 40 } StatusColorSelectorGrid { @@ -104,7 +109,7 @@ StatusModal { //% "Change Name" text: qsTr("Change Name") - enabled: accountNameInput.text !== "" + enabled: accountNameInput.text !== "" && accountNameInput.valid MessageDialog { id: changeError diff --git a/ui/app/AppLayouts/Wallet/popups/AddAccountWithPrivateKeyModal.qml b/ui/app/AppLayouts/Wallet/popups/AddAccountWithPrivateKeyModal.qml index dfa325996a..dea002d245 100644 --- a/ui/app/AppLayouts/Wallet/popups/AddAccountWithPrivateKeyModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/AddAccountWithPrivateKeyModal.qml @@ -143,8 +143,13 @@ StatusModal { //% "You need to enter an account name" errorMessage: qsTrId("you-need-to-enter-an-account-name") minLength: 1 + }, + StatusRegularExpressionValidator { + regularExpression: /^[^<>]+$/ + errorMessage: qsTr("This is not a valid account name") } ] + charLimit: 40 } StatusColorSelectorGrid { @@ -168,7 +173,7 @@ StatusModal { //% "Add account" qsTrId("add-account") - enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountPKeyInput.text !== "" + enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid && accountPKeyInput.text !== "" MessageDialog { id: accountError diff --git a/ui/app/AppLayouts/Wallet/popups/AddAccountWithSeedModal.qml b/ui/app/AppLayouts/Wallet/popups/AddAccountWithSeedModal.qml index 46cbeab155..196f83ca2e 100644 --- a/ui/app/AppLayouts/Wallet/popups/AddAccountWithSeedModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/AddAccountWithSeedModal.qml @@ -131,8 +131,13 @@ StatusModal { //% "You need to enter an account name" errorMessage: qsTrId("you-need-to-enter-an-account-name") minLength: 1 + }, + StatusRegularExpressionValidator { + regularExpression: /^[^<>]+$/ + errorMessage: qsTr("This is not a valid account name") } ] + charLimit: 40 } StatusColorSelectorGrid { @@ -156,7 +161,7 @@ StatusModal { //% "Add account" qsTrId("add-account") - enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && seedPhraseTextArea.correctWordCount + enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid && seedPhraseTextArea.correctWordCount MessageDialog { id: accountError diff --git a/ui/app/AppLayouts/Wallet/popups/AddWatchOnlyAccountModal.qml b/ui/app/AppLayouts/Wallet/popups/AddWatchOnlyAccountModal.qml index 361a9e4ef5..d156da6397 100644 --- a/ui/app/AppLayouts/Wallet/popups/AddWatchOnlyAccountModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/AddWatchOnlyAccountModal.qml @@ -89,8 +89,13 @@ StatusModal { //% "You need to enter an account name" errorMessage: qsTrId("you-need-to-enter-an-account-name") minLength: 1 + }, + StatusRegularExpressionValidator { + regularExpression: /^[^<>]+$/ + errorMessage: qsTr("This is not a valid account name") } ] + charLimit: 40 } StatusColorSelectorGrid { @@ -114,7 +119,7 @@ StatusModal { //% "Add account" qsTrId("add-account") - enabled: !loading && addressInput.text !== "" && accountNameInput.text !== "" + enabled: !loading && addressInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid MessageDialog { id: accountError diff --git a/ui/app/AppLayouts/Wallet/popups/GenerateAccountModal.qml b/ui/app/AppLayouts/Wallet/popups/GenerateAccountModal.qml index 3d6fdfe27a..0d7ef1ae75 100644 --- a/ui/app/AppLayouts/Wallet/popups/GenerateAccountModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/GenerateAccountModal.qml @@ -104,8 +104,13 @@ StatusModal { //% "You need to enter an account name" errorMessage: qsTrId("you-need-to-enter-an-account-name") minLength: 1 + }, + StatusRegularExpressionValidator { + regularExpression: /^[^<>]+$/ + errorMessage: qsTr("This is not a valid account name") } ] + charLimit: 40 } StatusColorSelectorGrid { @@ -129,7 +134,7 @@ StatusModal { //% "Add account" qsTrId("add-account") - enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" + enabled: !loading && passwordInput.text !== "" && accountNameInput.text !== "" && accountNameInput.valid MessageDialog { id: accountError