Skip to content

Commit df4c88a

Browse files
author
Alan Shaw
committed
fix: cleanup
License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent 00da1b0 commit df4c88a

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/App.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ export default function App () {
1616

1717
useEffect(() => {
1818
if (!files.length) return
19-
ipfsAdd({ files, chunker, strategy, maxChildren, layerRepeat })
20-
.then(cid => setRootCid(cid))
19+
ipfsAdd({ files, chunker, strategy, maxChildren, layerRepeat }).then(setRootCid)
2120
}, [files, chunker, strategy, maxChildren, layerRepeat])
2221

2322
const onFileChange = file => {
2423
const fileReader = new FileReader()
25-
fileReader.onload = async e => {
26-
const content = Buffer.from(e.target.result)
27-
setFiles(files.concat({ path: file.name, content }))
24+
fileReader.onload = e => {
25+
setFiles(files.concat({ path: file.name, content: Buffer.from(e.target.result) }))
2826
}
2927
fileReader.readAsArrayBuffer(file)
3028
}

src/Controls.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-env browser */
21
import React from 'react'
32

43
export default function Controls ({

0 commit comments

Comments
 (0)