From 7f186af8b2a311c92a4b20a17c0afa7d4ae35862 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Tue, 21 Jan 2025 15:35:12 +0100 Subject: [PATCH] Improved readability --- .../Components/ChatComponent.razor.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor.cs b/app/MindWork AI Studio/Components/ChatComponent.razor.cs index e3ef8c88..d9e597b0 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor.cs +++ b/app/MindWork AI Studio/Components/ChatComponent.razor.cs @@ -525,10 +525,20 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable this.isStreaming = false; this.hasUnsavedChanges = false; this.userInput = string.Empty; - this.currentWorkspaceId = this.ChatThread?.WorkspaceId ?? Guid.Empty; - this.currentWorkspaceName = this.ChatThread is null ? string.Empty : await WorkspaceBehaviour.LoadWorkspaceName(this.ChatThread.WorkspaceId); - this.WorkspaceName(this.currentWorkspaceName); - + + if (this.ChatThread is not null) + { + this.currentWorkspaceId = this.ChatThread.WorkspaceId; + this.currentWorkspaceName = await WorkspaceBehaviour.LoadWorkspaceName(this.ChatThread.WorkspaceId); + this.WorkspaceName(this.currentWorkspaceName); + } + else + { + this.currentWorkspaceId = Guid.Empty; + this.currentWorkspaceName = string.Empty; + this.WorkspaceName(this.currentWorkspaceName); + } + await this.SelectProviderWhenLoadingChat(); if (this.SettingsManager.ConfigurationData.Chat.ShowLatestMessageAfterLoading) {