Browse Source

Merge pull request #11307 from wangtunan/fix/stop_task_func_need_use_async_await_syntax

fix: stopTask func need use async/await syntax
Timothy Jaeryang Baek 1 month ago
parent
commit
12101fd26d
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

@@ -1693,9 +1693,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;
 			});