diff --git a/src/module/user/orderChallenges.js b/src/module/user/orderChallenges.js index 96b7608..35ead37 100644 --- a/src/module/user/orderChallenges.js +++ b/src/module/user/orderChallenges.js @@ -27,7 +27,7 @@ export function removeUnnecessaryChallenges(challengesArray, filters, masterOnly }) - const challengesDetailed = window.JSONPREQUEST; + const challengesDetailed = window.JSONPREQUEST || []; return challengesDetailed.map(function (challengeData) { diff --git a/src/module/user/statsCalculateTotalPoints.js b/src/module/user/statsCalculateTotalPoints.js index f429134..9ab1eab 100644 --- a/src/module/user/statsCalculateTotalPoints.js +++ b/src/module/user/statsCalculateTotalPoints.js @@ -11,21 +11,24 @@ export default function statsCalculateTotalPoints(challenges) { tiers[config.tiers[i]] = 0 } + console.log("-----"); + for (let i = 0; i < challenges.length; i++) { const challenge = challenges[i]; if (challenge[0] > 10 - && challenge[8] !== 600006 - && challenge[8] !== 2022000 - && challenge[8] !== 2023000 - && challenge[8] !== 601000 - && challenge[8] !== 2024100 - && challenge[8] !== 301104 - && challenge[8] !== 402406 + && challenge[6].parent !== "0" // summoner level challenge + && challenge[8] !== 2022000 // 2022 capstone + && challenge[8] !== 2023000 // 2023 capstone + && challenge[8] !== 601000 // arena capstone + && challenge[8] !== 2024100 // seasonal 2024 capstone + && challenge[6].state === "ENABLED" ) { //console.log(challenge[8]); tiers[intToTier(challenge[1])] += 1 + } else { + console.log(challenge[6].translation.name, challenge[6].translation.description) } } return tiers