mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 01:52: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.isInlineEditOnGoing = true;
|
||||||
|
this.messageEntryBeforeEdit = element switch
|
||||||
{
|
{
|
||||||
Role = ((ContentBlock)element).Role,
|
ContentBlock block => block.DeepClone(),
|
||||||
Content = ((ContentBlock)element).Content,
|
_ => null,
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
{
|
this.StateHasChanged();
|
||||||
((ContentBlock)element).Role = this.messageEntryBeforeEdit.Role;
|
|
||||||
((ContentBlock)element).Content = this.messageEntryBeforeEdit.Content;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Overrides of ComponentBase
|
#region Overrides of ComponentBase
|
||||||
|
Loading…
Reference in New Issue
Block a user