mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix: update already completed challenge (#51017)
This commit is contained in:
@@ -124,15 +124,12 @@ export async function updateUserChallengeData(
|
||||
: null;
|
||||
|
||||
if (alreadyCompleted && oldChallenge) {
|
||||
const challengeWithOldDate = userCompletedChallenges[oldIndex];
|
||||
finalChallenge = {
|
||||
...completedChallenge,
|
||||
completedDate: oldChallenge.completedDate
|
||||
};
|
||||
|
||||
if (challengeWithOldDate) {
|
||||
challengeWithOldDate.completedDate = oldChallenge.completedDate;
|
||||
finalChallenge = {
|
||||
...completedChallenge,
|
||||
...challengeWithOldDate
|
||||
};
|
||||
}
|
||||
userCompletedChallenges[oldIndex] = finalChallenge;
|
||||
} else {
|
||||
finalChallenge = {
|
||||
...completedChallenge
|
||||
|
||||
Reference in New Issue
Block a user