summaryrefslogtreecommitdiff
path: root/internal/handlers/handlers.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-06-29 10:29:12 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-06-29 10:29:12 +0000
commit8c55b9b10fecd45ac5acf3f13fc23d342a4aa53b (patch)
treed0e596f79980af79eed6e0e657d667e4758a9520 /internal/handlers/handlers.go
parentd826bf5e9561a8c66a2c52bb1c2a3835fc6de32c (diff)
fix: calendar/meals sync, tomorrow flat layout, /health endpoint
- Calendar: fall back to GOOGLE_CALENDAR_ID config when no source_configs synced yet (fixes blank calendar after fresh deploy) - Meals: call fetchMeals in HandleTimeline so PlanToEat cache refreshes on every timeline load, not just during manual refresh - Tomorrow section: replace calendar-grid with flat chronological list matching widget layout (time label | source bar | title) - Add /health endpoint (no auth required) for deploy health checks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/handlers.go')
-rw-r--r--internal/handlers/handlers.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go
index 5ecaf7c..eaef558 100644
--- a/internal/handlers/handlers.go
+++ b/internal/handlers/handlers.go
@@ -392,10 +392,14 @@ func (h *Handler) fetchCalendarEvents(ctx context.Context, forceRefresh bool) ([
}
}
- // If none enabled but we have a default from config, use that as a fallback
- // (or if we want to respect the toggle strictly, we should only use enabled ones)
if len(enabledIDs) == 0 {
- return nil, nil
+ // No source_configs synced yet — fall back to the configured calendar ID
+ if len(configs) == 0 && h.config.GoogleCalendarID != "" {
+ enabledIDs = []string{h.config.GoogleCalendarID}
+ } else {
+ // Configs exist but all disabled — respect that
+ return nil, nil
+ }
}
h.googleCalendarClient.SetCalendarIDs(enabledIDs)