From 6748cc0cb42bca05cdd5242852347ffcf80424d1 Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Wed, 18 Jan 2023 15:44:20 +0100 Subject: [PATCH] fix bugs --- docs/faq.md | 2 +- public/scripts/network.js | 1 - public/scripts/ui.js | 19 +++++-------------- public/scripts/util.js | 3 --- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index d19eebe..98b39a3 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -20,7 +20,7 @@ It uses a P2P connection if WebRTC is supported by the browser. WebRTC needs a S If your devices are paired and behind a NAT, the public TURN Server from [Open Relay](https://www.metered.ca/tools/openrelay/) is used to route your files and messages. ### What about privacy? Will files be saved on third-party-servers? -None of your files are ever sent to any server. Files are sent only between peers. PairDrop doesn't even use a database. If you are curious have a look [at the Server](https://github.com/schlagmichdoch/pairdrop/blob/master/server/). +None of your files are ever sent to any server. Files are sent only between peers. PairDrop doesn't even use a database. If you are curious have a look [at the Server](https://github.com/schlagmichdoch/pairdrop/blob/master/index.js). WebRTC encrypts the files on transit. If your devices are paired and behind a NAT, the public TURN Server from [Open Relay](https://www.metered.ca/tools/openrelay/) is used to route your files and messages. diff --git a/public/scripts/network.js b/public/scripts/network.js index f6ef172..b3c4348 100644 --- a/public/scripts/network.js +++ b/public/scripts/network.js @@ -669,7 +669,6 @@ class PeersManager { } _onPeers(msg) { - console.debug(msg) msg.peers.forEach(peer => { if (this.peers[peer.id]) { if (this.peers[peer.id].roomType === msg.roomType) { diff --git a/public/scripts/ui.js b/public/scripts/ui.js index 029c213..edfb2b0 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -43,7 +43,7 @@ class PeersUI { } _onPeerJoined(msg) { - this._joinPeer(msg.peer, msg.roomType, msg.roomType); + this._joinPeer(msg.peer, msg.roomType, msg.roomSecret); } _joinPeer(peer, roomType, roomSecret) { @@ -714,22 +714,13 @@ class PairDeviceDialog extends Dialog { } _onKeyDown(e) { - if (this.$el.attributes["show"]) { - if (e.code === "Escape") { - this.hide(); - this._pairDeviceCancel(); - } - if (e.code === "keyO") { - this._onRoomSecretDelete() - } + if (this.$el.attributes["show"] && e.code === "Escape") { + // Timeout to prevent paste mode from getting cancelled simultaneously + setTimeout(_ => this._pairDeviceCancel(), 50); } } _onCharsKeyDown(e) { - if (this.$el.attributes["show"] && e.code === "Escape") { - this.hide(); - this._pairDeviceCancel(); - } let previousSibling = e.target.previousElementSibling; let nextSibling = e.target.nextElementSibling; if (e.key === "Backspace" && previousSibling && !e.target.value) { @@ -922,7 +913,7 @@ class SendTextDialog extends Dialog { this.$text = this.$el.querySelector('#textInput'); const button = this.$el.querySelector('form'); button.addEventListener('submit', _ => this._send()); - Events.on("keydown", e => this._onKeyDown(e)) + Events.on("keydown", e => this._onKeyDown(e)); } async _onKeyDown(e) { diff --git a/public/scripts/util.js b/public/scripts/util.js index f772549..dad0a42 100644 --- a/public/scripts/util.js +++ b/public/scripts/util.js @@ -56,9 +56,6 @@ const zipper = (() => { throw new Error("Zip file closed"); } }, - specifyOnProgress(onprogressCallback) { - zipWriter.onprogress = onprogressCallback; - }, async getZipFile(filename = "archive.zip") { if (zipWriter) { const file = new File([await zipWriter.close()], filename, {type: "application/zip"});