From 6a17ddffdf0687b6db3a8f0e0e0d3a5395fa1a13 Mon Sep 17 00:00:00 2001 From: julian Date: Sun, 4 Dec 2022 11:16:35 -0600 Subject: [PATCH] pin timer fix --- lib/pages/pinpad_views/lock_screen_view.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/pages/pinpad_views/lock_screen_view.dart b/lib/pages/pinpad_views/lock_screen_view.dart index 455d5ee3b..06323bb94 100644 --- a/lib/pages/pinpad_views/lock_screen_view.dart +++ b/lib/pages/pinpad_views/lock_screen_view.dart @@ -62,6 +62,7 @@ class _LockscreenViewState extends ConsumerState { bool _attemptLock = false; late Duration _timeout; static const maxAttemptsBeforeThrottling = 3; + Timer? _timer; Future _onUnlock() async { final now = DateTime.now().toUtc(); @@ -273,11 +274,11 @@ class _LockscreenViewState extends ConsumerState { _timeout = const Duration(minutes: 60); } - unawaited( - Future.delayed(_timeout).then((_) { + _timer?.cancel(); + _timer = Timer(_timeout, () { _attemptLock = false; _attempts = 0; - })); + }); } if (_attemptLock) {