fix: reconnect immediately on tab visibility (iOS)
This commit is contained in:
parent
74fc22ddfb
commit
94b4dc7a41
|
|
@ -717,6 +717,15 @@ export function buildHTML(nonce: string): string {
|
|||
});
|
||||
|
||||
connect();
|
||||
|
||||
document.addEventListener('visibilitychange', function () {
|
||||
if (document.visibilityState === 'visible') {
|
||||
if (!ws || ws.readyState !== 1) {
|
||||
clearTimeout(timer);
|
||||
connect();
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Reference in New Issue