Poorly handle websocket errors

This commit is contained in:
Grégoire Delattre 2019-07-15 10:57:27 +02:00
parent c36c8b3c97
commit 1c7d8a0ab8

View File

@ -64,6 +64,11 @@ const WsHandler = (props) => {
const data = JSON.parse(event.data); const data = JSON.parse(event.data);
if (!data.type){ return } if (!data.type){ return }
if (data.status !== "ok") {
// TODO: handle this somehow
return
}
switch (data.type) { switch (data.type) {
case "torrents": case "torrents":
props.setFetchedTorrents(data.message); props.setFetchedTorrents(data.message);