Skip to content

Commit

Permalink
refactor: Optimize landmark and segment loading in useSessionLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
durandom committed Nov 29, 2024
1 parent b843561 commit 1e8ed61
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/hooks/useSessionLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ export function useSessionLoader({
const session = getSession(sessionId);
if (!session) return;

// TODO: Fetch landmarks only if session changes, i.e. above
const landmarks = getLandmarks(session.track.id);
const landmarks = analysisData?.landmarks || getLandmarks(session.track.id);

const sessionLaps = session.laps.filter(lap =>
lapIds.includes(lap.id)
Expand Down Expand Up @@ -105,7 +104,6 @@ export function useSessionLoader({
segmentsByLapId[item.lap.id] = item.segments;
});
logger.loader('useSessionLoader: fetched missing laps', fetchedLapsAndSegments);
logger.loader('useSessionLoader: fetched missing laps', segmentsByLapId);

const data: AnalysisData = {
session,
Expand Down

0 comments on commit 1e8ed61

Please sign in to comment.