Skip to content

Commit

Permalink
fix: installer view: missing install error
Browse files Browse the repository at this point in the history
add pause to wait a split second before re-loading install after a reprovision
  • Loading branch information
fidiego committed Nov 18, 2024
1 parent 9c3481d commit 4bffff0
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions components/InstallStepper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@ const InstallStepper = ({
user_error: false,
});

const loadInstall = async (installID: string) => {
// by this point we should have an install ID
// fetch the install so we can render the status
const res = await getInstall(installID);
if (res.error) {
setError(res);
return;
}

setInstall(res);

setError({
description: "",
error: "",
user_error: false,
});
};

// create or update install when form is submitted
const formAction = async (event) => {
event.preventDefault();
Expand All @@ -98,30 +116,18 @@ const InstallStepper = ({
installID = res.id;
// navigate to the sub-route
router.push(`/${app.name}/${res.id}`);
return;
} else {
// if we've already created the install, redeploy it
const reproRes = await redeployInstall(install.id, app, formData);
if (reproRes.error) {
setError(reproRes);
return;
}
setTimeout(() => {
loadInstall(install.id);
}, 150);
}

// by this point we should have an install ID
// fetch the install so we can render the status
const res = await getInstall(installID);
if (res.error) {
setError(res);
return;
}

setInstall(res);

setError({
description: "",
error: "",
user_error: false,
});
};

// poll for install status once we have an ID
Expand Down

0 comments on commit 4bffff0

Please sign in to comment.