make roadtrip availability checks explicit

This commit is contained in:
Maurice
2026-09-12 16:46:22 +02:00
parent bc04072dc9
commit 51626e8184
2 changed files with 2 additions and 2 deletions
@@ -332,7 +332,7 @@ export default function RoadtripCorridorPanel({ corridor, routes, onAddPoi, trip
/>
</div>
) : null}
{tripId && canImport && <GoogleRouteImport tripId={tripId} dayId={corridor.day?.dayId} />}
{tripId !== undefined && tripId > 0 && canImport && <GoogleRouteImport tripId={tripId} dayId={corridor.day?.dayId} />}
</div>
{/* What to look for. */}
@@ -32,7 +32,7 @@ export class RoadtripHazardsService {
async read(): Promise<RoadtripHazards> {
if (this.cached && Date.now() - Date.parse(this.cached.fetchedAt) < 600000) return this.cached;
if (this.pending) return this.pending;
if (this.pending !== undefined) return this.pending;
this.pending = this.load();
try { this.cached = await this.pending; return this.cached; }
finally { this.pending = undefined; }