From 92c984607b8b392a2cd68e9c31e2838ddaa2ac1f Mon Sep 17 00:00:00 2001 From: Barry Gitarts Date: Fri, 9 Aug 2019 09:58:44 -0400 Subject: [PATCH] export getProjectManifest --- src/components/projects/Project.jsx | 5 +---- src/utils/project.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/projects/Project.jsx b/src/components/projects/Project.jsx index 406464a..b3dff3e 100644 --- a/src/components/projects/Project.jsx +++ b/src/components/projects/Project.jsx @@ -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}) diff --git a/src/utils/project.js b/src/utils/project.js index 9f90043..142b061 100644 --- a/src/utils/project.js +++ b/src/utils/project.js @@ -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 }