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();