1
0

qml: don't show error when textfield is empty, don't log error when optional propert is undefined

This commit is contained in:
Sander van Grieken
2023-10-23 15:30:56 +02:00
parent b0dbdfd5e4
commit eb676b3dc1

View File

@@ -15,7 +15,7 @@ WizardComponent {
property int cosigner: 0
property int participants: 0
property string multisigMasterPubkey: wizard_data['multisig_master_pubkey']
property string multisigMasterPubkey
function apply() {
applyMasterKey(masterkey_ta.text)
@@ -35,6 +35,11 @@ WizardComponent {
validationtext.text = ''
key = key.trim()
if (!key) {
validationtext.text = ''
return false
}
if (!bitcoin.verifyMasterKey(key, wizard_data['wallet_type'])) {
validationtext.text = qsTr('Error: invalid master key')
return false
@@ -179,7 +184,9 @@ WizardComponent {
Bitcoin {
id: bitcoin
onValidationMessageChanged: validationtext.text = validationMessage
onValidationMessageChanged: {
validationtext.text = validationMessage
}
}
Component.onCompleted: {
@@ -187,6 +194,10 @@ WizardComponent {
if ('multisig_current_cosigner' in wizard_data)
cosigner = wizard_data['multisig_current_cosigner']
participants = wizard_data['multisig_participants']
if ('multisig_master_pubkey' in wizard_data) {
multisigMasterPubkey = wizard_data['multisig_master_pubkey']
}
}
Qt.callLater(masterkey_ta.forceActiveFocus)
}