Merge pull request #3247 from grummbeer/improve-input-of-permanent-password
improve input of permanent password
This commit is contained in:
commit
dd0051caae
@ -596,15 +596,15 @@ void setPasswordDialog() async {
|
||||
});
|
||||
final pass = p0.text.trim();
|
||||
if (pass.isNotEmpty) {
|
||||
for (var r in rules) {
|
||||
if (!r.validate(pass)) {
|
||||
final Iterable violations = rules.where((r) => !r.validate(pass));
|
||||
if (violations.isNotEmpty) {
|
||||
setState(() {
|
||||
errMsg0 = '${translate('Prompt')}: ${r.name}';
|
||||
errMsg0 =
|
||||
'${translate('Prompt')}: ${violations.map((r) => r.name).join(', ')}';
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (p1.text.trim() != pass) {
|
||||
setState(() {
|
||||
errMsg1 =
|
||||
@ -639,6 +639,9 @@ void setPasswordDialog() async {
|
||||
autofocus: true,
|
||||
onChanged: (value) {
|
||||
rxPass.value = value.trim();
|
||||
setState(() {
|
||||
errMsg0 = '';
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
@ -662,6 +665,11 @@ void setPasswordDialog() async {
|
||||
labelText: translate('Confirmation'),
|
||||
errorText: errMsg1.isNotEmpty ? errMsg1 : null),
|
||||
controller: p1,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
errMsg1 = '';
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user