From 21d2de2614927f13707b30158deda9335248e279 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Tue, 6 Jan 2026 20:29:15 +0100 Subject: [PATCH] Fixed base component --- .../Components/VoiceRecorder.razor | 2 +- .../Components/VoiceRecorder.razor.cs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/MindWork AI Studio/Components/VoiceRecorder.razor b/app/MindWork AI Studio/Components/VoiceRecorder.razor index e205e8fc..14a922a7 100644 --- a/app/MindWork AI Studio/Components/VoiceRecorder.razor +++ b/app/MindWork AI Studio/Components/VoiceRecorder.razor @@ -1,7 +1,7 @@ @using AIStudio.Settings.DataModel @namespace AIStudio.Components -@inherits ComponentBase +@inherits MSGComponentBase @if (PreviewFeatures.PRE_SPEECH_TO_TEXT_2026.IsEnabled(this.SettingsManager)) { diff --git a/app/MindWork AI Studio/Components/VoiceRecorder.razor.cs b/app/MindWork AI Studio/Components/VoiceRecorder.razor.cs index 380efc50..d51bed63 100644 --- a/app/MindWork AI Studio/Components/VoiceRecorder.razor.cs +++ b/app/MindWork AI Studio/Components/VoiceRecorder.razor.cs @@ -1,4 +1,3 @@ -using AIStudio.Settings; using AIStudio.Tools.MIME; using AIStudio.Tools.Services; @@ -6,7 +5,7 @@ using Microsoft.AspNetCore.Components; namespace AIStudio.Components; -public partial class VoiceRecorder : IDisposable +public partial class VoiceRecorder : MSGComponentBase { [Inject] private ILogger Logger { get; init; } = null!; @@ -16,9 +15,6 @@ public partial class VoiceRecorder : IDisposable [Inject] private RustService RustService { get; init; } = null!; - - [Inject] - private SettingsManager SettingsManager { get; set; } = null!; private bool isRecording; private FileStream? currentRecordingStream; @@ -176,7 +172,9 @@ public partial class VoiceRecorder : IDisposable public bool ChangedMimeType { get; init; } } - public void Dispose() + #region Overrides of MSGComponentBase + + protected override void DisposeResources() { // Clean up recording resources if still active: if (this.currentRecordingStream is not null) @@ -187,5 +185,8 @@ public partial class VoiceRecorder : IDisposable this.dotNetReference?.Dispose(); this.dotNetReference = null; + base.DisposeResources(); } + + #endregion }