diff --git a/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte b/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte index 24b771a5..41bd2a8b 100644 --- a/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte +++ b/src/routes/chat/[agentId]/[conversationId]/chat-box.svelte @@ -222,13 +222,15 @@ if (conv && !!e.data.text) { isLoading = true; sendChatMessage(e.data.text, e.data.data || null, conv.id).then(() => { - redirectToNewConversation(conv); isLoading = false; openFrame(); + redirectToNewConversation(conv); }).catch(() => { isLoading = false; openFrame(); }); + } else { + openFrame(); } }).catch(() => { isCreatingNewConv = false; diff --git a/src/routes/page/plugin/plugin-list.svelte b/src/routes/page/plugin/plugin-list.svelte index 9b80f05d..ff64a1d7 100644 --- a/src/routes/page/plugin/plugin-list.svelte +++ b/src/routes/page/plugin/plugin-list.svelte @@ -60,7 +60,7 @@ states: [] }; // ChatAction.Chat: send to current chat - // ChatAction.NewChat: init a new conversation, and then send the message + // ChatAction.NewChat: init a new conversation, and then send the message; if the message text is null, then only create a new conversation. sendToChatBot(ChatAction.Chat, CHAT_FRAME_ID, text, data); }