mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 10:26:16 +00:00
Update UpgradeProjectAlert.tsx
This commit is contained in:
@@ -18,7 +18,6 @@ export type UpgradeProjectAlertProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.Element | null => {
|
export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.Element | null => {
|
||||||
console.log("yes");
|
|
||||||
const { createNotification } = useNotificationContext();
|
const { createNotification } = useNotificationContext();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { membership } = useProjectPermission();
|
const { membership } = useProjectPermission();
|
||||||
@@ -26,8 +25,6 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
|
|||||||
const [currentStatus, setCurrentStatus] = useState<string | null>(null);
|
const [currentStatus, setCurrentStatus] = useState<string | null>(null);
|
||||||
const [isUpgrading, setIsUpgrading] = useState(false);
|
const [isUpgrading, setIsUpgrading] = useState(false);
|
||||||
|
|
||||||
console.log("yes 2");
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: projectStatus,
|
data: projectStatus,
|
||||||
isLoading: statusIsLoading,
|
isLoading: statusIsLoading,
|
||||||
@@ -55,8 +52,6 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("yes 3");
|
|
||||||
|
|
||||||
const onUpgradeProject = useCallback(async () => {
|
const onUpgradeProject = useCallback(async () => {
|
||||||
if (upgradeProject.isLoading) {
|
if (upgradeProject.isLoading) {
|
||||||
return;
|
return;
|
||||||
@@ -82,8 +77,6 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
|
|||||||
setTimeout(() => setIsUpgrading(false), 5_000);
|
setTimeout(() => setIsUpgrading(false), 5_000);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
console.log("yes 4");
|
|
||||||
|
|
||||||
const isLoading =
|
const isLoading =
|
||||||
isUpgrading ||
|
isUpgrading ||
|
||||||
((upgradeProject.isLoading ||
|
((upgradeProject.isLoading ||
|
||||||
@@ -91,11 +84,8 @@ export const UpgradeProjectAlert = ({ project }: UpgradeProjectAlertProps): JSX.
|
|||||||
(currentStatus === null && statusIsLoading)) &&
|
(currentStatus === null && statusIsLoading)) &&
|
||||||
projectStatus?.status !== "FAILED");
|
projectStatus?.status !== "FAILED");
|
||||||
|
|
||||||
console.log("yes 5");
|
|
||||||
|
|
||||||
if (project.version !== ProjectVersion.V1) return null;
|
if (project.version !== ProjectVersion.V1) return null;
|
||||||
|
|
||||||
console.log("yes 6");
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
|
|||||||
Reference in New Issue
Block a user