diff --git a/app/MindWork AI Studio/Components/Blocks/ConfigurationProviderSelection.razor.cs b/app/MindWork AI Studio/Components/Blocks/ConfigurationProviderSelection.razor.cs index 66a2efdd..c860377c 100644 --- a/app/MindWork AI Studio/Components/Blocks/ConfigurationProviderSelection.razor.cs +++ b/app/MindWork AI Studio/Components/Blocks/ConfigurationProviderSelection.razor.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Components; namespace AIStudio.Components.Blocks; -public partial class ConfigurationProviderSelection : ComponentBase, IMessageBusReceiver +public partial class ConfigurationProviderSelection : ComponentBase, IMessageBusReceiver, IDisposable { [Parameter] public Func SelectedValue { get; set; } = () => string.Empty; @@ -71,4 +71,13 @@ public partial class ConfigurationProviderSelection : ComponentBase, IMessageBus } #endregion + + #region Implementation of IDisposable + + public void Dispose() + { + this.MessageBus.Unregister(this); + } + + #endregion } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/ConfigurationBase.razor.cs b/app/MindWork AI Studio/Components/ConfigurationBase.razor.cs index bb1a7033..bad94f67 100644 --- a/app/MindWork AI Studio/Components/ConfigurationBase.razor.cs +++ b/app/MindWork AI Studio/Components/ConfigurationBase.razor.cs @@ -8,7 +8,7 @@ namespace AIStudio.Components; /// /// A base class for configuration options. /// -public partial class ConfigurationBase : ComponentBase, IMessageBusReceiver +public partial class ConfigurationBase : ComponentBase, IMessageBusReceiver, IDisposable { /// /// The description of the option, i.e., the name. Should be @@ -76,4 +76,13 @@ public partial class ConfigurationBase : ComponentBase, IMessageBusReceiver } #endregion + + #region Implementation of IDisposable + + public void Dispose() + { + this.MessageBus.Unregister(this); + } + + #endregion } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Layout/MainLayout.razor.cs b/app/MindWork AI Studio/Components/Layout/MainLayout.razor.cs index d25ec74c..8bd60a94 100644 --- a/app/MindWork AI Studio/Components/Layout/MainLayout.razor.cs +++ b/app/MindWork AI Studio/Components/Layout/MainLayout.razor.cs @@ -10,7 +10,7 @@ using DialogOptions = AIStudio.Components.CommonDialogs.DialogOptions; namespace AIStudio.Components.Layout; -public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver +public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, IDisposable { [Inject] private IJSRuntime JsRuntime { get; init; } = null!; @@ -212,4 +212,13 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver await MessageBus.INSTANCE.SendMessage(this, Event.RESET_CHAT_STATE); } } + + #region Implementation of IDisposable + + public void Dispose() + { + this.MessageBus.Unregister(this); + } + + #endregion } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Pages/Settings.razor.cs b/app/MindWork AI Studio/Components/Pages/Settings.razor.cs index db8f12fc..1d72669b 100644 --- a/app/MindWork AI Studio/Components/Pages/Settings.razor.cs +++ b/app/MindWork AI Studio/Components/Pages/Settings.razor.cs @@ -11,7 +11,7 @@ using DialogOptions = AIStudio.Components.CommonDialogs.DialogOptions; namespace AIStudio.Components.Pages; -public partial class Settings : ComponentBase, IMessageBusReceiver +public partial class Settings : ComponentBase, IMessageBusReceiver, IDisposable { [Inject] public SettingsManager SettingsManager { get; init; } = null!; @@ -179,4 +179,13 @@ public partial class Settings : ComponentBase, IMessageBusReceiver } #endregion + + #region Implementation of IDisposable + + public void Dispose() + { + this.MessageBus.Unregister(this); + } + + #endregion } \ No newline at end of file