From 0a383ef7d12aed37bf32f909b6a49772c733d73a Mon Sep 17 00:00:00 2001 From: Kezia Date: Sat, 7 Mar 2026 16:28:48 -0800 Subject: [PATCH 1/2] fix: raffle stamps --- src/components/features/stampbook/export-raffle-dialog.tsx | 2 +- src/services/stamps.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/features/stampbook/export-raffle-dialog.tsx b/src/components/features/stampbook/export-raffle-dialog.tsx index 7c08b7d..6466b52 100644 --- a/src/components/features/stampbook/export-raffle-dialog.tsx +++ b/src/components/features/stampbook/export-raffle-dialog.tsx @@ -76,7 +76,7 @@ export function ExportRaffleDialog({ open, onClose, stamps }: ExportRaffleDialog setLoading(true); try { - const allUserStamps = await fetchHackersWithStamps(); + const allUserStamps = await fetchHackersWithStamps(selectedHackathon); const filteredEntries = allUserStamps.filter((entry: HackerStampEntry) => selectedStampIds.includes(entry.stampId) ); diff --git a/src/services/stamps.ts b/src/services/stamps.ts index 1f3869a..f79c86f 100644 --- a/src/services/stamps.ts +++ b/src/services/stamps.ts @@ -144,7 +144,7 @@ export const deleteStampQR = async (stampId: string) => { * Each stamp a user has unlocked creates one entry (for nwHacks 2026 raffle weighting). * @returns Array of entries where each entry represents one stamp collected by a hacker */ -export const fetchHackersWithStamps = async (): Promise => { +export const fetchHackersWithStamps = async (hackathonId: string): Promise => { const socialsSnapshot = await getDocs(collection(db, "Socials")); const entries: HackerStampEntry[] = []; @@ -152,7 +152,7 @@ export const fetchHackersWithStamps = async (): Promise => { const socialData = socialDoc.data(); const displayName = socialData.preferredName || "User"; const email = socialData.email || ""; - const unlockedStamps: string[] = socialData.unlockedStamps || []; + const unlockedStamps: string[] = socialData.unlockedStamps?.[hackathonId] || []; for (const stampId of unlockedStamps) { entries.push({ From 4f6951b63ccdeea4e5bfaa0b95f71402c098fa6f Mon Sep 17 00:00:00 2001 From: Erping <111095333+ErpingS@users.noreply.github.com> Date: Tue, 7 Apr 2026 19:53:57 -0700 Subject: [PATCH 2/2] fix: update evaluator applicant ordering by submission time (#106) * final changes for cmd-f evaluation (#103) * hotfix(evaluator): add additional response field for cmd-f we probably want to move these values into firestore eventually * Evaluator settings fixes (#101) * fix: evalutor settings modal overflow * fix: update step increment and error msg spacing * minor: rename eval settings prop type --------- Co-authored-by: Jae Wu --------- Co-authored-by: Erping <111095333+ErpingS@users.noreply.github.com> * fix: update evaluator applicant ordering by submission time --------- Co-authored-by: Jae Wu Co-authored-by: Martin Cai --- .../features/evaluator/applicant-list.tsx | 13 ++++++++++++- src/lib/firebase/types.ts | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/features/evaluator/applicant-list.tsx b/src/components/features/evaluator/applicant-list.tsx index 8c2f7d1..2157bd4 100644 --- a/src/components/features/evaluator/applicant-list.tsx +++ b/src/components/features/evaluator/applicant-list.tsx @@ -26,7 +26,18 @@ export function ApplicantList() { const filteredApplicants = useMemo(() => { let list = applicants || []; list = filterApplicantsByStatus(list, selectedStatuses); - return filterApplicantsBySearch(list, searchTerm).sort((a, b) => a._id.localeCompare(b._id)); + return filterApplicantsBySearch(list, searchTerm) + .slice() + .sort((a, b) => { + const aSubmissionMs = a.submission?.submittedAt?.toMillis?.() ?? 0; + const bSubmissionMs = b.submission?.submittedAt?.toMillis?.() ?? 0; + + if (aSubmissionMs !== bSubmissionMs) { + return aSubmissionMs - bSubmissionMs; + } + + return a._id.localeCompare(b._id); + }); }, [applicants, searchTerm, selectedStatuses]); return ( diff --git a/src/lib/firebase/types.ts b/src/lib/firebase/types.ts index fb3add5..50c8f7c 100644 --- a/src/lib/firebase/types.ts +++ b/src/lib/firebase/types.ts @@ -260,6 +260,7 @@ export interface Applicant { submission?: { lastUpdated?: Timestamp; submitted?: boolean; + submittedAt?: Timestamp; }; dayOf?: { day1?: {