mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-06 02:47:21 +00:00
Fixed starting new chats from the workspace list and the chat toolbar (#1075)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
c2c07a4dd4
commit
0e18cbbc58
8 files changed
+112
-65
No files matched your search
@@ -37,6 +37,7 @@ public partial class Chat : MSGComponentBase
|
||||
private bool workspaceSearchVisible;
|
||||
private string currentWorkspaceName = string.Empty;
|
||||
private Workspaces? workspaces;
|
||||
private ChatComponent? chatComponent;
|
||||
private double splitterPosition = 30;
|
||||
private bool skipRenderAfterSplitterChange;
|
||||
private readonly ChatComposerState composerState = new();
|
||||
@@ -167,6 +168,23 @@ public partial class Chat : MSGComponentBase
|
||||
await this.workspaces.ToggleSearchAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts a new chat in a workspace, when the workspace tree asks for one.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The page reads its reference to the chat component only now, when the user clicked. The chat
|
||||
/// component is created anew whenever the workspace sidebar is shown or hidden, so a reference
|
||||
/// taken earlier could point to one which is gone.
|
||||
/// </remarks>
|
||||
/// <param name="workspaceId">The ID of the workspace.</param>
|
||||
private async Task StartNewChatInWorkspace(Guid workspaceId)
|
||||
{
|
||||
if (this.chatComponent is null)
|
||||
return;
|
||||
|
||||
await this.chatComponent.StartNewChatInWorkspaceAsync(workspaceId);
|
||||
}
|
||||
|
||||
#region Overrides of MSGComponentBase
|
||||
|
||||
protected override void DisposeResources()
|
||||
|
||||
Reference in new issue
Block a user