Skip to content

Commit

Permalink
fix: renaming from canUnstake to unlocked
Browse files Browse the repository at this point in the history
  • Loading branch information
PudgyPug committed Dec 2, 2024
1 parent 7d28915 commit 5ad30e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/molecules/RewardsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const RewardsCard = () => {
chain?.id === CHAIN_ID &&
nodeStatus?.state === "stopped" &&
parseFloat(nodeStatus?.lockedStake || "0") > 0 &&
nodeStatus?.stakeState?.canUnstake
nodeStatus?.stakeState?.unlocked
);
useEffect(() => {
setCanRedeem(
Expand Down
7 changes: 4 additions & 3 deletions components/molecules/StakeDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const StakeDisplay = () => {

const isRemoveButtonDisabled = !hasStakeOnDifferentNode && (
!hasNodeStopped ||
!nodeStatus?.stakeState) ||
!nodeStatus?.stakeState ||
!nodeStatus?.stakeState.unlocked) ||
stakeForConnectedAddressOrNode === 0;

return (
Expand Down Expand Up @@ -96,7 +97,7 @@ export const StakeDisplay = () => {
className={`
bg-white border border-bodyFg text-sm px-3 py-2 rounded basis-0 grow
${!isRemoveButtonDisabled
? nodeStatus?.stakeState?.canUnstake
? nodeStatus?.stakeState?.unlocked
? "text-primary"
: "text-yellow-500"
: "text-gray-400"
Expand All @@ -105,7 +106,7 @@ export const StakeDisplay = () => {
`}
data-tip={(
hasNodeStopped &&
nodeStatus?.stakeState?.canUnstake === false &&
nodeStatus?.stakeState?.unlocked === false &&
nodeStatus?.stakeState?.remainingTime > 0)
? `Node is currently stopped and is being removed from the active validator list. Please wait for another ${formatRemainingTime(nodeStatus.stakeState.remainingTime)} before you can remove your stake.`
: "It is not recommended to unstake while validating. If absolutely necessary, use the force remove option in settings to remove stake (Not Recommended)."
Expand Down
2 changes: 1 addition & 1 deletion model/node-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface NodeStatus {
lastActive: string;
lockedStake: string;
stakeState: {
canUnstake: boolean;
unlocked: boolean;
reason: string,
remainingTime: number,
};
Expand Down

0 comments on commit 5ad30e2

Please sign in to comment.