From 04ff358dc700984b300dd0ac9efd2b747ad5ae4a Mon Sep 17 00:00:00 2001
From: BiggerRain <15911122312@163.COM>
Date: Wed, 12 Mar 2025 14:24:24 +0800
Subject: [PATCH] fix: chat end type (#280)
* fix: chat end type
* docs: update release notes
---
docs/content.en/docs/release-notes/_index.md | 1 +
src-tauri/src/server/websocket.rs | 2 +-
src/components/Assistant/Chat.tsx | 4 +++-
src/components/ChatMessage/QueryIntent.tsx | 6 +++---
src/components/ChatMessage/markdown.css | 1 -
src/hooks/useMessageHandler.ts | 15 +++++++--------
6 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/docs/content.en/docs/release-notes/_index.md b/docs/content.en/docs/release-notes/_index.md
index b2ef81b5..24d52e1d 100644
--- a/docs/content.en/docs/release-notes/_index.md
+++ b/docs/content.en/docs/release-notes/_index.md
@@ -16,6 +16,7 @@ Information about release notes of Coco Server is provided here.
### Bug fix
- Fix the issue that the fusion search include disabled servers
- Fix incorrect version type: should be string instead of u32
+- Fix the chat end judgment type #280
### Improvements
diff --git a/src-tauri/src/server/websocket.rs b/src-tauri/src/server/websocket.rs
index 75aa81d5..a736c4a7 100644
--- a/src-tauri/src/server/websocket.rs
+++ b/src-tauri/src/server/websocket.rs
@@ -128,7 +128,7 @@ pub async fn connect_to_server(
msg = ws.next() => {
match msg {
Some(Ok(Message::Text(text))) => {
- //println!("Received message: {}", text);
+ println!("Received message: {}", text);
let _ = app_handle_clone.emit("ws-message", text);
},
Some(Err(WsError::ConnectionClosed)) => {
diff --git a/src/components/Assistant/Chat.tsx b/src/components/Assistant/Chat.tsx
index 6d7f4b82..1cf67316 100644
--- a/src/components/Assistant/Chat.tsx
+++ b/src/components/Assistant/Chat.tsx
@@ -207,6 +207,8 @@ const ChatAI = memo(
const onSelectChat = useCallback(
async (chat: Chat) => {
+ setTimedoutShow(false);
+ setErrorShow(false);
clearAllChunkData();
await cancelChat(activeChat);
await chatClose(activeChat);
@@ -320,7 +322,7 @@ const ChatAI = memo(
timedoutShow={timedoutShow}
errorShow={errorShow}
Question={Question}
- handleSendMessage={handleSendMessage}
+ handleSendMessage={(value) => handleSendMessage(value, activeChat)}
/>
) : (