mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 12:39:47 +00:00
29 lines
1.3 KiB
C#
29 lines
1.3 KiB
C#
using AIStudio.Dialogs;
|
|
|
|
using DialogOptions = AIStudio.Dialogs.DialogOptions;
|
|
|
|
namespace AIStudio.Components.Settings;
|
|
|
|
public partial class SettingsPanelAssistantBias : SettingsPanelBase
|
|
{
|
|
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);
|
|
}
|
|
|
|
protected override SettingsPanel Type => SettingsPanel.ASSISTANT_BIAS_OF_THE_DAY_PANEL;
|
|
} |