mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-12 13:44: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;
|
bool _attemptLock = false;
|
||||||
late Duration _timeout;
|
late Duration _timeout;
|
||||||
static const maxAttemptsBeforeThrottling = 3;
|
static const maxAttemptsBeforeThrottling = 3;
|
||||||
|
Timer? _timer;
|
||||||
|
|
||||||
Future<void> _onUnlock() async {
|
Future<void> _onUnlock() async {
|
||||||
final now = DateTime.now().toUtc();
|
final now = DateTime.now().toUtc();
|
||||||
|
@ -273,11 +274,11 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
|
||||||
_timeout = const Duration(minutes: 60);
|
_timeout = const Duration(minutes: 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
unawaited(
|
_timer?.cancel();
|
||||||
Future<void>.delayed(_timeout).then((_) {
|
_timer = Timer(_timeout, () {
|
||||||
_attemptLock = false;
|
_attemptLock = false;
|
||||||
_attempts = 0;
|
_attempts = 0;
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_attemptLock) {
|
if (_attemptLock) {
|
||||||
|
|
Loading…
Reference in a new issue