⚡️ terminate request when user cancels
This commit is contained in:
parent
ab27186bf8
commit
37f604f2db
1 changed files with 2 additions and 0 deletions
|
|
@ -536,6 +536,7 @@ export function getSidebarContent(
|
|||
while (!next.done) {
|
||||
if (abortedMessageIds.has(data.messageId)) {
|
||||
abortedMessageIds.delete(data.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
break;
|
||||
}
|
||||
respond({ content: next.value });
|
||||
|
|
@ -555,6 +556,7 @@ export function getSidebarContent(
|
|||
while (!next.done) {
|
||||
if (abortedMessageIds.has(data.messageId)) {
|
||||
abortedMessageIds.delete(data.messageId);
|
||||
next = await gen.return({ completion: "", prompt: "" });
|
||||
break;
|
||||
}
|
||||
respond({ content: next.value.content });
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue