Fixed API key pasting & it's validation

This commit is contained in:
Thorsten Sommer 2026-01-11 15:44:31 +01:00
parent 48edfe32c0
commit 728fc8449b
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 18 additions and 6 deletions

View File

@ -241,10 +241,14 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
private void Cancel() => this.MudDialog.Cancel();
private void OnAPIKeyChanged(string apiKey)
private async Task OnAPIKeyChanged(string apiKey)
{
this.dataAPIKey = apiKey;
this.dataAPIKeyStorageIssue = string.Empty;
if (!string.IsNullOrWhiteSpace(this.dataAPIKeyStorageIssue))
{
this.dataAPIKeyStorageIssue = string.Empty;
await this.form.Validate();
}
}
private async Task ReloadModels()

View File

@ -255,10 +255,14 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
private void Cancel() => this.MudDialog.Cancel();
private void OnAPIKeyChanged(string apiKey)
private async Task OnAPIKeyChanged(string apiKey)
{
this.dataAPIKey = apiKey;
this.dataAPIKeyStorageIssue = string.Empty;
if (!string.IsNullOrWhiteSpace(this.dataAPIKeyStorageIssue))
{
this.dataAPIKeyStorageIssue = string.Empty;
await this.form.Validate();
}
}
private async Task ReloadModels()

View File

@ -249,10 +249,14 @@ public partial class TranscriptionProviderDialog : MSGComponentBase, ISecretId
private void Cancel() => this.MudDialog.Cancel();
private void OnAPIKeyChanged(string apiKey)
private async Task OnAPIKeyChanged(string apiKey)
{
this.dataAPIKey = apiKey;
this.dataAPIKeyStorageIssue = string.Empty;
if (!string.IsNullOrWhiteSpace(this.dataAPIKeyStorageIssue))
{
this.dataAPIKeyStorageIssue = string.Empty;
await this.form.Validate();
}
}
private async Task ReloadModels()