refactor(client): stop passing around unused data (#57432)

This commit is contained in:
Oliver Eyton-Williams
2024-12-06 14:53:18 +01:00
committed by GitHub
parent 245b486f63
commit 3c48b8dd3f
6 changed files with 13 additions and 12 deletions
@@ -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