Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/cluster/estimated-operational-runway-alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type EstimatedOperationalRunwayAlertProps = {
isAtRisk: boolean;
isLiquidated: boolean;
runway: bigint;
isMigrated?: boolean;
};

type EstimatedOperationalRunwayAlertFC = FC<
Expand All @@ -27,10 +28,10 @@ export const EstimatedOperationalRunwayAlert: EstimatedOperationalRunwayAlertFC
hasDeltaValidators,
isLiquidated,
runway,
isMigrated = true,
...props
}) => {
const isWithdrawingAll = isWithdrawing && runway <= 0n;

if (!isAtRisk) return null;

const renderMessage = () => {
Expand All @@ -44,6 +45,14 @@ export const EstimatedOperationalRunwayAlert: EstimatedOperationalRunwayAlertFC
);
}
if (isLiquidated) {
if (!isMigrated) {
return (
<p>
Your cluster has been liquidated. Switch your cluster to ETH to
reactivate and resume operations.
</p>
);
}
return (
<p>
Your cluster has been liquidated. Please reactivate your cluster in
Expand Down
3 changes: 2 additions & 1 deletion src/components/cluster/estimated-operational-runway.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const EstimatedOperationalRunway: EstimatedOperationalRunwayFC = ({
const params = useClusterPageParams();
const hash = clusterHash || params.clusterHash;

const { isLiquidated } = useClusterState(hash!, { watch: true });
const { isLiquidated, cluster } = useClusterState(hash!, { watch: true });

const { data: clusterRunway } = useClusterRunway(hash!, {
deltaBalance,
Expand Down Expand Up @@ -87,6 +87,7 @@ export const EstimatedOperationalRunway: EstimatedOperationalRunwayFC = ({
isWithdrawing={
clusterRunway?.isDecreasing && deltaEffectiveBalance === 0n
}
isMigrated={cluster.data?.migrated ?? false}
/>
)}
</div>
Expand Down