π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Skip lifeCycle lockscreen if auth in last 5seconds
Neeraj Gupta0c73d1734767
diff --git a/lib/ui/tools/lock_screen.dart b/lib/ui/tools/lock_screen.dartindex fba6e6fc3b..ae5d92ed39 100644--- a/lib/ui/tools/lock_screen.dart+++ b/lib/ui/tools/lock_screen.dart@@ -17,6 +17,7 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {bool _isShowingLockScreen = false;bool _hasPlacedAppInBackground = false;bool _hasAuthenticationFailed = false;+ int? lastAuthenticatingTime;@overridevoid initState() {@@ -66,7 +67,10 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {// This is triggered either when the lock screen is dismissed or when// the app is brought to foreground_hasPlacedAppInBackground = false;- if (!_hasAuthenticationFailed) {+ final bool didAuthInLast5Seconds = lastAuthenticatingTime != null &&+ DateTime.now().millisecondsSinceEpoch - lastAuthenticatingTime! <+ 5000;+ if (!_hasAuthenticationFailed && !didAuthInLast5Seconds) {// Show the lock screen again only if the app is resuming from the// background, and not when the lock screen was explicitly dismissed_showLockScreen(source: "lifeCycle");@@ -100,6 +104,7 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {);_isShowingLockScreen = false;if (result) {+ lastAuthenticatingTime = DateTime.now().millisecondsSinceEpoch;AppLock.of(context)!.didUnlock();} else {_logger.info("Dismissed");