better handling of file uploading
This commit is contained in:
parent
192d2af943
commit
5c463a8144
|
@ -26,6 +26,7 @@ async function tryIpfsGets(CID, setState, index=0){
|
|||
const ipfsFn = callOrderFns[index]
|
||||
ipfsFn(CID)
|
||||
.then((files) => {
|
||||
console.log('IPFS get sucessful on attempt: ', index+1)
|
||||
setState(files)
|
||||
})
|
||||
.catch(async (err) => {
|
||||
|
|
|
@ -90,7 +90,7 @@ export const uploadToIpfs = async files => {
|
|||
}
|
||||
|
||||
export const uploadToIpfsGateway = async files => {
|
||||
const res = await ipfsHttp.add(files)
|
||||
const res = await ipfsHttpTheGraph.add(files)
|
||||
return `ipfs/${res.slice(-1)[0].hash}`
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue