From 0a383ef7d12aed37bf32f909b6a49772c733d73a Mon Sep 17 00:00:00 2001 From: Kezia Date: Sat, 7 Mar 2026 16:28:48 -0800 Subject: [PATCH] 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({