Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHougaard committed Feb 16, 2024
1 parent 6e6099c commit a9f0474
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/src/services/project/project-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ export const projectQueueFactory = ({

await projectDAL.setProjectUpgradeStatus(data.projectId, null, tx);

// throw new Error("Transaction was successful!");
throw new Error("Transaction was successful!");
});
} catch (err) {
console.log(err);

Check warning on line 391 in backend/src/services/project/project-queue.ts

View workflow job for this annotation

GitHub Actions / Check TS and Lint

Unexpected console statement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
const { membership } = useProjectPermission();
const upgradeProject = useUpgradeProject();
const [currentStatus, setCurrentStatus] = useState<string | null>(null);
const [isUpgrading, setIsUpgrading] = useState(false);
const {
data: projectStatus,
refetch: getLatestProjectStatus,
isLoading: statusIsLoading
} = useGetUpgradeProjectStatus(project.id);

const onUpgradeProject = useCallback(async () => {
if (upgradeProject.isLoading) {
return;
}
setIsUpgrading(true);
const PRIVATE_KEY = localStorage.getItem("PRIVATE_KEY");

if (!PRIVATE_KEY) {
Expand All @@ -42,6 +47,8 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
});

await getLatestProjectStatus();

setTimeout(() => setIsUpgrading(false), 5_000);
}, []);

useEffect(() => {
Expand Down Expand Up @@ -79,7 +86,8 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
}, [projectStatus]);

const isLoading =
(upgradeProject.isLoading ||
(isUpgrading ||
upgradeProject.isLoading ||
currentStatus !== null ||
(currentStatus === null && statusIsLoading)) &&
projectStatus?.status !== "FAILED";
Expand Down

0 comments on commit a9f0474

Please sign in to comment.