Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: linting on transfer-files example
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Mar 21, 2017
1 parent 92d3fbe commit f876171
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/transfer-files/public/js/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict'
/* global self */

const $startButton = document.querySelector('#start')
Expand Down Expand Up @@ -126,16 +127,16 @@ function onDrop (event) {
event.preventDefault()
const dt = event.dataTransfer
const files = dt.files
const readFileContents = (file) => {

function readFileContents (file) {
return new Promise((resolve) => {
const reader = new window.FileReader()
reader.onload = (event) => resolve(event.target.result)
reader.readAsArrayBuffer(file)
})
}

for (var i = 0; i < files.length; i++) {
const file = files[i]
files.map((file) => {
readFileContents(file)
.then((buffer) => {
return node.files.add([{
Expand All @@ -150,7 +151,7 @@ function onDrop (event) {
.join('<br>')
})
.catch(onError)
}
})
}

/*
Expand Down

0 comments on commit f876171

Please sign in to comment.