diff --git a/src/src/app/components/trip/trip.component.ts b/src/src/app/components/trip/trip.component.ts index ae2a737..341afb4 100644 --- a/src/src/app/components/trip/trip.component.ts +++ b/src/src/app/components/trip/trip.component.ts @@ -341,7 +341,9 @@ export class TripComponent implements AfterViewInit { this.tripMembers = members; }), ) - .subscribe(); + .subscribe({ + error: () => this.router.navigateByUrl('/trips'), + }); } initMap(settings: Settings): void { @@ -491,6 +493,8 @@ export class TripComponent implements AfterViewInit { resetMapBounds() { if (!this.places.length) { + if (!this.trip?.days.length) return; + this.map?.fitBounds( this.flattenedTripItems.filter((i) => i.lat != null && i.lng != null).map((i) => [i.lat!, i.lng!]), { padding: [30, 30] },