@bobfrankston/rmfmail 1.0.667 → 1.0.668

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -599,25 +599,34 @@ export function initCalendarSidebar(): void {
599
599
  refresh();
600
600
  });
601
601
  }
602
- // Q131: Show-holidays toggle. Lives in service settings (not localStorage)
603
- // because the daemon decides whether to pull from the US holidays
604
- // calendarso this preference has to round-trip to it.
605
- const holiCb = document.getElementById("cal-side-show-holidays") as HTMLInputElement | null;
606
- if (holiCb && !(holiCb as any).__wired) {
607
- (holiCb as any).__wired = true;
602
+ // Holiday-calendar toggles. Each lives in service settings (not
603
+ // localStorage) because the daemon's refresh loop decides which
604
+ // calendars to pull the preference has to round-trip to it.
605
+ // Two separate Google public calendars today: US federal holidays
606
+ // and Jewish holidays. Generalization to arbitrary user-supplied
607
+ // calendars is filed as Q140 (low priority unless the audience
608
+ // broadens beyond Bob).
609
+ const wireHolidayCheckbox = (
610
+ cbId: string,
611
+ settingsKey: "showHolidays" | "showJewishHolidays",
612
+ ): void => {
613
+ const cb = document.getElementById(cbId) as HTMLInputElement | null;
614
+ if (!cb || (cb as any).__wired) return;
615
+ (cb as any).__wired = true;
608
616
  getSettings().then((s: any) => {
609
- holiCb.checked = !!s?.calendar?.showHolidays;
617
+ cb.checked = !!s?.calendar?.[settingsKey];
610
618
  }).catch(() => { /* */ });
611
- holiCb.addEventListener("change", async () => {
619
+ cb.addEventListener("change", async () => {
612
620
  try {
613
621
  const s = await getSettings();
614
- s.calendar = { ...(s.calendar || {}), showHolidays: holiCb.checked };
622
+ s.calendar = { ...(s.calendar || {}), [settingsKey]: cb.checked };
615
623
  await saveSettings(s);
616
- } catch (e: any) { console.error("[cal] showHolidays save failed:", e); }
617
- // Service picks up the new value on the next refresh tick.
624
+ } catch (e: any) { console.error(`[cal] ${settingsKey} save failed:`, e); }
618
625
  refresh();
619
626
  });
620
- }
627
+ };
628
+ wireHolidayCheckbox("cal-side-show-holidays", "showHolidays");
629
+ wireHolidayCheckbox("cal-side-show-jewish-holidays", "showJewishHolidays");
621
630
  // Horizon input — how many days ahead to list events. Bounded 1..365.
622
631
  const horizonInput = document.getElementById("cal-side-horizon") as HTMLInputElement | null;
623
632
  if (horizonInput && !(horizonInput as any).__wired) {