snapdrop

A Progressive Web App for local file sharing
git clone http://git.hanabi.in/repos/snapdrop.git
Log | Files | Refs | README | LICENSE

commit 0b743fa0917284edc4a503009f5d04974e51054f
parent a251483e97e3d9580bc1d2b0dd71de0cc28ebce3
Author: JBYoshi <12983479+JBYoshi@users.noreply.github.com>
Date:   Mon, 11 Feb 2019 18:54:44 -0600

Fix bug where clients try to re-answer established connections.

Diffstat:
Mclient/scripts/network.js | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/client/scripts/network.js b/client/scripts/network.js @@ -273,8 +273,14 @@ class RTCPeer extends Peer { if (message.sdp) { this._conn.setRemoteDescription(new RTCSessionDescription(message.sdp)) - .then( _ => this._conn.createAnswer()) - .then(d => this._onDescription(d)) + .then( _ => { + if (message.sdp.type == 'offer') { + return this._conn.createAnswer() + .then(d => this._onDescription(d)); + } else { + return null; + } + }) .catch(e => this._onError(e)); } else if (message.ice) { this._conn.addIceCandidate(new RTCIceCandidate(message.ice));