Poorly handle websocket errors
This commit is contained in:
parent
c36c8b3c97
commit
1c7d8a0ab8
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user