mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-19 20:32:14 +00:00
Fix:missing attachment on rework
This commit is contained in:
parent
519abe4fc2
commit
d85d2aa3aa
@ -939,7 +939,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
|||||||
if(lastBlockContent is null)
|
if(lastBlockContent is null)
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|
||||||
this.userInput = textBlock.Text;
|
this.RestoreComposerFromTextBlock(textBlock);
|
||||||
this.ChatThread.Remove(block);
|
this.ChatThread.Remove(block);
|
||||||
this.ChatThread.Remove(lastBlockContent);
|
this.ChatThread.Remove(lastBlockContent);
|
||||||
this.hasUnsavedChanges = true;
|
this.hasUnsavedChanges = true;
|
||||||
@ -956,7 +956,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
|||||||
if (block is not ContentText textBlock)
|
if (block is not ContentText textBlock)
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|
||||||
this.userInput = textBlock.Text;
|
this.RestoreComposerFromTextBlock(textBlock);
|
||||||
this.ChatThread.Remove(block);
|
this.ChatThread.Remove(block);
|
||||||
this.hasUnsavedChanges = true;
|
this.hasUnsavedChanges = true;
|
||||||
this.StateHasChanged();
|
this.StateHasChanged();
|
||||||
@ -964,6 +964,15 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RestoreComposerFromTextBlock(ContentText textBlock)
|
||||||
|
{
|
||||||
|
this.userInput = textBlock.Text;
|
||||||
|
this.chatDocumentPaths.Clear();
|
||||||
|
|
||||||
|
foreach (var attachment in textBlock.FileAttachments)
|
||||||
|
this.chatDocumentPaths.Add(attachment.Normalize());
|
||||||
|
}
|
||||||
|
|
||||||
#region Overrides of MSGComponentBase
|
#region Overrides of MSGComponentBase
|
||||||
|
|
||||||
protected override async Task ProcessIncomingMessage<T>(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default
|
protected override async Task ProcessIncomingMessage<T>(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user