Browse Source

fix: stopTask func need use async/await syntax

wangtunan 4 months ago
parent
commit
533c99e384
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/lib/components/chat/Chat.svelte

+ 3 - 2
src/lib/components/chat/Chat.svelte

@@ -1683,9 +1683,10 @@
 		history.messages[responseMessage.id] = responseMessage;
 	};
 
-	const stopResponse = () => {
+	const stopResponse = async () => {
 		if (taskId) {
-			const res = stopTask(localStorage.token, taskId).catch((error) => {
+			const res = await stopTask(localStorage.token, taskId).catch((error) => {
+				toast.error(error);
 				return null;
 			});