Fix: Resending message when the visibility of the browser page changes , which causes slowdown or failure to receive messages

This commit is contained in:
Rafi
2023-04-11 10:30:12 +08:00
parent 8718dc4ed1
commit fa14276d0a

View File

@@ -78,6 +78,7 @@ const fetchReply = async (message) => {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
openWhenHidden: true,
onopen(response) {
if (response.ok && response.headers.get('content-type') === EventStreamContentType) {
return;