mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-12 05:34:31 +00:00
pin timer fix
This commit is contained in:
parent
1d764c13e9
commit
6a17ddffdf
1 changed files with 4 additions and 3 deletions
|
@ -62,6 +62,7 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
|
|||
bool _attemptLock = false;
|
||||
late Duration _timeout;
|
||||
static const maxAttemptsBeforeThrottling = 3;
|
||||
Timer? _timer;
|
||||
|
||||
Future<void> _onUnlock() async {
|
||||
final now = DateTime.now().toUtc();
|
||||
|
@ -273,11 +274,11 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
|
|||
_timeout = const Duration(minutes: 60);
|
||||
}
|
||||
|
||||
unawaited(
|
||||
Future<void>.delayed(_timeout).then((_) {
|
||||
_timer?.cancel();
|
||||
_timer = Timer(_timeout, () {
|
||||
_attemptLock = false;
|
||||
_attempts = 0;
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
if (_attemptLock) {
|
||||
|
|
Loading…
Reference in a new issue