Sfoglia il codice sorgente

Fix bug in setting showingLockScreen flag

Neeraj Gupta 1 anno fa
parent
commit
572417d3aa
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      lib/ui/tools/lock_screen.dart

+ 3 - 1
lib/ui/tools/lock_screen.dart

@@ -73,7 +73,8 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
       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");
+        Future.delayed(
+            Duration.zero, () => _showLockScreen(source: "lifeCycle"));
       } else {
         _hasAuthenticationFailed = false; // Reset failure state
       }
@@ -117,6 +118,7 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
         }
       }
     } catch (e, s) {
+      _isShowingLockScreen = false;
       _logger.severe(e, s);
     }
   }