diff --git a/app/MindWork AI Studio/Components/Workspaces.razor.cs b/app/MindWork AI Studio/Components/Workspaces.razor.cs index 3b6531f8..fcb845e2 100644 --- a/app/MindWork AI Studio/Components/Workspaces.razor.cs +++ b/app/MindWork AI Studio/Components/Workspaces.razor.cs @@ -286,6 +286,15 @@ public partial class Workspaces : ComponentBase await this.LoadChat(chatPath, switchToChat: true); } + + public static bool IsChatExisting(LoadChat loadChat) + { + var chatPath = loadChat.WorkspaceId == Guid.Empty + ? Path.Join(SettingsManager.DataDirectory, "tempChats", loadChat.ChatId.ToString()) + : Path.Join(SettingsManager.DataDirectory, "workspaces", loadChat.WorkspaceId.ToString(), loadChat.ChatId.ToString()); + + return Directory.Exists(chatPath); + } private async Task LoadChat(string? chatPath, bool switchToChat) {