fix(Onboarding/ConfirmationPassword): Remove validation error and enable button only when pw is the expected

Removed code related to validation.

Modified enable button condition (just only when password is exactly the same than the previous introduced one).

Fixes #5611
This commit is contained in:
Noelia 2022-05-09 16:14:30 +02:00 committed by Noelia
parent 146ff7a48b
commit 0886a305a4
1 changed files with 6 additions and 20 deletions

View File

@ -110,21 +110,19 @@ OnboardingBasePage {
else filler.visible = false else filler.visible = false
} }
} }
}
// Just a column filler to keep the component height althought errorTxt.text is "" // Just a column filler to fit the design
Item { Item {
id: filler height: Style.current.padding
width: root.width width: parent.width
visible: true
height: errorTxt.height
}
} }
StatusButton { StatusButton {
id: submitBtn id: submitBtn
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Finalise Status Password Creation") text: qsTr("Finalise Status Password Creation")
enabled:!submitBtn.loading && confPswInput.text.length >= 6 enabled: !submitBtn.loading && (confPswInput.text === root.password)
property Timer sim: Timer { property Timer sim: Timer {
id: pause id: pause
@ -136,19 +134,7 @@ OnboardingBasePage {
} }
} }
function checkPasswordMatches() {
if (confPswInput.text !== root.password) {
errorTxt.text = qsTr("Passwords don't match")
return false
}
return true
}
onClicked: { onClicked: {
if (!checkPasswordMatches()) {
return
}
if (OnboardingStore.accountCreated) { if (OnboardingStore.accountCreated) {
if (root.password !== root.tmpPass) { if (root.password !== root.tmpPass) {
OnboardingStore.changePassword(root.tmpPass, root.password); OnboardingStore.changePassword(root.tmpPass, root.password);