mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-13 09:53:48 +00:00
Allow checking if a chat exists
This commit is contained in:
1 file changed
+9
@@ -287,6 +287,15 @@ public partial class Workspaces : ComponentBase
|
|||||||
await this.LoadChat(chatPath, switchToChat: true);
|
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<ChatThread?> LoadChat(string? chatPath, bool switchToChat)
|
private async Task<ChatThread?> LoadChat(string? chatPath, bool switchToChat)
|
||||||
{
|
{
|
||||||
if(string.IsNullOrWhiteSpace(chatPath))
|
if(string.IsNullOrWhiteSpace(chatPath))
|
||||||
|
|||||||
Reference in new issue
Block a user