Merge branch 'vaelio-main-patch-78392' into 'main'

Fixing security pin removal issue

Closes #308

See merge request famedly/fluffychat!391
This commit is contained in:
Krille Fear 2021-03-05 18:10:09 +00:00
commit 09bb1d8f0d

View File

@ -314,13 +314,10 @@ class _SettingsState extends State<Settings> {
textFields: [
DialogTextField(
validator: (text) {
if (int.tryParse(text) == null || int.tryParse(text) < 0) {
return L10n.of(context).pleaseEnter4Digits;
if (text.isEmpty || (text.length == 4 && int.tryParse(text) >= 0)) {
return null;
}
if (text.length != 4 && text.isNotEmpty) {
return L10n.of(context).pleaseEnter4Digits;
}
return null;
return L10n.of(context).pleaseEnter4Digits;
},
keyboardType: TextInputType.number,
obscureText: true,