From 2b7d517c51a46d9cc16e326d2125bd4c6ff3e142 Mon Sep 17 00:00:00 2001 From: itskovacs Date: Mon, 13 Oct 2025 11:43:36 +0200 Subject: [PATCH] :bug: fix trip empty dates redirection --- src/src/app/components/trip/trip.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/src/app/components/trip/trip.component.ts b/src/src/app/components/trip/trip.component.ts index 07743ac..55c6d1a 100644 --- a/src/src/app/components/trip/trip.component.ts +++ b/src/src/app/components/trip/trip.component.ts @@ -496,9 +496,11 @@ export class TripComponent implements AfterViewInit { resetMapBounds() { if (!this.places.length) { if (!this.trip?.days.length) return; + const itemsWithCoordinates = this.flattenedTripItems.filter((i) => i.lat != null && i.lng != null); + if (!itemsWithCoordinates.length) return; this.map?.fitBounds( - this.flattenedTripItems.filter((i) => i.lat != null && i.lng != null).map((i) => [i.lat!, i.lng!]), + itemsWithCoordinates.map((i) => [i.lat!, i.lng!]), { padding: [30, 30] }, ); return;