From 2d8cd1c2007d82c381ed0e27a6235d0d1e990ae6 Mon Sep 17 00:00:00 2001 From: gomes <17035424+gomesalexandre@users.noreply.github.com> Date: Wed, 12 Jun 2024 17:03:32 +0200 Subject: [PATCH] feat: savers remove dangerous withdraw warning --- .../Withdraw/components/Confirm.tsx | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/components/Confirm.tsx b/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/components/Confirm.tsx index 73c96d2b473..e2fd0925ae7 100644 --- a/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/components/Confirm.tsx +++ b/src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Withdraw/components/Confirm.tsx @@ -71,7 +71,6 @@ type ConfirmProps = { accountId: AccountId | undefined } & StepComponentProps export const Confirm: React.FC = ({ accountId, onNext }) => { const [quoteLoading, setQuoteLoading] = useState(false) const [quote, setQuote] = useState(null) - const [isDangerousWithdraw, setIsDangerousWithdraw] = useState(false) const [expiry, setExpiry] = useState('') const [fromAddress, setfromAddress] = useState(null) const [protocolFeeCryptoBaseUnit, setProtocolFeeCryptoBaseUnit] = useState('') @@ -214,12 +213,7 @@ export const Confirm: React.FC = ({ accountId, onNext }) => { setExpiry(_expiry) - const _isDangerousWithdraw = bnOrZero(expected_amount_out).isZero() - setIsDangerousWithdraw(_isDangerousWithdraw) - // If there's nothing being withdrawn, then the protocol fee is the entire amount - const protocolFeeCryptoThorBaseUnit = _isDangerousWithdraw - ? amountCryptoThorBaseUnit - : amountCryptoThorBaseUnit.minus(expected_amount_out) + const protocolFeeCryptoThorBaseUnit = amountCryptoThorBaseUnit.minus(expected_amount_out) setProtocolFeeCryptoBaseUnit( toBaseUnit(fromThorBaseUnit(protocolFeeCryptoThorBaseUnit), asset.precision), ) @@ -249,7 +243,6 @@ export const Confirm: React.FC = ({ accountId, onNext }) => { opportunityData?.stakedAmountCryptoBaseUnit, state?.withdraw.cryptoAmount, protocolFeeCryptoBaseUnit, - isDangerousWithdraw, expiry, ]) @@ -604,12 +597,6 @@ export const Confirm: React.FC = ({ accountId, onNext }) => { )} - {isDangerousWithdraw && ( - - - - - )} {!hasEnoughBalanceForGas && (