MCPcopy
hub / github.com/SnapDrop/snapdrop / _onPeers

Method _onPeers

client/scripts/network.js:381–393  ·  view source on GitHub ↗
(peers)

Source from the content-addressed store, hash-verified

379 }
380
381 _onPeers(peers) {
382 peers.forEach(peer => {
383 if (this.peers[peer.id]) {
384 this.peers[peer.id].refresh();
385 return;
386 }
387 if (window.isRtcSupported && peer.rtcSupported) {
388 this.peers[peer.id] = new RTCPeer(this._server, peer.id);
389 } else {
390 this.peers[peer.id] = new WSPeer(this._server, peer.id);
391 }
392 })
393 }
394
395 sendTo(peerId, message) {
396 this.peers[peerId].send(message);

Callers 1

constructorMethod · 0.95

Calls 1

refreshMethod · 0.80

Tested by

no test coverage detected