fix(profile): Fix challenges of undefined Error

This commit is contained in:
Stuart Taylor
2018-02-27 14:29:37 +00:00
parent 6cf3fb6049
commit b81cea4b08
3 changed files with 18 additions and 7 deletions

View File

@@ -34,10 +34,19 @@ export default function mapUiService(app) {
}, {});
const blockMap = Object.keys(fullBlockMap)
.map(block => fullBlockMap[block])
.reduce((map, { dashedName, title, time, challenges }) => {
map[dashedName] = { dashedName, title, time, challenges };
return map;
}, {});
.reduce(
(map, { dashedName, title, time, challenges, superBlock }) => {
map[dashedName] = {
dashedName,
title,
time,
challenges,
superBlock
};
return map;
},
{}
);
const challengeMap = Object.keys(fullChallengeMap)
.map(challenge => fullChallengeMap[challenge])
.reduce((map, challenge) => {