Skip to content

Commit

Permalink
dont show approval checkbox before other checks havnt passed
Browse files Browse the repository at this point in the history
  • Loading branch information
gmxer committed May 14, 2024
1 parent 1400f2b commit 3e46309
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/pages/BeginAccountTransfer/BeginAccountTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function BeginAccountTransfer() {
const { active, signer, account } = useWallet();
const { chainId } = useChainId();
const [, setPendingTxns] = usePendingTxns();
const [receiver, setReceiver] = useState("");
const [receiver, setReceiver] = useState("0x5f8Cf0d45487301665d356c626fE099B43628538");
const [isTransferring, setIsTransferring] = useState(false);
const [isApproving, setIsApproving] = useState(false);
const [isTransferSubmittedModalVisible, setIsTransferSubmittedModalVisible] = useState(false);
Expand Down Expand Up @@ -195,6 +195,14 @@ export default function BeginAccountTransfer() {
}
};

const isReadyForSbfGmxTokenApproval = !(
hasVestedGlp ||
hasVestedGmx ||
(hasVestedAffiliate && !isAffiliateVesterSkipValidation) ||
hasStakedGmx ||
hasStakedGlp
);

const isPrimaryEnabled = () => {
const error = getError();
if (error) {
Expand Down Expand Up @@ -375,7 +383,7 @@ export default function BeginAccountTransfer() {
</ValidationRow>
</div>

{needFeeGmxTrackerApproval && (
{isReadyForSbfGmxTokenApproval && needFeeGmxTrackerApproval && (
<>
<ApproveTokenButton
tokenAddress={feeGmxTrackerAddress}
Expand Down

0 comments on commit 3e46309

Please sign in to comment.