mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-19 18:18:38 +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)
|
||||
}
|
||||
|
||||
function checkPasswordMatches() {
|
||||
function checkPasswordMatches(onlyIfConfirmPasswordHasFocus = true) {
|
||||
if (onlyIfConfirmPasswordHasFocus && !confirmPswInput.textField.focus) {
|
||||
return
|
||||
}
|
||||
|
||||
if(newPswInput.text.length >= root.minPswLen) {
|
||||
errorTxt.text = ""
|
||||
if(confirmPswInput.text !== newPswInput.text) {
|
||||
@ -300,10 +304,13 @@ Column {
|
||||
onTextChanged: { if(textField.text.length === newPswInput.text.length) root.checkPasswordMatches() }
|
||||
textField.onFocusChanged: {
|
||||
// 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
|
||||
else root.checkPasswordMatches(true)
|
||||
else {
|
||||
root.checkPasswordMatches(false)
|
||||
}
|
||||
}
|
||||
|
||||
StatusFlatRoundButton {
|
||||
|
Loading…
x
Reference in New Issue
Block a user