mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 23:27:31 +00:00
fix(map): set the trip overview aside for the visit instead of switching it off
Making room for the day details went through the overview's remembered switch, which the account keeps per trip and syncs to every device. A day sheet on the phone, or two cards that did not fit on a narrow window, turned the overview off everywhere without the traveller touching the pill. The overview is now set aside for this visit only: the remembered switch stays as it was, the pill shows it off and brings it back with one tap, and a reload shows it again. The route overview hook keeps its declared return type with the new hasPlannedRoute flag.
This commit is contained in:
@@ -17,6 +17,9 @@ export interface TripRouteOverview extends TripRouteSummary {
|
||||
loading: boolean
|
||||
}
|
||||
|
||||
/** The overview as the planner reads it: also whether the trip has any stop to route at all. */
|
||||
type PlannedTripRouteOverview = TripRouteOverview & { hasPlannedRoute: boolean }
|
||||
|
||||
const EMPTY: TripRouteOverview = { ...summariseTripRoute([]), loading: false }
|
||||
const EMPTY_PLACES: Place[] = []
|
||||
|
||||
@@ -49,7 +52,7 @@ export function useTripRouteOverview(
|
||||
vias?: TripRouteVias,
|
||||
/** MDT-02: where the stages of the trip's multi-day tours run, so a day holding one draws that stage. */
|
||||
tourStageStops?: TourStageStops,
|
||||
) {
|
||||
): PlannedTripRouteOverview {
|
||||
const optimizeFromAccommodation = useSettingsStore(s => s.settings.optimize_from_accommodation)
|
||||
const toursEnabled = useTripAddonEnabled(tripId, 'tours')
|
||||
// Leg text is formatted at compute time, so a km↔mi switch has to re-run (#1300).
|
||||
|
||||
Reference in New Issue
Block a user