Versionshinweis hinzugefügt
This commit is contained in:
@@ -30,4 +30,9 @@ public class Settings {
|
||||
public List<Freistellung>? Freistellungen { get; set; }
|
||||
|
||||
public List<Sollstunden> Nominal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Version der API
|
||||
/// </summary>
|
||||
public string Version { get; set; }
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Runtime.CompilerServices;
|
||||
using System.Windows.Input;
|
||||
using CommunityToolkit.Maui.Alerts;
|
||||
using CommunityToolkit.Maui.Core;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
|
||||
namespace Jugenddienst_Stunden.ViewModels;
|
||||
@@ -195,6 +196,10 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
||||
try {
|
||||
BaseResponse dat = await HoursBase.LoadBase("hours&month=" + DateToday.ToString("MM"));
|
||||
_hour = dat.hour;
|
||||
|
||||
if (dat.settings.Version != AppInfo.Current.VersionString) {
|
||||
InfoEvent?.Invoke(this, "Du solltest deine Programmversion: " + AppInfo.Current.VersionString + " auf Version: " + dat.settings.Version + " updaten");
|
||||
}
|
||||
//_hour = await HoursBase.LoadData();
|
||||
RefreshProperties();
|
||||
} catch (Exception e) {
|
||||
@@ -218,11 +223,9 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
||||
GemeindeAktivSet = Settings.GemeindeAktivSet;
|
||||
ProjektAktivSet = Settings.ProjektAktivSet;
|
||||
|
||||
|
||||
OnPropertyChanged(nameof(GemeindeAktivSet));
|
||||
OnPropertyChanged(nameof(ProjektAktivSet));
|
||||
|
||||
|
||||
List<Sollstunden> _soll;
|
||||
TimeSpan span = TimeSpan.Zero;
|
||||
bool merker = false;
|
||||
@@ -249,7 +252,10 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
|
||||
} catch (Exception e) {
|
||||
DayTimes = new List<DayTime>();
|
||||
//TODO: hier könnte auch ein Fehler kommen, dann wäre InfoEvent falsch.
|
||||
InfoEvent?.Invoke(this, e.Message);
|
||||
|
||||
if (Settings.Version != AppInfo.Current.VersionString) {
|
||||
InfoEvent?.Invoke(this, "Du solltest deine Programmversion: " + AppInfo.Current.VersionString + " auf Version: " + Settings.Version + " updaten");
|
||||
} else { InfoEvent?.Invoke(this, e.Message); }
|
||||
} finally {
|
||||
OnPropertyChanged(nameof(DayTotal));
|
||||
OnPropertyChanged(nameof(Sollstunden));
|
||||
|
||||
@@ -55,7 +55,7 @@ public partial class StundenPage : ContentPage {
|
||||
MainThread.BeginInvokeOnMainThread(async () => {
|
||||
CancellationTokenSource cts = new CancellationTokenSource();
|
||||
ToastDuration duration = ToastDuration.Short;
|
||||
double fontSize = 20;
|
||||
double fontSize = 16;
|
||||
var toast = Toast.Make(e, duration, fontSize);
|
||||
await toast.Show(cts.Token);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user