Skip to content
Snippets Groups Projects
Verified Commit 3918d358 authored by Morgan Bazalgette's avatar Morgan Bazalgette Committed by Haelwenn
Browse files

handle empty message (ping) in ws

parent faba7113
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,10 @@ export default function getStream(streamingAPIBaseURL, accessToken, stream, { co
const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`, accessToken);
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;
......
......@@ -85,7 +85,10 @@ export default function getStream(streamingAPIBaseURL, accessToken, stream, { co
const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`, accessToken);
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment