handle empty message (ping) in ws
This commit is contained in:
parent
3445b80b9e
commit
6c39e8c9d3
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