fix: AbortController for Bing Mode

This commit is contained in:
josc146
2023-03-28 12:09:36 +08:00
parent 4f72968c12
commit ac47f6f7b6
4 changed files with 13 additions and 12 deletions
+1 -1
View File
@@ -27,8 +27,8 @@ export async function generateAnswersWithCustomApi(port, question, session, apiK
if (msg.stop) {
console.debug('stop generating')
port.postMessage({ done: true })
controller.abort()
port.onMessage.removeListener(stopListener)
controller.abort()
}
}
port.onMessage.addListener(stopListener)