diff --git a/widget/Agenda.tsx b/widget/Agenda.tsx index 04df321..9a2aac4 100644 --- a/widget/Agenda.tsx +++ b/widget/Agenda.tsx @@ -1,5 +1,5 @@ import { App, Astal, Gdk } from "astal/gtk3"; -import { bind, execAsync, interval, Variable } from "astal"; +import { bind, execAsync, interval, timeout, Variable } from "astal"; type AgendaItem = { startDate: string; @@ -65,6 +65,10 @@ export default function Agenda(gdkmonitor: Gdk.Monitor) { transform(stdout), ]); }; + agenda.onError((err) => { + console.error(`failed to fetch agenda: ${err}`); + timeout(5000, watch); + }); const intervalHandler = interval(1000 * 60 * 10 /* 10 minutes */, watch); return (