mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-21 02:58:55 +00:00
fix(@desktop/onboarding): Improve password validation and showing don't match error
Fix #5319
This commit is contained in:
parent
991e04ef95
commit
0bb594d05f
@ -48,7 +48,11 @@ Column {
|
|||||||
currentPswInput.forceActiveFocus(Qt.MouseFocusReason)
|
currentPswInput.forceActiveFocus(Qt.MouseFocusReason)
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkPasswordMatches() {
|
function checkPasswordMatches(onlyIfConfirmPasswordHasFocus = true) {
|
||||||
|
if (onlyIfConfirmPasswordHasFocus && !confirmPswInput.textField.focus) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if(newPswInput.text.length >= root.minPswLen) {
|
if(newPswInput.text.length >= root.minPswLen) {
|
||||||
errorTxt.text = ""
|
errorTxt.text = ""
|
||||||
if(confirmPswInput.text !== newPswInput.text) {
|
if(confirmPswInput.text !== newPswInput.text) {
|
||||||
@ -300,10 +304,13 @@ Column {
|
|||||||
onTextChanged: { if(textField.text.length === newPswInput.text.length) root.checkPasswordMatches() }
|
onTextChanged: { if(textField.text.length === newPswInput.text.length) root.checkPasswordMatches() }
|
||||||
textField.onFocusChanged: {
|
textField.onFocusChanged: {
|
||||||
// When clicking into the confirmation input, validate if new password:
|
// When clicking into the confirmation input, validate if new password:
|
||||||
if(textField.focus) d.passwordValidation()
|
if(textField.focus) {
|
||||||
|
d.passwordValidation()
|
||||||
|
}
|
||||||
// When leaving the confirmation input because of the button or other input component is focused, check if password matches
|
// When leaving the confirmation input because of the button or other input component is focused, check if password matches
|
||||||
else root.checkPasswordMatches(true)
|
else {
|
||||||
|
root.checkPasswordMatches(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusFlatRoundButton {
|
StatusFlatRoundButton {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user