Add fingerprints reset on first start

This commit is contained in:
2021-01-25 21:06:03 +01:00
parent 5d98d117e6
commit 5d47e71d23

View File

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