(introLevels)
| 72 | |
| 73 | // fetches interactive/cinematic/cutcsene data for the intro levels |
| 74 | fetchIntroContent (introLevels) { |
| 75 | const introLevelsContent = _.flatten(introLevels.map(l => l.get('introContent'))) |
| 76 | const introLevelsContentMap = {} |
| 77 | const introContentPromises = [] |
| 78 | introLevelsContent.forEach(c => { |
| 79 | if (c.type === 'avatarSelectionScreen') { return } |
| 80 | // contentId can be an object if interactive is different for python/js |
| 81 | if ((c.type === 'interactive') && (typeof c.contentId === 'object')) { |
| 82 | return (Object.values(c.contentId) || []).forEach(id => introContentPromises.push(getInteractive(id))) |
| 83 | } else { |
| 84 | if (c.type === 'cinematic') { introContentPromises.push(getCinematic(c.contentId)) } |
| 85 | if (c.type === 'interactive') { introContentPromises.push(getInteractive(c.contentId)) } |
| 86 | if (c.type === 'cutscene-video') { return introContentPromises.push(getCutscene(c.contentId)) } |
| 87 | } |
| 88 | }) |
| 89 | |
| 90 | return Promise.all(introContentPromises) |
| 91 | .then(contentData => { |
| 92 | contentData.forEach(c => { |
| 93 | introLevelsContentMap[c._id] = c |
| 94 | }) |
| 95 | return introLevelsContentMap |
| 96 | }) |
| 97 | }, |
| 98 | |
| 99 | fetchPracticeLevels (levelId) { |
| 100 | return fetchJson(`/db/level/${levelId}/practice-levels`) |
nothing calls this directly
no test coverage detected