💄 Trip: redirect to trips on error

This commit is contained in:
itskovacs 2025-10-11 19:13:16 +02:00
parent a77421bc26
commit 97a392f233

View File

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