diff --git a/apps/mobile/src/app/(tabs)/index.tsx b/apps/mobile/src/app/(tabs)/index.tsx index f4ac089..9f6446f 100644 --- a/apps/mobile/src/app/(tabs)/index.tsx +++ b/apps/mobile/src/app/(tabs)/index.tsx @@ -56,11 +56,14 @@ export default function WhatToEatScreen() { const [page, setPage] = useState(0); const { track } = useAnalytics(); + const hour = new Date().getHours(); + const currentMeal = hour < 10 ? "breakfast" : hour < 14 ? "lunch" : "dinner"; + const query = useQuery({ - queryKey: ["what-to-eat", submittedCraving], + queryKey: ["what-to-eat", submittedCraving, currentMeal], queryFn: () => api( - `/v1/recommendations/what-to-eat?limit=15&view=pantry${submittedCraving ? `&craving=${encodeURIComponent(submittedCraving)}` : ""}`, + `/v1/recommendations/what-to-eat?limit=15&view=pantry&mealType=${currentMeal}${submittedCraving ? `&craving=${encodeURIComponent(submittedCraving)}` : ""}`, ), });