Update ui.js

This commit is contained in:
RobinLinus 2020-03-09 22:40:57 +01:00 committed by GitHub
parent 787f03b022
commit 3be3be6926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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());