better handling of file uploading

This commit is contained in:
Barry Gitarts 2019-08-21 20:23:19 -04:00 committed by Barry G
parent 192d2af943
commit 5c463a8144
2 changed files with 2 additions and 1 deletions

View File

@ -26,6 +26,7 @@ async function tryIpfsGets(CID, setState, index=0){
const ipfsFn = callOrderFns[index] const ipfsFn = callOrderFns[index]
ipfsFn(CID) ipfsFn(CID)
.then((files) => { .then((files) => {
console.log('IPFS get sucessful on attempt: ', index+1)
setState(files) setState(files)
}) })
.catch(async (err) => { .catch(async (err) => {

View File

@ -90,7 +90,7 @@ export const uploadToIpfs = async files => {
} }
export const uploadToIpfsGateway = 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}` return `ipfs/${res.slice(-1)[0].hash}`
} }