[glitch-port] handle empty message (ping) in ws
This commit is contained in:
parent
16f477c8e2
commit
04d6e60bd3
1 changed files with 4 additions and 1 deletions
|
@ -74,7 +74,10 @@ export default function getStream(streamingAPIBaseURL, accessToken, stream, { co
|
|||
const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`);
|
||||
|
||||
ws.onopen = connected;
|
||||
ws.onmessage = e => received(JSON.parse(e.data));
|
||||
ws.onmessage = e => {
|
||||
if (e.data !== '')
|
||||
received(JSON.parse(e.data));
|
||||
}
|
||||
ws.onclose = disconnected;
|
||||
ws.onreconnect = reconnected;
|
||||
|
||||
|
|
Loading…
Reference in a new issue