mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 11:17:59 +00:00
Fix validation for empty prompts with attachments
This commit is contained in:
1 parent
bb8f6f13f0
commit
c902f33569
3 files changed
+18
-3
No files matched your search
@@ -763,18 +763,27 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
||||
await this.SyncForegroundChatAsync();
|
||||
return this.ChatThread;
|
||||
}
|
||||
|
||||
|
||||
private async Task SendMessage(bool reuseLastUserPrompt = false)
|
||||
{
|
||||
|
||||
|
||||
if (this.MediaTranscriptionService.IsBusy(this.CurrentMediaImportOwner))
|
||||
return;
|
||||
|
||||
if (!this.IsProviderSelected)
|
||||
return;
|
||||
|
||||
if (!reuseLastUserPrompt && string.IsNullOrWhiteSpace(this.ComposerState.UserInput)
|
||||
&& this.ComposerState.FileAttachments.Count > 0)
|
||||
{
|
||||
await this.MessageBus.SendWarning(new(
|
||||
Icons.Material.Filled.VoiceChat,
|
||||
this.T("The attachment has not been sent. Please enter a prompt in the chat window")));
|
||||
return;
|
||||
}
|
||||
if(!this.ChatThread.IsLLMProviderAllowed(this.Provider))
|
||||
return;
|
||||
|
||||
|
||||
this.RefreshCurrentProfileAndChatTemplate();
|
||||
|
||||
// Blur the focus away from the input field to be able to clear it:
|
||||
|
||||
Reference in new issue
Block a user