mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-13 03:21:37 +00:00
Fixed base component
This commit is contained in:
parent
2df9d363c8
commit
21d2de2614
@ -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))
|
||||
{
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user