From 3628dbed37e23ea4c120325314b0a7cd0a660b5a Mon Sep 17 00:00:00 2001 From: Daksh Shahani Date: Tue, 6 Oct 2026 15:35:09 -0700 Subject: [PATCH 1/2] fix(query-provider): use CMS active hackathon as default - Remove hardcoded HackCamp2026 fallback - Fetch activeHackathon via getAdminFlags --- src/providers/query-provider.tsx | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/providers/query-provider.tsx b/src/providers/query-provider.tsx index 73cf746..2ae3f5c 100644 --- a/src/providers/query-provider.tsx +++ b/src/providers/query-provider.tsx @@ -8,6 +8,7 @@ import type { GroupBySelection, Hackathon, } from "@/lib/firebase/types"; +import { getAdminFlags } from "@/services/evaluator"; import type { FlattenedApplicant } from "@/services/query"; import { calculateApplicantPoints, @@ -217,15 +218,29 @@ export function QueryProvider({ children }: QueryProviderProps) { }, [applicants, filterSelections, groupBySelection]); useEffect(() => { - const unsubscribe = subscribeToHackathons((hackathons) => { - setHackathons(hackathons); - if (hackathons.length > 0 && !selectedHackathon) { - // TEMP-FIX: default to HackCamp2026 - const fallback = hackathons.find((h) => h._id === "HackCamp2026"); - setSelectedHackathon(fallback?._id ?? hackathons[hackathons.length - 2]._id); - } + const unsubscribe = subscribeToHackathons((docs) => { + setHackathons(docs); }); return () => unsubscribe(); + }, []); + + // Default to the CMS Active Hackathon (InternalWebsites/CMS),aluator / Status Changer. + useEffect(() => { + if (selectedHackathon) return; + let cancelled = false; + (async () => { + try { + const adminConfig = await getAdminFlags(); + if (!cancelled && adminConfig?.activeHackathon) { + setSelectedHackathon(adminConfig.activeHackathon); + } + } catch (e) { + console.error("Failed to fetch active hackathon from CMS:", e); + } + })(); + return () => { + cancelled = true; + }; }, [selectedHackathon]); useEffect(() => { From 9af088e134ec53a45b25d84633b50838086b3865 Mon Sep 17 00:00:00 2001 From: Daksh Shahani Date: Tue, 6 Oct 2026 16:23:21 -0700 Subject: [PATCH 2/2] fix(query-provider): restore Evaluator source comment --- src/providers/query-provider.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/providers/query-provider.tsx b/src/providers/query-provider.tsx index 2ae3f5c..a15cafa 100644 --- a/src/providers/query-provider.tsx +++ b/src/providers/query-provider.tsx @@ -224,7 +224,8 @@ export function QueryProvider({ children }: QueryProviderProps) { return () => unsubscribe(); }, []); - // Default to the CMS Active Hackathon (InternalWebsites/CMS),aluator / Status Changer. + // Default to the CMS Active Hackathon (InternalWebsites/CMS), + // same source as Evaluator / Status Changer. useEffect(() => { if (selectedHackathon) return; let cancelled = false;