mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-11 08:53:48 +00:00
Implemented removal of chat messages (#246)
This commit is contained in:
1 parent
6f5aecd92b
commit
5e445f09fa
6 files changed
+57
-2
No files matched your search
@@ -11,7 +11,7 @@
|
||||
{
|
||||
@if (!block.HideFromUser)
|
||||
{
|
||||
<ContentBlockComponent Role="@block.Role" Type="@block.ContentType" Time="@block.Time" Content="@block.Content"/>
|
||||
<ContentBlockComponent Role="@block.Role" Type="@block.ContentType" Time="@block.Time" Content="@block.Content" RemoveBlockFunc="@this.RemoveBlock"/>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,6 +571,17 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
|
||||
await MessageBus.INSTANCE.SendMessage<bool>(this, Event.WORKSPACE_TOGGLE_OVERLAY);
|
||||
}
|
||||
|
||||
private async Task RemoveBlock(IContent block)
|
||||
{
|
||||
if(this.ChatThread is null)
|
||||
return;
|
||||
|
||||
this.ChatThread.Remove(block);
|
||||
this.hasUnsavedChanges = true;
|
||||
await this.SaveThread();
|
||||
this.StateHasChanged();
|
||||
}
|
||||
|
||||
#region Overrides of MSGComponentBase
|
||||
|
||||
public override async Task ProcessIncomingMessage<T>(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default
|
||||
|
||||
Reference in new issue
Block a user