Beautifiing Login Process

This commit is contained in:
2024-08-21 20:18:04 +02:00
parent 13db083891
commit 23ea92baf6
3 changed files with 15 additions and 17 deletions

View File

@@ -27,22 +27,22 @@ public partial class AboutPage : ContentPage {
_lastDetectionTime = currentTime;
foreach (var barcode in e.Results) {
if (Preferences.Default.Get("apiKey", "") != barcode.Value) {
MainThread.InvokeOnMainThreadAsync(async() => {
MainThread.InvokeOnMainThreadAsync(async () => {
//DisplayAlert("Barcode erkannt", $"Barcode: {barcode.Format} - {barcode.Value}", "OK");
Preferences.Default.Set("apiKey", barcode.Value);
Models.Stunde.apiKey = barcode.Value;
var op = await Models.Operator.LoadData(barcode.Value);
Preferences.Default.Set("name", op.name);
Preferences.Default.Set("surname", op.surname);
DisplayAlert("Neuer Barcode erkannt", op.name + " " + op.surname, "OK");
DisplayAlert("Login erfolgreich", op.name + " " + op.surname, "OK");
Title = op.name + " " + op.surname;
});
} else {
MainThread.InvokeOnMainThreadAsync(() => {
DisplayAlert("Barcode bereits vorhanden",
DisplayAlert("Bereits eingeloggt",
Preferences.Default.Get("name", "") + " " + Preferences.Default.Get("surname", ""),
"OK");
});