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) {