mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 23:50:08 +00:00
make roadtrip availability checks explicit
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user