Skip to content

Commit c61ebd9

Browse files
authored
Merge pull request #1863 from eth3lbert/earlier-commit
Attemp to find earlier commit for the detail chart
2 parents 11a3c71 + 93952fa commit c61ebd9

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)