Skip to content

Commit

Permalink
disable button when build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Jul 28, 2024
1 parent d11c989 commit ceda335
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/build-deploy-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useState } from "react";
import { Button } from "./ui/button";
import { useCliCommands } from "./workspace/use-cli-commands";
import useSWR from "swr";
import useSWR, { mutate } from "swr";
import { useParams } from "next/navigation";
import { db } from "@/data/db";

Expand All @@ -27,9 +27,9 @@ export function BuildDeployPanel() {
disabled={isBuilding}
onClick={async () => {
try {
setIsDeploying(false);
setIsBuilding(true);
await commands.build();
mutate(`deployable-${id}`);
} catch (err) {
} finally {
setIsBuilding(false);
Expand All @@ -39,7 +39,7 @@ export function BuildDeployPanel() {
Build
</Button>
<Button
disabled={isBuilding || !isDeployable || isDeploying}
disabled={!isDeployable || isDeploying}
onClick={async () => {
try {
setIsDeploying(true);
Expand Down

0 comments on commit ceda335

Please sign in to comment.