Skip to content

Commit 9e7c6de

Browse files
author
Laurie T. Malau
committed
Make sure prebuild and branch commit are the same
1 parent 18cf092 commit 9e7c6de

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/dashboard/src/projects/Project.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,10 @@ export default function () {
269269
.filter(filter)
270270
.slice(0, 10)
271271
.map((branch, index) => {
272-
const prebuild = lastPrebuild(branch); // this might lazily trigger fetching of prebuild details
273-
272+
let prebuild = lastPrebuild(branch); // this might lazily trigger fetching of prebuild details
273+
if (prebuild && prebuild.info.changeHash !== branch.changeHash) {
274+
prebuild = undefined;
275+
}
274276
const avatar = branch.changeAuthorAvatar && (
275277
<img
276278
className="rounded-full w-4 h-4 inline-block align-text-bottom mr-2 overflow-hidden"
@@ -360,7 +362,7 @@ export default function () {
360362
title: "Cancel Prebuild",
361363
customFontStyle:
362364
"text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300",
363-
onClick: () => cancelPrebuild(prebuild.info.id),
365+
onClick: () => cancelPrebuild(prebuild!.info.id),
364366
},
365367
]
366368
: []

0 commit comments

Comments
 (0)