diff --git a/components/dashboard/src/projects/Prebuild.tsx b/components/dashboard/src/projects/Prebuild.tsx
index a50e19a561c68f..d957de2ef765f6 100644
--- a/components/dashboard/src/projects/Prebuild.tsx
+++ b/components/dashboard/src/projects/Prebuild.tsx
@@ -80,8 +80,16 @@ export default function () {
)
};
- const onInstanceUpdate = (instance: WorkspaceInstance) => {
+ const onInstanceUpdate = async (instance: WorkspaceInstance) => {
setPrebuildInstance(instance);
+ if (!prebuild) {
+ return;
+ }
+ const prebuilds = await getGitpodService().server.findPrebuilds({
+ projectId: prebuild.info.projectId,
+ prebuildId
+ });
+ setPrebuild(prebuilds[0]);
}
const rerunPrebuild = async () => {
@@ -132,7 +140,7 @@ export default function () {
Rerun Prebuild ({prebuild.info.branch})
: (prebuild?.status === 'building'
- ?