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 // for updating the status of the peer connection
pc.oniceconnectionstatechange = () => { pc.oniceconnectionstatechange = () => {
// https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/connectionState // https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/connectionState
console.log(`[webrtc] connectionState: ${ pc.connectionState}`); console.log(`[webrtc] connectionState: ${pc.connectionState}`);
if (pc.connectionState === 'connecting' || pc.connectionState === 'connected') { if (
pc.connectionState === 'connecting' ||
pc.connectionState === 'connected'
) {
console.log('[webrtc] connected'); console.log('[webrtc] connected');
dispatch({ dispatch({
type: 'write', type: 'write',
@@ -101,8 +104,7 @@ export default function WebRtcWindow() {
} else { } else {
const checkState = () => { const checkState = () => {
console.log( console.log(
`[webrtc] iceGatheringState: ${ `[webrtc] iceGatheringState: ${pcRef.current.iceGatheringState}`,
pcRef.current.iceGatheringState}`,
); );
if (pcRef.current.iceGatheringState === 'complete') { if (pcRef.current.iceGatheringState === 'complete') {
pcRef.current.removeEventListener( pcRef.current.removeEventListener(