Skip to content

Commit 68bbfc2

Browse files
committed
Fix lint findings in profile UI
1 parent edb9d8f commit 68bbfc2

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

src/components/path-profile-app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ export function PathProfileApp() {
390390
setProfilePoints([]);
391391
syncLineOfSightEndpoints(null);
392392
setActivePoint(null);
393-
profileRequestIdRef.current += 1;
393+
invalidateProfileRequest();
394394
setDrawingEnabled(true);
395395
setPathEditEnabled(false);
396396
setClearPathRequest((request) => request + 1);

src/components/profile-chart.tsx

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,18 @@ export function ProfileChart({
131131
return;
132132
}
133133

134-
setChartBounds((current) =>
135-
current &&
136-
current.controlTop === nextBounds.controlTop &&
137-
current.left === nextBounds.left &&
138-
current.right === nextBounds.right &&
139-
current.width === nextBounds.width
140-
? current
141-
: nextBounds,
142-
);
134+
setChartBounds((current) => {
135+
if (
136+
current?.controlTop === nextBounds.controlTop &&
137+
current.left === nextBounds.left &&
138+
current.right === nextBounds.right &&
139+
current.width === nextBounds.width
140+
) {
141+
return current;
142+
}
143+
144+
return nextBounds;
145+
});
143146
},
144147
}),
145148
[],
@@ -203,14 +206,7 @@ export function ProfileChart({
203206
}
204207

205208
return { datasets };
206-
}, [
207-
draggingEndpoint,
208-
hoveredEndpoint,
209-
lastDistance,
210-
lineOfSightEndpoints,
211-
points,
212-
theme,
213-
]);
209+
}, [lastDistance, lineOfSightEndpoints, points, theme]);
214210

215211
const getEndpointAtEvent = useCallback(
216212
(event: PointerEvent<HTMLDivElement>) => {

0 commit comments

Comments
 (0)