mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-13 23:53:48 +00:00
Allow checking if a chat exists
This commit is contained in:
1 file changed
+9
@@ -286,6 +286,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)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user