mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 15:06:15 -04:00
Fix share mode by converting FileList to Array
This commit is contained in:
parent
ec520248b8
commit
351e7d42c9
3 changed files with 17 additions and 11 deletions
|
@ -179,10 +179,13 @@ class PeersUI {
|
|||
|
||||
this._onDragEnd();
|
||||
|
||||
if ($$('x-peer') || !$$('x-peer').contains(e.target)) return; // dropped on peer
|
||||
if ($$('x-peer') && $$('x-peer').contains(e.target)) return; // dropped on peer
|
||||
|
||||
const files = e.dataTransfer.files;
|
||||
const text = e.dataTransfer.getData("text");
|
||||
let files = e.dataTransfer.files;
|
||||
let text = e.dataTransfer.getData("text");
|
||||
|
||||
// convert FileList to Array
|
||||
files = [...files];
|
||||
|
||||
if (files.length > 0) {
|
||||
Events.fire('activate-share-mode', {
|
||||
|
@ -215,8 +218,11 @@ class PeersUI {
|
|||
if (this.shareMode.active || Dialog.anyDialogShown()) return;
|
||||
|
||||
e.preventDefault()
|
||||
const files = e.clipboardData.files;
|
||||
const text = e.clipboardData.getData("Text");
|
||||
let files = e.clipboardData.files;
|
||||
let text = e.clipboardData.getData("Text");
|
||||
|
||||
// convert FileList to Array
|
||||
files = [...files];
|
||||
|
||||
if (files.length > 0) {
|
||||
Events.fire('activate-share-mode', {files: files});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue