From 5d47e71d236290bbb1aee57a165d888790280900 Mon Sep 17 00:00:00 2001 From: Eveldee Date: Mon, 25 Jan 2021 21:06:03 +0100 Subject: [PATCH] Add fingerprints reset on first start --- Views/TUIManager.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Views/TUIManager.cs b/Views/TUIManager.cs index 09ccd89..12607c7 100644 --- a/Views/TUIManager.cs +++ b/Views/TUIManager.cs @@ -17,6 +17,7 @@ namespace Akari.Provider.WaveshareUART.Views private Label _serialPortLabel; private Label _comparisonLevelLabel; private Label _userCountLabel; + private bool _needToClear; public TUIManager() { @@ -105,11 +106,23 @@ namespace Akari.Provider.WaveshareUART.Views // Init Sensor if (!File.Exists(SettingsFilePath)) { + _needToClear = true; + Application.Run(new SettingsDisplay()); } Provider.InitSensor(); + if (_needToClear) + { + if (!Provider.FingerprintSensor.DeleteAllUsers()) + { + MessageBox.ErrorQuery("Provider", "Can't clear registered fingerprints, check if the sensor is working correctly", "Ok"); + } + + _needToClear = false; + } + // Update gui UpdateSerialPort(); UpdateUserCount();