fix: Unlock app with leading 0 in pin is not possible
fixes https://github.com/krille-chan/fluffychat/issues/2388
This commit is contained in:
parent
8d65b57a46
commit
07f2396790
1 changed files with 52 additions and 49 deletions
|
|
@ -21,6 +21,7 @@ class _LockScreenState extends State<LockScreen> {
|
||||||
final TextEditingController _textEditingController = TextEditingController();
|
final TextEditingController _textEditingController = TextEditingController();
|
||||||
|
|
||||||
void tryUnlock(String text) async {
|
void tryUnlock(String text) async {
|
||||||
|
text = text.trim();
|
||||||
setState(() {
|
setState(() {
|
||||||
_errorText = null;
|
_errorText = null;
|
||||||
});
|
});
|
||||||
|
|
@ -35,7 +36,7 @@ class _LockScreenState extends State<LockScreen> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AppLock.of(context).unlock(enteredPin.toString())) {
|
if (AppLock.of(context).unlock(text)) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_inputBlocked = false;
|
_inputBlocked = false;
|
||||||
_errorText = null;
|
_errorText = null;
|
||||||
|
|
@ -60,7 +61,8 @@ class _LockScreenState extends State<LockScreen> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return ScaffoldMessenger(
|
||||||
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(L10n.of(context).pleaseEnterYourPin),
|
title: Text(L10n.of(context).pleaseEnterYourPin),
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
|
|
@ -115,6 +117,7 @@ class _LockScreenState extends State<LockScreen> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue