Skip to content

Commit

Permalink
Merge pull request #17 from tcriess/change-remove-json-double-encoding
Browse files Browse the repository at this point in the history
Remove json double encoding in ws communication
  • Loading branch information
GRVYDEV authored Feb 21, 2021
2 parents e937aa9 + dad04cd commit 08c2894
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const App = () => {
socket.send(
JSON.stringify({
event: "candidate",
data: JSON.stringify(e.candidate),
data: e.candidate,
})
);
}
Expand All @@ -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");
Expand All @@ -89,7 +89,7 @@ const App = () => {
socket.send(
JSON.stringify({
event: "answer",
data: JSON.stringify(answer),
data: answer,
})
);
} catch (e) {
Expand All @@ -104,7 +104,7 @@ const App = () => {
case "info":
dispatch({
type: "info",
viewers: JSON.parse(msg.data).no_connections,
viewers: msg.data.no_connections,
});
}
};
Expand Down

0 comments on commit 08c2894

Please sign in to comment.