mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 07:26:34 +00:00
More
This commit is contained in:
@@ -385,7 +385,7 @@ export const projectQueueFactory = ({
|
|||||||
|
|
||||||
await projectDAL.setProjectUpgradeStatus(data.projectId, null, tx);
|
await projectDAL.setProjectUpgradeStatus(data.projectId, null, tx);
|
||||||
|
|
||||||
// throw new Error("Transaction was successful!");
|
throw new Error("Transaction was successful!");
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
|
|||||||
const { membership } = useProjectPermission();
|
const { membership } = useProjectPermission();
|
||||||
const upgradeProject = useUpgradeProject();
|
const upgradeProject = useUpgradeProject();
|
||||||
const [currentStatus, setCurrentStatus] = useState<string | null>(null);
|
const [currentStatus, setCurrentStatus] = useState<string | null>(null);
|
||||||
|
const [isUpgrading, setIsUpgrading] = useState(false);
|
||||||
const {
|
const {
|
||||||
data: projectStatus,
|
data: projectStatus,
|
||||||
refetch: getLatestProjectStatus,
|
refetch: getLatestProjectStatus,
|
||||||
@@ -26,6 +27,10 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
|
|||||||
} = useGetUpgradeProjectStatus(project.id);
|
} = useGetUpgradeProjectStatus(project.id);
|
||||||
|
|
||||||
const onUpgradeProject = useCallback(async () => {
|
const onUpgradeProject = useCallback(async () => {
|
||||||
|
if (upgradeProject.isLoading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setIsUpgrading(true);
|
||||||
const PRIVATE_KEY = localStorage.getItem("PRIVATE_KEY");
|
const PRIVATE_KEY = localStorage.getItem("PRIVATE_KEY");
|
||||||
|
|
||||||
if (!PRIVATE_KEY) {
|
if (!PRIVATE_KEY) {
|
||||||
@@ -42,6 +47,8 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
|
|||||||
});
|
});
|
||||||
|
|
||||||
await getLatestProjectStatus();
|
await getLatestProjectStatus();
|
||||||
|
|
||||||
|
setTimeout(() => setIsUpgrading(false), 5_000);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -79,7 +86,8 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
|
|||||||
}, [projectStatus]);
|
}, [projectStatus]);
|
||||||
|
|
||||||
const isLoading =
|
const isLoading =
|
||||||
(upgradeProject.isLoading ||
|
(isUpgrading ||
|
||||||
|
upgradeProject.isLoading ||
|
||||||
currentStatus !== null ||
|
currentStatus !== null ||
|
||||||
(currentStatus === null && statusIsLoading)) &&
|
(currentStatus === null && statusIsLoading)) &&
|
||||||
projectStatus?.status !== "FAILED";
|
projectStatus?.status !== "FAILED";
|
||||||
|
|||||||
Reference in New Issue
Block a user