fix(native): show the travel day's Live Activity from three hours before its first stop

The Live Activity started with the first sync of a travel day and stayed on
the lock screen all day, so a day whose first stop is an evening flight held
it from the early morning on. It now appears three hours before the day's
first timed stop and stays until the day is done; liveDayDue() decides.
This commit is contained in:
Maurice
2026-11-12 14:00:47 +01:00
parent a1d3ffc2ce
commit b8ec428ad1
3 changed files with 57 additions and 3 deletions
@@ -20,6 +20,7 @@ import { widgetCover, widgetWeather } from '../../native/widgetMedia';
import { atlasSummary, collabSummary, packingDetail, type WidgetAtlas } from '../../native/widgetOnline';
import {
buildSnapshot,
liveDayDue,
pickTrip,
publishWidgets,
todayOf,
@@ -207,9 +208,10 @@ export default function NativeWidgetsSync(): null {
});
}
if (cancelled) return;
const live = main.day
? tripDayState(main.day, now.getHours() * 60 + now.getMinutes(), t('native.widget.dayDone'))
: null;
// The Live Activity from three hours before the day's first timed stop, not all day long.
const minutes = now.getHours() * 60 + now.getMinutes();
const live =
main.day && liveDayDue(main.day, minutes) ? tripDayState(main.day, minutes, t('native.widget.dayDone')) : null;
await publishWidgets(main.snapshot, live, choices);
await publishToWatch(hero, main, today);
};