mirror of
https://github.com/status-im/liquid-funding.git
synced 2025-03-03 04:20:42 +00:00
cache upload locally
use correct hash from ipfs-http api
This commit is contained in:
parent
480f201c1c
commit
4d33c5e252
@ -161,6 +161,8 @@ const SubmissionSection = ({ classes, history }) => {
|
|||||||
addProject(...args)
|
addProject(...args)
|
||||||
.send({ from: account, gas: gas + 100 })
|
.send({ from: account, gas: gas + 100 })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
// cache locally
|
||||||
|
uploadFilesToIpfs(uploads, manifest)
|
||||||
console.log({res})
|
console.log({res})
|
||||||
openSnackBar('success', addProjectSucessMsg(res))
|
openSnackBar('success', addProjectSucessMsg(res))
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -86,8 +86,11 @@ export const uploadToIpfs = async files => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const uploadToIpfsGateway = async files => {
|
export const uploadToIpfsGateway = async files => {
|
||||||
const res = await ipfsHttp.add(files, { progress: (prog) => console.log(`received: ${prog}`) })
|
const options = {
|
||||||
return `ipfs/${res[0].hash}`
|
progress: (prog) => console.log(`received: ${prog}`)
|
||||||
|
}
|
||||||
|
const res = await ipfsHttp.add(files, options)
|
||||||
|
return `ipfs/${res.slice(-1)[0].hash}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export const pinToIpfs = async hash => {
|
export const pinToIpfs = async hash => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user