瀏覽代碼

Fix bug in setting showingLockScreen flag

Neeraj Gupta 1 年之前
父節點
當前提交
572417d3aa
共有 1 個文件被更改,包括 3 次插入1 次删除
  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) {
       if (!_hasAuthenticationFailed && !didAuthInLast5Seconds) {
         // Show the lock screen again only if the app is resuming from the
         // Show the lock screen again only if the app is resuming from the
         // background, and not when the lock screen was explicitly dismissed
         // background, and not when the lock screen was explicitly dismissed
-        _showLockScreen(source: "lifeCycle");
+        Future.delayed(
+            Duration.zero, () => _showLockScreen(source: "lifeCycle"));
       } else {
       } else {
         _hasAuthenticationFailed = false; // Reset failure state
         _hasAuthenticationFailed = false; // Reset failure state
       }
       }
@@ -117,6 +118,7 @@ class _LockScreenState extends State<LockScreen> with WidgetsBindingObserver {
         }
         }
       }
       }
     } catch (e, s) {
     } catch (e, s) {
+      _isShowingLockScreen = false;
       _logger.severe(e, s);
       _logger.severe(e, s);
     }
     }
   }
   }