commit 3be3be692638271b53b2a7a53c3fc65331f108be
parent 787f03b022d9823ca85593c11d524b5e944b8a95
Author: RobinLinus <RobinLinus@users.noreply.github.com>
Date: Mon, 9 Mar 2020 22:40:57 +0100
Update ui.js
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/client/scripts/ui.js b/client/scripts/ui.js
@@ -12,7 +12,7 @@ class PeersUI {
Events.on('peer-left', e => this._onPeerLeft(e.detail));
Events.on('peers', e => this._onPeers(e.detail));
Events.on('file-progress', e => this._onFileProgress(e.detail));
- window.addEventListener('paste', e => this._onPaste(e));
+ Events.on('paste', e => this._onPaste(e));
}
_onPeerJoined(peer) {
@@ -44,7 +44,7 @@ class PeersUI {
}
_onPaste(e) {
- const files = e.clipboardData.items
+ const files = e.clipboardData.files || e.clipboardData.items
.filter(i => i.type.indexOf('image') > -1)
.map(i => i.getAsFile());