mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 03:37:59 +00:00
Open a disappearing chat when a launcher names no workspace
This commit is contained in:
1 file changed
+9
-1
@@ -50,7 +50,14 @@ public sealed class DirectChatService(SettingsManager settingsManager, DataSourc
|
|||||||
if (dataSourceOptions is null)
|
if (dataSourceOptions is null)
|
||||||
return new(null, dataSourceOptionsResult.ErrorMessage);
|
return new(null, dataSourceOptionsResult.ErrorMessage);
|
||||||
|
|
||||||
Guid workspaceId;
|
//
|
||||||
|
// A launcher that names no workspace wants the same chat the chat page starts on its own:
|
||||||
|
// one that belongs nowhere, is kept among the temporary chats, and disappears with them. The
|
||||||
|
// empty workspace ID is what says so, here as everywhere else in the app.
|
||||||
|
//
|
||||||
|
var workspaceId = Guid.Empty;
|
||||||
|
if (!launchConfiguration.OpensTemporaryChat)
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
workspaceId = await WorkspaceBehaviour.ResolveOrCreateWorkspaceIdByNameAsync(launchConfiguration.WorkspaceName);
|
workspaceId = await WorkspaceBehaviour.ResolveOrCreateWorkspaceIdByNameAsync(launchConfiguration.WorkspaceName);
|
||||||
@@ -66,6 +73,7 @@ public sealed class DirectChatService(SettingsManager settingsManager, DataSourc
|
|||||||
logger.LogWarning("Assistant plugin '{PluginName}' could not resolve or create workspace '{WorkspaceName}'.", assistantPlugin.Name, launchConfiguration.WorkspaceName);
|
logger.LogWarning("Assistant plugin '{PluginName}' could not resolve or create workspace '{WorkspaceName}'.", assistantPlugin.Name, launchConfiguration.WorkspaceName);
|
||||||
return new(null, string.Format(TB("The workspace '{0}' could not be opened or created."), launchConfiguration.WorkspaceName));
|
return new(null, string.Format(TB("The workspace '{0}' could not be opened or created."), launchConfiguration.WorkspaceName));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Only the tools the user could have switched on themselves. A launcher may name one whose
|
// Only the tools the user could have switched on themselves. A launcher may name one whose
|
||||||
|
|||||||
Reference in new issue
Block a user