diff --git a/src/app/(app)/home/page.tsx b/src/app/(app)/home/page.tsx index c189508..f6965b1 100644 --- a/src/app/(app)/home/page.tsx +++ b/src/app/(app)/home/page.tsx @@ -125,7 +125,11 @@ export default function HomePage() { window.addEventListener("online", handleOnline); fetch(`/api/notifications?childId=${childId}`) .then(res => res.json()) - .then(data => setVaccineReminders(data.notifications || [])) + // Only vaccine notifications belong in the "Vaccine Reminder" banner — + // the API also returns log/memory/garment nudges. + .then(data => setVaccineReminders( + (data.notifications || []).filter((n: { type?: string }) => n.type?.startsWith("vaccine_")) + )) .catch(console.error); return () => window.removeEventListener("online", handleOnline); }, [childId]); diff --git a/src/app/api/notifications/route.ts b/src/app/api/notifications/route.ts index dfb32cf..966fc63 100644 --- a/src/app/api/notifications/route.ts +++ b/src/app/api/notifications/route.ts @@ -83,12 +83,6 @@ export async function GET(request: NextRequest) { const child = children[0]; const birthDate = new Date(child.birth_date as string); - // Self-heal legacy data: an earlier generator stored "undefined" in the - // message ("undefined is N days overdue"). Those rows were frozen by - // ON CONFLICT DO NOTHING. Delete them so the upsert below regenerates them - // with the correct vaccine name. - await sql`DELETE FROM notifications WHERE family_id = ${familyId} AND message LIKE 'undefined%'`; - // ── 1. Vaccine notifications ────────────────────────────────────────────── const given = await sql` SELECT vaccine_name FROM vaccinations