This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ var ipfs = IPFS()
6
6
7
7
function store ( ) {
8
8
var toStore = document . getElementById ( 'source' ) . value
9
- ipfs . files . add ( Buffer . from ( toStore ) , function ( err , res ) {
9
+ ipfs . add ( Buffer . from ( toStore ) , function ( err , res ) {
10
10
if ( err || ! res ) {
11
11
return console . error ( 'ipfs add error' , err , res )
12
12
}
@@ -21,7 +21,7 @@ function store () {
21
21
}
22
22
23
23
function display ( hash ) {
24
- ipfs . files . cat ( hash , function ( err , res ) {
24
+ ipfs . cat ( hash , function ( err , res ) {
25
25
if ( err || ! res ) {
26
26
return console . error ( 'ipfs cat error' , err , res )
27
27
}
Original file line number Diff line number Diff line change @@ -28,15 +28,15 @@ class App extends React.Component {
28
28
ipfs . add ( [ Buffer . from ( stringToUse ) ] , ( err , res ) => {
29
29
if ( err ) throw err
30
30
const hash = res [ 0 ] . hash
31
- this . setState ( { added_file_hash : hash } )
31
+ this . setState ( { added_file_hash : hash } )
32
32
ipfs . cat ( hash , ( err , data ) => {
33
33
if ( err ) throw err
34
- this . setState ( { added_file_contents : data . toString ( ) } )
34
+ this . setState ( { added_file_contents : data . toString ( ) } )
35
35
} )
36
36
} )
37
37
}
38
38
render ( ) {
39
- return < div style = { { textAlign : 'center' } } >
39
+ return < div style = { { textAlign : 'center' } } >
40
40
< h1 > Everything is working!</ h1 >
41
41
< p > Your ID is < strong > { this . state . id } </ strong > </ p >
42
42
< p > Your IPFS version is < strong > { this . state . version } </ strong > </ p >
You can’t perform that action at this time.
0 commit comments