()
| 570 | }; |
| 571 | |
| 572 | const stopSocket = () => { |
| 573 | if (reconnectTimeout) { |
| 574 | clearTimeout(reconnectTimeout); |
| 575 | reconnectTimeout = undefined; |
| 576 | } |
| 577 | |
| 578 | if (stallCheckInterval) { |
| 579 | clearInterval(stallCheckInterval); |
| 580 | stallCheckInterval = undefined; |
| 581 | } |
| 582 | |
| 583 | closeSocket(); |
| 584 | }; |
| 585 | |
| 586 | const startSocket = () => { |
| 587 | if (ws || !isWindowVisible()) return; |
no test coverage detected