File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -8,16 +8,18 @@ if (window.kthoom === undefined) {
8
8
9
9
kthoom . ipfs = {
10
10
nodePromise_ : undefined ,
11
+ node_ : undefined ,
11
12
getNode : function ( ) {
12
13
if ( ! kthoom . ipfs . nodePromise_ ) {
13
- kthoom . setProgressMeter ( 1 , 'Loading code for IPFS...' ) ;
14
+ kthoom . setProgressMeter ( 0. 1, 'Loading code for IPFS...' ) ;
14
15
kthoom . ipfs . nodePromise_ = new Promise ( ( resolve , reject ) => {
15
16
// Load in the IPFS script API.
16
17
var ipfsScriptEl = document . createElement ( 'script' ) ;
17
18
ipfsScriptEl . addEventListener ( 'load' , ( ) => {
18
- kthoom . setProgressMeter ( 2 , 'Creating IPFS node...' ) ;
19
+ kthoom . setProgressMeter ( 0. 2, 'Creating IPFS node...' ) ;
19
20
var node = window . Ipfs . createNode ( ) ;
20
21
node . on ( 'start' , ( ) => {
22
+ kthoom . ipfs . node_ = node ;
21
23
resolve ( node ) ;
22
24
} ) ;
23
25
} ) ;
@@ -29,7 +31,7 @@ kthoom.ipfs = {
29
31
} ,
30
32
loadHash : function ( ipfshash ) {
31
33
kthoom . ipfs . getNode ( ) . then ( node => {
32
- kthoom . setProgressMeter ( 3 , 'Fetching data from IPFS...' ) ;
34
+ kthoom . setProgressMeter ( 0. 3, 'Fetching data from IPFS...' ) ;
33
35
node . files . cat ( ipfshash , ( err , data ) => {
34
36
if ( err ) throw err ;
35
37
You can’t perform that action at this time.
0 commit comments