Push vibrations update
This commit is contained in:
@@ -42,6 +42,9 @@ public partial class OptionsViewModel : ObservableObject
|
||||
[ObservableProperty]
|
||||
private string currentDatabasePath = string.Empty;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool notificationVibrationEnabled;
|
||||
|
||||
[ObservableProperty]
|
||||
private OptionsTab selectedTab = OptionsTab.Notifications;
|
||||
|
||||
@@ -139,6 +142,7 @@ public partial class OptionsViewModel : ObservableObject
|
||||
await LoadSymptomsAsync();
|
||||
await LoadSchedulesAsync();
|
||||
|
||||
NotificationVibrationEnabled = await _notificationScheduler.GetVibrationEnabledAsync();
|
||||
UseExternalDatabase = _databaseLocationService.UseExternalDatabase;
|
||||
ExternalDatabasePath = _databaseLocationService.ExternalDatabasePath;
|
||||
CurrentDatabasePath = _appDatabase.CurrentPath;
|
||||
@@ -438,6 +442,8 @@ public partial class OptionsViewModel : ObservableObject
|
||||
|
||||
private async Task SaveSchedulesAsync()
|
||||
{
|
||||
await _notificationScheduler.SetVibrationEnabledAsync(NotificationVibrationEnabled);
|
||||
|
||||
var granted = await _notificationScheduler.EnsurePermissionAsync();
|
||||
if (!granted)
|
||||
{
|
||||
@@ -464,7 +470,9 @@ public partial class OptionsViewModel : ObservableObject
|
||||
await _notificationScheduler.SyncAsync();
|
||||
await LoadSchedulesAsync();
|
||||
|
||||
StatusText = "Benachrichtigungszeiten gespeichert.";
|
||||
StatusText = NotificationVibrationEnabled
|
||||
? "Benachrichtigungszeiten gespeichert. Vibration ist aktiv."
|
||||
: "Benachrichtigungszeiten gespeichert. Vibration ist aus.";
|
||||
}
|
||||
|
||||
private Task DeleteScheduleAsync(NotificationScheduleItemViewModel? item)
|
||||
|
||||
Reference in New Issue
Block a user