1
0

qml wizard: stricter validation for new wallet name

user on bitcointalk [0] tried to create wallet with name "w/o 2FA".
Before this, one would only get an error after the last page of the wizard.
With this, the "Next" button does not even get enabled if the name does not look ok.
(and as in comment, maybe we should be even stricter re what is allowed)

[0]: https://bitcointalk.org/index.php?topic=5483514.msg63584789#msg63584789
This commit is contained in:
SomberNight
2024-02-04 08:54:40 +00:00
parent 1d4e2ebed6
commit 07dc80dd9a
2 changed files with 28 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ import QtQuick.Controls
import org.electrum 1.0
WizardComponent {
valid: wallet_name.text.length > 0 && !Daemon.availableWallets.wallet_name_exists(wallet_name.text)
valid: wiz.isValidNewWalletName(wallet_name.text)
function apply() {
wizard_data['wallet_name'] = wallet_name.text