diff --git a/components/dashboard/src/projects/Prebuild.tsx b/components/dashboard/src/projects/Prebuild.tsx
index c36ffd7e58987d..e46ad41e96f455 100644
--- a/components/dashboard/src/projects/Prebuild.tsx
+++ b/components/dashboard/src/projects/Prebuild.tsx
@@ -156,39 +156,42 @@ export default function () {
- {["aborted", "timeout", "failed"].includes(prebuild?.status || "") || !!prebuild?.error ? (
-
- ) : ["building", "queued"].includes(prebuild?.status || "") ? (
+ {["building", "queued"].includes(prebuild?.status || "") ? (
- ) : prebuild?.status === "available" ? (
-
-
-
) : (
-
+ <>
+
+ {prebuild?.status === "available" ? (
+
+
+
+ ) : (
+
+ )}
+ >
)}
diff --git a/components/dashboard/src/projects/Prebuilds.tsx b/components/dashboard/src/projects/Prebuilds.tsx
index e86d47e1698dd5..570e5145b5fb4b 100644
--- a/components/dashboard/src/projects/Prebuilds.tsx
+++ b/components/dashboard/src/projects/Prebuilds.tsx
@@ -39,6 +39,7 @@ export default function (props: { project?: Project; isAdminDashboard?: boolean
const [isLoadingPrebuilds, setIsLoadingPrebuilds] = useState(true);
const [prebuilds, setPrebuilds] = useState([]);
+ const [isRunningPrebuild, setIsRunningPrebuild] = useState(false);
useEffect(() => {
let registration: Disposable;
@@ -139,11 +140,18 @@ export default function (props: { project?: Project; isAdminDashboard?: boolean
return -1;
};
- const triggerPrebuild = (branchName: string | null) => {
+ const runPrebuild = async (branchName: string | null) => {
if (!project) {
return;
}
- getGitpodService().server.triggerPrebuild(project.id, branchName);
+ setIsRunningPrebuild(true);
+ try {
+ await getGitpodService().server.triggerPrebuild(project.id, branchName);
+ } catch (error) {
+ console.error("Could not run prebuild", error);
+ } finally {
+ setIsRunningPrebuild(false);
+ }
};
const formatDate = (date: string | undefined) => {
@@ -182,9 +190,16 @@ export default function (props: { project?: Project; isAdminDashboard?: boolean
- {!isLoadingPrebuilds && prebuilds.length === 0 && !props.isAdminDashboard && (
-