From 74d7d4e21c7198c7caff84d0a3a00408da2e8b04 Mon Sep 17 00:00:00 2001 From: Ashesh <3626859+Ashesh3@users.noreply.github.com> Date: Thu, 14 Sep 2023 17:14:30 +0530 Subject: [PATCH] Fix chat request cancel on focus change (#106) --- src/utils/api.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/api.ts b/src/utils/api.ts index 19fab5ce..507b2ea1 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -94,6 +94,7 @@ const request = async ( return new Promise(async (resolve, reject) => { const streamOptions: FetchEventSourceInit = { ...requestOptions, + openWhenHidden: true, onmessage: (e: EventSourceMessage) => { if (onMessage) onMessage(e); },