mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor(client): stop passing around unused data (#57432)
This commit is contained in:
committed by
GitHub
parent
245b486f63
commit
3c48b8dd3f
@@ -86,11 +86,6 @@ function getTemplateComponent(challengeType) {
|
||||
return views[viewTypes[challengeType]];
|
||||
}
|
||||
|
||||
function getNextBlock(id, edges) {
|
||||
const next = edges[id + 1];
|
||||
return next ? next.node.challenge.block : null;
|
||||
}
|
||||
|
||||
exports.createChallengePages = function (createPage) {
|
||||
return function ({ node }, index, allChallengeEdges) {
|
||||
const {
|
||||
@@ -104,7 +99,8 @@ exports.createChallengePages = function (createPage) {
|
||||
required = [],
|
||||
template,
|
||||
challengeType,
|
||||
id
|
||||
id,
|
||||
isLastChallengeInBlock
|
||||
} = node.challenge;
|
||||
// TODO: challengeType === 7 and isPrivate are the same, right? If so, we
|
||||
// should remove one of them.
|
||||
@@ -124,7 +120,7 @@ exports.createChallengePages = function (createPage) {
|
||||
isFirstStep: getIsFirstStepInBlock(index, allChallengeEdges),
|
||||
template,
|
||||
required,
|
||||
nextBlock: getNextBlock(index, allChallengeEdges),
|
||||
isLastChallengeInBlock: isLastChallengeInBlock,
|
||||
nextChallengePath: getNextChallengePath(index, allChallengeEdges),
|
||||
prevChallengePath: getPrevChallengePath(index, allChallengeEdges),
|
||||
id
|
||||
|
||||
Reference in New Issue
Block a user