Skip to content

Commit

Permalink
fix: 修复暂停消息后会弹错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghonglu.neo committed Mar 24, 2023
1 parent b90aa8b commit a8e614b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ export async function fetchChatAPIProcess(
if (signal) {
signal.onabort = () => {
handlers.delete(id)
if (errorHandle)
if (errorHandle) {
errorHandle(new Error('canceled'))
errorHandle = undefined
}
}
}
await invoke('fetch_chat_api', {
Expand All @@ -57,8 +59,10 @@ export async function fetchChatAPIProcess(
option,
}).catch((error) => {
handlers.delete(id)
if (errorHandle)
if (errorHandle) {
errorHandle(new Error(error))
errorHandle = undefined
}
})
handlers.delete(id)
}
Expand Down

0 comments on commit a8e614b

Please sign in to comment.