Skip to content

Commit

Permalink
Update webrtc-peer.js
Browse files Browse the repository at this point in the history
  • Loading branch information
cacheflowe committed Jan 31, 2024
1 parent 1f91177 commit 37d492a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/webrtc-peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class WebRtcKiosk extends WebRtcPeer {
connectionIsGood(conn) {
return (
conn.open &&
conn.peerConnection.connectionState == "connected" &&
conn.peerConnection?.connectionState == "connected" &&
Date.now() - conn.connectTime < this.maxClientConnectionTime
);
}
Expand All @@ -394,6 +394,7 @@ class WebRtcKiosk extends WebRtcPeer {
}

manageConnections() {
// console.log(this.connections);
// remove any connections that have been closed
let removedAny = false;
this.connections.forEach((conn, i) => {
Expand All @@ -404,7 +405,7 @@ class WebRtcKiosk extends WebRtcPeer {
removedAny = true;
}
});
console.log(removedAny);
// console.log(removedAny);
// filter old connections from array
this.connections = this.connections.filter((conn) => {
return this.connectionIsGood(conn);
Expand Down

0 comments on commit 37d492a

Please sign in to comment.