From 09d67bc1c2069875b6ef34f725360da6fc8e7fa7 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Tue, 21 Jan 2025 19:12:36 +0100 Subject: [PATCH] Fixed the workspace name after re-rendering the chat component (#270) --- .../Components/ChatComponent.razor.cs | 12 ++++++++++-- app/MindWork AI Studio/wwwroot/changelog/v0.9.27.md | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor.cs b/app/MindWork AI Studio/Components/ChatComponent.razor.cs index d9e597b..e3c66aa 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor.cs +++ b/app/MindWork AI Studio/Components/ChatComponent.razor.cs @@ -123,6 +123,13 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable this.mustLoadChat = true; this.Logger.LogInformation($"The loading of the chat '{this.loadChat.ChatId}' was deferred and will be loaded now."); } + + if (this.ChatThread is not null) + { + this.currentWorkspaceId = this.ChatThread.WorkspaceId; + this.currentWorkspaceName = await WorkspaceBehaviour.LoadWorkspaceName(this.ChatThread.WorkspaceId); + this.WorkspaceName(this.currentWorkspaceName); + } await this.SelectProviderWhenLoadingChat(); await base.OnInitializedAsync(); @@ -538,14 +545,15 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable this.currentWorkspaceName = string.Empty; this.WorkspaceName(this.currentWorkspaceName); } - + await this.SelectProviderWhenLoadingChat(); if (this.SettingsManager.ConfigurationData.Chat.ShowLatestMessageAfterLoading) { this.mustScrollToBottomAfterRender = true; this.scrollRenderCountdown = 2; - this.StateHasChanged(); } + + this.StateHasChanged(); } private async Task ResetState() diff --git a/app/MindWork AI Studio/wwwroot/changelog/v0.9.27.md b/app/MindWork AI Studio/wwwroot/changelog/v0.9.27.md index 1f51fbf..49f2050 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v0.9.27.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v0.9.27.md @@ -3,5 +3,6 @@ - Improved message process debugging. This helps to identify issues related to the message handling. - Fixed the hostname validation message for ERI v1 data sources. - Fixed a memory leak in the chat component. -- Fixed an issue with the workspace title not being updated when a chat was moved to another workspace. +- Fixed an issue with the workspace title not being updated when a chat was moved to another workspace. +- Fixed an issue with the chat component not loading the current workspace name when the component was refreshed. - Removed the "send to" button from the ERI server assistant, since it is not supported. \ No newline at end of file