Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

fix: fix aot bronze badge (#1211)

Eric Lee7abf760f4ac2
diff --git a/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/_actions.ts b/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/_actions.ts
index 8d818845..d1eb64b9 100644
--- a/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/_actions.ts
+++ b/apps/web/src/app/[locale]/(profile)/[username]/_components/dashboard/_actions.ts
@@ -198,12 +198,12 @@ export async function getBadges(userId: string): Promise<BadgeInfo[]> {
},
});
- const numberOfInProgressHolidayChallenges =
+ const numberOfAttemptedHolidayChallenges =
holidayTrack?.trackChallenges.filter((trackChallenge) => {
- return trackChallenge.challenge.submission?.every((submission) => !submission.isSuccessful);
+ return (trackChallenge.challenge.submission?.length ?? 0) > 0;
}).length ?? 0;
- if (numberOfInProgressHolidayChallenges > 0) {
+ if (numberOfAttemptedHolidayChallenges > 0) {
badges.push({ slug: 'aot-2023-bronze', name: 'Advent of TypeScript 2023 Bronze' });
}