mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-05-02 18:39:47 +00:00
Allow checking if a chat exists
This commit is contained in:
parent
c22a8db15d
commit
2cbf9d5dc3
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user