Skip to content

Commit

Permalink
fix: close eventSource early
Browse files Browse the repository at this point in the history
  • Loading branch information
regischen committed Apr 22, 2024
1 parent fc4b263 commit 6008746
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ export function textToText({
messageId: message.messageId,
});
if (signal) {
if (signal.aborted) return;
if (signal.aborted) {
eventSource.close();
return;
}
signal.onabort = () => {
eventSource.close();
};
Expand Down

0 comments on commit 6008746

Please sign in to comment.