Skip to content

Commit

Permalink
fix: frontend error logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ilbertt committed Jun 6, 2024
1 parent 9c35a4a commit 2e7b3f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions frontend/app/dashboard/new-deployment/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export default function NewDeployment() {

setDeploymentSteps([]);
setDeploymentError(null);
setIsDeploying(false);
setIsSubmitting(true);
setPaymentStatus(null);

Expand All @@ -94,6 +93,7 @@ export default function NewDeployment() {
setPaymentStatus(prev => prev + " FAILED");
setDeploymentParams(null);
setIsSubmitting(false);
setIsDeploying(false);
return;
}
}, [backendActor, deploymentE8sPrice, ledgerCanister, refreshLedgerData, toastError]);
Expand Down Expand Up @@ -121,10 +121,6 @@ export default function NewDeployment() {
try {
await createDeployment();
} catch (e: any) {
console.error("Failed to create deployment:", e);

setIsDeploying(false);

if (e.message.startsWith("Not enough balance. Required: ")) {
console.warn("Failed to create deployment, insufficient balance. Auto top-up initiated.");

Expand All @@ -133,6 +129,8 @@ export default function NewDeployment() {

await createDeployment();
} else {
console.error("Failed to create deployment:", e);
setIsDeploying(false);
setDeploymentError("Failed to create deployment, see console for details");
}
}
Expand Down

0 comments on commit 2e7b3f1

Please sign in to comment.