Fixed base component

This commit is contained in:
Thorsten Sommer 2026-01-06 20:29:15 +01:00
parent 2df9d363c8
commit 21d2de2614
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 8 additions and 7 deletions

View File

@ -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))
{

View File

@ -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<VoiceRecorder> 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
}