diff --git a/src/App.js b/src/App.js index a5819ba..92fa4e7 100644 --- a/src/App.js +++ b/src/App.js @@ -56,7 +56,7 @@ const App = () => { socket.send( JSON.stringify({ event: "candidate", - data: JSON.stringify(e.candidate), + data: e.candidate, }) ); } @@ -71,7 +71,7 @@ const App = () => { return; } - const offerCandidate = JSON.parse(msg.data); + const offerCandidate = msg.data; if (!offerCandidate) { console.log("Failed to parse offer msg data"); @@ -89,7 +89,7 @@ const App = () => { socket.send( JSON.stringify({ event: "answer", - data: JSON.stringify(answer), + data: answer, }) ); } catch (e) { @@ -104,7 +104,7 @@ const App = () => { case "info": dispatch({ type: "info", - viewers: JSON.parse(msg.data).no_connections, + viewers: msg.data.no_connections, }); } };