(obj)
| 850 | |
| 851 | // Broadcasts to all open browser windows |
| 852 | sendUpdateNotification(obj) { |
| 853 | if(!this.updateServer?.clients) { |
| 854 | return; |
| 855 | } |
| 856 | |
| 857 | for(let client of this.updateServer.clients) { |
| 858 | if (client.readyState === WebSocket.OPEN) { |
| 859 | client.send(JSON.stringify(obj)); |
| 860 | } |
| 861 | } |
| 862 | } |
| 863 | |
| 864 | // Helper for promisifying close methods with callbacks, like http.Server or ws.WebSocketServer. |
| 865 | async _closeServer(server) { |
no outgoing calls
no test coverage detected