Skip to content

Commit 2b7d517

Browse files
committed
🐛 fix trip empty dates redirection
1 parent 524a18c commit 2b7d517

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/src/app/components/trip/trip.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,11 @@ export class TripComponent implements AfterViewInit {
496496
resetMapBounds() {
497497
if (!this.places.length) {
498498
if (!this.trip?.days.length) return;
499+
const itemsWithCoordinates = this.flattenedTripItems.filter((i) => i.lat != null && i.lng != null);
500+
if (!itemsWithCoordinates.length) return;
499501

500502
this.map?.fitBounds(
501-
this.flattenedTripItems.filter((i) => i.lat != null && i.lng != null).map((i) => [i.lat!, i.lng!]),
503+
itemsWithCoordinates.map((i) => [i.lat!, i.lng!]),
502504
{ padding: [30, 30] },
503505
);
504506
return;

0 commit comments

Comments
 (0)