Use EventSource_factory in open_stream() for Wasm (#6820)

* Use `EventSource_factory` in `open_stream()` for Wasm

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
This commit is contained in:
Yuichiro Tachibana (Tsuchiya) 2023-12-31 04:28:54 +09:00 committed by GitHub
parent a5f3d2bef2
commit 649cd4d680
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,6 @@
---
"@gradio/client": minor
"gradio": minor
---
feat:Use `EventSource_factory` in `open_stream()` for Wasm

View File

@ -1034,7 +1034,7 @@ export function api_factory(
session_hash: session_hash
}).toString();
let url = new URL(`${config.root}/queue/data?${params}`);
event_stream = new EventSource(url);
event_stream = EventSource_factory(url);
event_stream.onmessage = async function (event) {
let _data = JSON.parse(event.data);
const event_id = _data.event_id;