From 97a392f2336055165d5ed6ff1b5b593dbc0eac92 Mon Sep 17 00:00:00 2001 From: itskovacs Date: Sat, 11 Oct 2025 19:13:16 +0200 Subject: [PATCH] :lipstick: Trip: redirect to trips on error --- src/src/app/components/trip/trip.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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] },