export getProjectManifest

This commit is contained in:
Barry Gitarts 2019-08-09 09:58:44 -04:00 committed by Barry G
parent 461604bd66
commit 92c984607b
2 changed files with 2 additions and 5 deletions

View File

@ -21,6 +21,7 @@ import { timeSinceBlock } from '../../utils/dates'
import { getAmountsPledged } from '../../utils/pledges'
import { getFiles } from '../../utils/ipfs'
import { getImageType } from '../../utils/images'
import { getProjectManifest } from '../../utils/project'
import { useProjectData } from './hooks'
const ROOT_PATH = '/root/'
@ -142,10 +143,6 @@ async function _getProjectAssets(hash, setState){
.catch(console.log)
}
const getProjectManifest = assets => {
return assets ? JSON.parse(assets.find(a => a.name.toLowerCase() === 'manifest.json').content) : null
}
const formatMedia = content => {
const type = 'video/mp4'
const blob = new Blob([content], {type})

View File

@ -14,7 +14,7 @@ const isManifest = asset => {
const name = getName(asset)
return name.toLowerCase() === 'manifest.json'
}
const getProjectManifest = assets => {
export const getProjectManifest = assets => {
return assets ? JSON.parse(assets.find(isManifest).content) : null
}