Skip to content

Commit 93952fa

Browse files
Kobzoleth3lbert
andcommitted
Do not open compare page for the leftmost commit in a range graph
Co-authored-by: eth3lbert <eth3lbert+dev@gmail.com>
1 parent 11a3c71 commit 93952fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

site/frontend/src/graph/render.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,11 @@ function genPlotOpts({
356356
},
357357
tooltipPlugin({
358358
onclick(_u, _seriesIdx, dataIdx) {
359+
// No earlier data to show
360+
if (dataIdx == 0) return;
361+
359362
let thisCommit = commits[dataIdx][1];
360-
let prevCommit = (commits[dataIdx - 1] || [null, null])[1];
363+
let prevCommit = commits[dataIdx - 1][1];
361364
window.open(
362365
`/compare.html?start=${prevCommit}&end=${thisCommit}&stat=${stat}`
363366
);

0 commit comments

Comments
 (0)