Skip to content

Commit fb55dd7

Browse files
committed
Fixed challenge filtering logic
1 parent 4b7524d commit fb55dd7

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/pages/challenges.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ export function Challenges() {
7272
const filteredChallenges = [];
7373

7474
for (const challenge of data) {
75-
const targetName = challenge.name.replaceAll(' ', '_');
76-
const exists = profileData.completions.find(chall => chall.name === targetName);
75+
const exists = profileData.completions.find(chall => chall.id === challenge._id);
7776
if (!exists) {
7877
filteredChallenges.push(challenge);
7978
}
@@ -94,8 +93,7 @@ export function Challenges() {
9493
const filteredChallenges = [];
9594

9695
for (const challenge of data) {
97-
const targetName = challenge.name.replaceAll(' ', '_');
98-
const exists = teamData.completions.find(chall => chall.name === targetName);
96+
const exists = teamData.completions.find(chall => chall.id === challenge._id);
9997
if (!exists) {
10098
filteredChallenges.push(challenge);
10199
}

0 commit comments

Comments
 (0)