mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-25 22:52:48 -05:00
Improve handling of disconnected Streamdelay server
This commit is contained in:
@@ -36,8 +36,13 @@ export default class StreamdelayClient extends EventEmitter {
|
||||
}
|
||||
|
||||
emitState() {
|
||||
const isConnected = this.ws.readyState === WebSocket.OPEN
|
||||
if (isConnected && !this.status) {
|
||||
// Wait until we've received the first status message
|
||||
return
|
||||
}
|
||||
this.emit('state', {
|
||||
isConnected: this.ws.readyState === WebSocket.OPEN,
|
||||
isConnected,
|
||||
...this.status,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ async function main() {
|
||||
streams: [],
|
||||
customStreams: [],
|
||||
views: [],
|
||||
streamdelay: false,
|
||||
streamdelay: { isConnected: false },
|
||||
}
|
||||
const getInitialState = () => clientState
|
||||
let broadcastState = () => {}
|
||||
|
||||
Reference in New Issue
Block a user