diff --git a/src/actions/pledges.js b/src/actions/pledges.js index 6bfb096..385e4ab 100644 --- a/src/actions/pledges.js +++ b/src/actions/pledges.js @@ -32,7 +32,6 @@ export const batchAddPledges = async (pledges, profiles = []) => { const batch = pledges.map(data => { return pledgesCollection.prepareCreate(pledge => createPledge(pledge, data, profiles)) }) - console.log({batch}) return await database.action(async () => await database.batch(...batch)) } diff --git a/src/components/projects/hooks.js b/src/components/projects/hooks.js index be4c899..edd273a 100644 --- a/src/components/projects/hooks.js +++ b/src/components/projects/hooks.js @@ -89,10 +89,23 @@ const isManifest = asset => { const name = asset.path.split('/').slice(-1)[0] return name.toLowerCase() === 'manifest.json' } -const getProjectManifest = assets => { +const getProjectManifest = (data, assets) => { + if (data && data.profile && data.profile.projectInfo) { + const { isPlaying, type, file } = data.profile.projectInfo + return { + ...data.profile.projectInfo, + media: { + isPlaying, + type, + file + } + } + } + if (!assets) { return null; } + const manifest = assets.find(isManifest); if (!manifest) { return null; @@ -132,7 +145,7 @@ export function useProjectData(projectId, data) { getProjectAssets(data, setAssets) }, [ipfsReady, data]) - const manifest = useMemo(() => getProjectManifest(projectAssets), [projectAssets, projectId]) + const manifest = useMemo(() => getProjectManifest(data, projectAssets), [data, projectAssets, projectId]) return { account, diff --git a/src/components/projects/queries.js b/src/components/projects/queries.js index 4530f65..402acea 100644 --- a/src/components/projects/queries.js +++ b/src/components/projects/queries.js @@ -17,6 +17,21 @@ query Profile($id: ID!){ lifetimeReceived balance } + projectInfo{ + id + title + subtitle + creator + repo + avatar + goal + goalToken + description + chatRoom + file + type + isPlaying + } } } `