Skip to content

Commit

Permalink
fix file transfer for non chrome browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSch committed Oct 23, 2022
1 parent b7b4eb3 commit 6a01a33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "snapdrop",
"private": true,
"version": "1.0.3",
"version": "1.0.4",
"description": "Local file sharing. Inspired by Apple's Airdrop",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion public/scripts/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ class RTCPeer extends Peer {
ordered: true,
reliable: true // Obsolete. See https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/reliable
});
channel.binaryType = 'arraybuffer';
channel.onopen = e => this._onChannelOpened(e);
this._conn.createOffer().then(d => this._onDescription(d)).catch(e => this._onError(e));
}
Expand Down Expand Up @@ -295,6 +294,7 @@ class RTCPeer extends Peer {
_onChannelOpened(event) {
console.log('RTC: channel opened with', this._peerId);
const channel = event.channel || event.target;
channel.binaryType = 'arraybuffer';
channel.onmessage = e => this._onMessage(e.data);
channel.onclose = e => this._onChannelClosed();
this._channel = channel;
Expand Down

1 comment on commit 6a01a33

@JustSch
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implements fix from SnapDrop/snapdrop#520

Please sign in to comment.