Bias of the day (#173)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-10-28 15:41:00 +01:00
1 parent e9c805f0df
commit 217b9c4db3
20 files changed
+491 -35

No files matched your search

@@ -249,6 +249,29 @@ public partial class Settings : ComponentBase, IMessageBusReceiver, IDisposable
await this.MessageBus.SendMessage<bool>(this, Event.CONFIGURATION_CHANGED);
}
#endregion
#region Bias-of-the-day related
private async Task ResetBiasOfTheDayHistory()
{
var dialogParameters = new DialogParameters
{
{ "Message", "Are you sure you want to reset your bias-of-the-day statistics? The system will no longer remember which biases you already know. As a result, biases you are already familiar with may be addressed again." },
};
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>("Reset your bias-of-the-day statistics", dialogParameters, DialogOptions.FULLSCREEN);
var dialogResult = await dialogReference.Result;
if (dialogResult is null || dialogResult.Canceled)
return;
this.SettingsManager.ConfigurationData.BiasOfTheDay.UsedBias.Clear();
this.SettingsManager.ConfigurationData.BiasOfTheDay.DateLastBiasDrawn = DateOnly.MinValue;
await this.SettingsManager.StoreSettings();
await this.MessageBus.SendMessage<bool>(this, Event.CONFIGURATION_CHANGED);
}
#endregion
#region Implementation of IMessageBusReceiver