From 1799f37b86afeda357b3943d7eac2076d507c429 Mon Sep 17 00:00:00 2001 From: Lange99 Date: Fri, 18 Dec 2020 20:32:39 +0100 Subject: [PATCH] bug fix dell'ultimo secondo --- README.md | 2 +- lib/NfcKeyManager.dart | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f009d5..3779f97 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ There are 2 ways to enable a tag: If the tag is not enabled and has never been read, in the event of an access attempt, it will have 3 possibilities to be enabled. If it is not enabled within the third attempt, the tag will be blocked. - +if a tag is enabled, it is removed from the blocked list and its attempts are reset If a tag is blocked it is always possible to unlock it by enabling it. diff --git a/lib/NfcKeyManager.dart b/lib/NfcKeyManager.dart index 99febc9..2556200 100644 --- a/lib/NfcKeyManager.dart +++ b/lib/NfcKeyManager.dart @@ -57,7 +57,10 @@ class NfcManager { if (availableKey.contains(tag.id) == true) { availableKey.remove(tag.id); if (attempts.containsKey(tag.id) == true){ - attempts.remove(tag.id); + attempts.update(tag.id, (value) => 0); + } + if( deniedKey.contains(tag.id)== true){ + deniedKey.remove(tag.id); } log.add(tag.id + ": tag enabled"); return 1;