diff --git a/client/src/components/Map/MapView.tsx b/client/src/components/Map/MapView.tsx index 52d8824ea..8758f883e 100644 --- a/client/src/components/Map/MapView.tsx +++ b/client/src/components/Map/MapView.tsx @@ -797,6 +797,7 @@ function PlannerWaypointMarker({ useEffect(() => { if (!marker || !onMove) return const element = marker.getElement() + if (!element) return return wirePlannerWaypointDrag({ element, initial: { lat: point.lat, lng: point.lng }, diff --git a/client/src/components/Tours/TourDayRowFacts.tsx b/client/src/components/Tours/TourDayRowFacts.tsx index 058d306ed..fa8c1cc5c 100644 --- a/client/src/components/Tours/TourDayRowFacts.tsx +++ b/client/src/components/Tours/TourDayRowFacts.tsx @@ -76,7 +76,7 @@ function Fact({ export default function TourDayRowFacts({ tour, mobile = false }: { tour: TourListItem; mobile?: boolean }) { const { t } = useTranslation(); - const unit = useSettingsStore((state) => state.settings.distance_unit); + const unit = useSettingsStore((state) => state.settings.distance_unit) || 'metric'; const times = tourPlannedTimes(tour); const facts: Array<{ icon: LucideIcon; value: string; label: string; testId: string }> = []; const add = (icon: LucideIcon, value: string, label: string, testId: string) => diff --git a/server/src/db/entities/Tours.entity.ts b/server/src/db/entities/Tours.entity.ts index aebc72d34..91ba143ce 100644 --- a/server/src/db/entities/Tours.entity.ts +++ b/server/src/db/entities/Tours.entity.ts @@ -1,8 +1,8 @@ +import { Collection, EntityRepositoryType, type Opt, PrimaryKeyProp, type Ref, defineEntity, p } from '@mikro-orm/core'; import { ToursRepository } from '../repositories/Tours.repository'; import { Places } from './Places.entity'; import { TourTypes } from './TourTypes.entity'; import { TourWaypoints } from './TourWaypoints.entity'; -import { Collection, EntityRepositoryType, type Opt, PrimaryKeyProp, type Ref, defineEntity, p } from '@mikro-orm/core'; export class Tours { [EntityRepositoryType]?: ToursRepository;