File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ export const loadWindowIpfs = async permissions => {
28
28
ipfs = await window . ipfs . enable ( {
29
29
commands : permissions
30
30
} ) ;
31
- } else {
32
31
}
33
32
const isWorking = await ipfsIsWorking ( ipfs ) ;
34
33
if ( isWorking ) {
@@ -58,21 +57,21 @@ export const loadJsIpfs = async () => {
58
57
} ) ;
59
58
} ;
60
59
61
- const getIpfs = ( permissions = DEFAULT_PERMISSIONS ) => {
62
- // if already instantiated
63
- if ( ipfsInstance ) {
64
- return ipfsInstance ;
65
- }
60
+ const getIpfs = async ( permissions = DEFAULT_PERMISSIONS ) => {
61
+ // if already instantiated
62
+ if ( ipfsInstance ) {
63
+ return ipfsInstance ;
64
+ }
66
65
67
- ipfsInstance = await loadWindowIpfs ( permissions )
68
- if ( ipfsInstance ) {
69
- console . log ( "window.ipfs is available!" )
70
- return ipfsInstance
71
- }
66
+ ipfsInstance = await loadWindowIpfs ( permissions ) ;
67
+ if ( ipfsInstance ) {
68
+ console . log ( "window.ipfs is available!" ) ;
69
+ return ipfsInstance ;
70
+ }
72
71
73
- console . log ( "window.ipfs is not available, downloading from CDN..." ) ;
74
- ipfsInstance = await loadJsIpfs ( ) ;
75
- return ipfsInstance
72
+ console . log ( "window.ipfs is not available, downloading from CDN..." ) ;
73
+ ipfsInstance = await loadJsIpfs ( ) ;
74
+ return ipfsInstance ;
76
75
} ;
77
76
78
77
export default getIpfs ;
You can’t perform that action at this time.
0 commit comments