mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-03 18:17:56 -05:00
fix: a folder whose terminal working directory is missing loses the first message and leaves an empty chat (#34552)
Sending the first message from a folder whose default terminal points at a working directory that does not exist showed "Working directory is unavailable", but it still created an empty New Chat in the folder and switched to it, with the typed message gone from the message box. Now the warning still shows, but no chat is created: the folder page stays open and the message stays in the message box, ready to send once the directory is fixed. Fixes #34367
This commit is contained in:
1 parent
485c6d50da
commit
93a7bbb185
1 file changed
+7
@@ -5484,6 +5484,13 @@
|
||||
);
|
||||
|
||||
if (!createdChat?.id) throw new Error($i18n.t('Failed to create chat'));
|
||||
if (!_history.currentId) {
|
||||
// A refused first message leaves no empty chat behind.
|
||||
await initializeTerminalDirectory(createdChat.id, context).catch(async (error) => {
|
||||
if (await deleteChatById(localStorage.token, createdChat.id).catch(() => null))
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
if (history !== _history || $chatId !== _chatId) return '';
|
||||
chat = createdChat;
|
||||
if (selectedFolderId) updateFolderChatLists(createdChat, selectedFolderId);
|
||||
|
||||
Reference in new issue
Block a user