mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 20:12:57 +00:00
Fixed backup item method by using a deep clone
This commit is contained in:
parent
c4a56f969f
commit
b7c06588b7
@ -125,19 +125,16 @@ public partial class ChatTemplateDialog : MSGComponentBase
|
||||
}
|
||||
}
|
||||
|
||||
private void BackupItem(object element)
|
||||
private void BackupItem(object? element)
|
||||
{
|
||||
this.messageEntryBeforeEdit = new ContentBlock
|
||||
this.isInlineEditOnGoing = true;
|
||||
this.messageEntryBeforeEdit = element switch
|
||||
{
|
||||
Role = ((ContentBlock)element).Role,
|
||||
Content = ((ContentBlock)element).Content,
|
||||
ContentBlock block => block.DeepClone(),
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
((ContentBlock)element).Role = this.messageEntryBeforeEdit.Role;
|
||||
((ContentBlock)element).Content = this.messageEntryBeforeEdit.Content;
|
||||
this.StateHasChanged();
|
||||
}
|
||||
|
||||
#region Overrides of ComponentBase
|
||||
|
Loading…
Reference in New Issue
Block a user