Skip to content

Commit

Permalink
Unlock Screen only authenticates on resume
Browse files Browse the repository at this point in the history
  • Loading branch information
GleammerRay committed Mar 18, 2024
1 parent 98acabd commit b87c203
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/screens/unlock_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ class _UnlockScreen extends State<UnlockScreen> with WidgetsBindingObserver {
}

Future<void> _bioAuth() async {
if (!Platform.isAndroid && !Platform.isIOS) return;
LoadedAccount? account = data.loadedAccount;
if (account == null) return;
if (UnlockScreen.isAuthenticating) return;
if (!mounted) return;
if (!Platform.isAndroid && !Platform.isIOS) return;
if (!account.bioAuthEnabled) return;
UnlockScreen.isAuthenticating = true;
try {
Expand Down Expand Up @@ -136,8 +136,10 @@ class _UnlockScreen extends State<UnlockScreen> with WidgetsBindingObserver {
if ((state != AppLifecycleState.resumed) &&
(state != AppLifecycleState.inactive)) return;
setState(() => _unlockScreenOn = true);
_passwordFocus.requestFocus();
await _bioAuth();
if (state == AppLifecycleState.resumed) {
_passwordFocus.requestFocus();
await _bioAuth();
}
}

@override
Expand Down

0 comments on commit b87c203

Please sign in to comment.