Prettified Code!

This commit is contained in:
ethanweber authored and GitHub Action committed 2022-08-14 07:15:51 +00:00
1 parent 55ebaaf1b5
commit 387057cd61
1 file changed
+6 -4
@@ -64,8 +64,11 @@ export default function WebRtcWindow() {
// for updating the status of the peer connection
pc.oniceconnectionstatechange = () => {
// https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/connectionState
console.log(`[webrtc] connectionState: ${ pc.connectionState}`);
if (pc.connectionState === 'connecting' || pc.connectionState === 'connected') {
console.log(`[webrtc] connectionState: ${pc.connectionState}`);
if (
pc.connectionState === 'connecting' ||
pc.connectionState === 'connected'
) {
console.log('[webrtc] connected');
dispatch({
type: 'write',
@@ -101,8 +104,7 @@ export default function WebRtcWindow() {
} else {
const checkState = () => {
console.log(
`[webrtc] iceGatheringState: ${
pcRef.current.iceGatheringState}`,
`[webrtc] iceGatheringState: ${pcRef.current.iceGatheringState}`,
);
if (pcRef.current.iceGatheringState === 'complete') {
pcRef.current.removeEventListener(