summaryrefslogtreecommitdiff
path: root/internal/handlers/timeline.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/timeline.go')
-rw-r--r--internal/handlers/timeline.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/handlers/timeline.go b/internal/handlers/timeline.go
index bbdae51..2c3c6b6 100644
--- a/internal/handlers/timeline.go
+++ b/internal/handlers/timeline.go
@@ -69,6 +69,13 @@ func (h *Handler) HandleTimeline(w http.ResponseWriter, r *http.Request) {
log.Printf("Warning: failed to fetch calendar events: %v", err)
}
+ // Refresh meals cache before building timeline
+ if h.planToEatClient != nil {
+ if _, err := h.fetchMeals(r.Context(), false); err != nil {
+ log.Printf("Warning: failed to fetch meals: %v", err)
+ }
+ }
+
// Call BuildTimeline
items, err := BuildTimeline(r.Context(), h.store, start, end)
if err != nil {