mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 18:59:47 +00:00
Fixed resource handling
This commit is contained in:
parent
4ecdc48fce
commit
6d2813a4bd
@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Components;
|
|||||||
|
|
||||||
namespace AIStudio.Components.Blocks;
|
namespace AIStudio.Components.Blocks;
|
||||||
|
|
||||||
public partial class ConfigurationProviderSelection : ComponentBase, IMessageBusReceiver
|
public partial class ConfigurationProviderSelection : ComponentBase, IMessageBusReceiver, IDisposable
|
||||||
{
|
{
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public Func<string> SelectedValue { get; set; } = () => string.Empty;
|
public Func<string> SelectedValue { get; set; } = () => string.Empty;
|
||||||
@ -71,4 +71,13 @@ public partial class ConfigurationProviderSelection : ComponentBase, IMessageBus
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Implementation of IDisposable
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
this.MessageBus.Unregister(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
@ -8,7 +8,7 @@ namespace AIStudio.Components;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A base class for configuration options.
|
/// A base class for configuration options.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ConfigurationBase : ComponentBase, IMessageBusReceiver
|
public partial class ConfigurationBase : ComponentBase, IMessageBusReceiver, IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The description of the option, i.e., the name. Should be
|
/// The description of the option, i.e., the name. Should be
|
||||||
@ -76,4 +76,13 @@ public partial class ConfigurationBase : ComponentBase, IMessageBusReceiver
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Implementation of IDisposable
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
this.MessageBus.Unregister(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
@ -10,7 +10,7 @@ using DialogOptions = AIStudio.Components.CommonDialogs.DialogOptions;
|
|||||||
|
|
||||||
namespace AIStudio.Components.Layout;
|
namespace AIStudio.Components.Layout;
|
||||||
|
|
||||||
public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver
|
public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, IDisposable
|
||||||
{
|
{
|
||||||
[Inject]
|
[Inject]
|
||||||
private IJSRuntime JsRuntime { get; init; } = null!;
|
private IJSRuntime JsRuntime { get; init; } = null!;
|
||||||
@ -212,4 +212,13 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver
|
|||||||
await MessageBus.INSTANCE.SendMessage<bool>(this, Event.RESET_CHAT_STATE);
|
await MessageBus.INSTANCE.SendMessage<bool>(this, Event.RESET_CHAT_STATE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Implementation of IDisposable
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
this.MessageBus.Unregister(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
@ -11,7 +11,7 @@ using DialogOptions = AIStudio.Components.CommonDialogs.DialogOptions;
|
|||||||
|
|
||||||
namespace AIStudio.Components.Pages;
|
namespace AIStudio.Components.Pages;
|
||||||
|
|
||||||
public partial class Settings : ComponentBase, IMessageBusReceiver
|
public partial class Settings : ComponentBase, IMessageBusReceiver, IDisposable
|
||||||
{
|
{
|
||||||
[Inject]
|
[Inject]
|
||||||
public SettingsManager SettingsManager { get; init; } = null!;
|
public SettingsManager SettingsManager { get; init; } = null!;
|
||||||
@ -179,4 +179,13 @@ public partial class Settings : ComponentBase, IMessageBusReceiver
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Implementation of IDisposable
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
this.MessageBus.Unregister(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user