diff --git a/wallet/src/containers/modals/exit/steps/DoExitStep.js b/wallet/src/containers/modals/exit/steps/DoExitStep.js index 19b5e5268268..f33dea6171eb 100644 --- a/wallet/src/containers/modals/exit/steps/DoExitStep.js +++ b/wallet/src/containers/modals/exit/steps/DoExitStep.js @@ -27,12 +27,10 @@ import InputSelect from 'components/inputselect/InputSelect'; import Button from 'components/button/Button'; import { logAmount } from 'util/amountConvert'; - import networkService from 'services/networkService'; import * as styles from '../ExitModal.module.scss'; - function DoExitStep ({ handleClose, fast @@ -74,20 +72,31 @@ function DoExitStep ({ const submitLoading = useSelector(selectLoading([ 'EXIT/CREATE' ])); async function doExit () { + let res; - if (fast === false) { - res = await dispatch(exitOMGX(currency, value)); - } else { + + if (fast) { res = await dispatch(depositL2LP(currency, value)); + } else { + res = await dispatch(exitOMGX(currency, value)); } + + let currencyL1 = currencySymbols[currency]; + + //person will receive ETH on the L1, not oETH + if(currencyL1 === 'oETH') { + currencyL1 = 'ETH' + } + if (res) { - if (fast === false) { - dispatch(openAlert(`${currencySymbols[currency]} was exited to L1`)); + if (fast) { + dispatch(openAlert(`${currencySymbols[currency]} was deposited into the L2 liquidity pool. You will receive ${(Number(value) * 0.97).toFixed(2)} ${currencyL1} on L1.`)); } else { - dispatch(openAlert(`${currencySymbols[currency]} was deposited to liquidity pool. You will receive ${(Number(value) * 0.97).toFixed(2)} ${currencySymbols[currency]} on L1`)); + dispatch(openAlert(`${currencySymbols[currency]} was exited to L1. You will receive ${Number(value).toFixed(2)} ${currencyL1} on L1.`)); } handleClose(); } + } function getMaxTransferValue () { @@ -101,7 +110,13 @@ function DoExitStep ({ return ( <> -

Start Standard Exit

+ + {fast && +

Start Fast (Swap-off) Exit

+ } + {!fast && +

Start Standard Exit

+ } - {fast && currency ? ( - <> -

- The L1 liquidity pool has {LPBalance} {currencySymbols[currency]}. -

-

- The convenience fee is {feeRate}%. {value && `You are going to receive ${(Number(value) * 0.97).toFixed(2)} ${currencySymbols[currency]} on L1.`} -

- - ):<>} + {fast && currencySymbols[currency] === 'oETH' && +

+ The L1 liquidity pool has {LPBalance} ETH. + The liquidity fee is {feeRate}%. {value && `You will receive ${(Number(value) * 0.97).toFixed(2)} ETH on L1.`} +

+ } + + {fast && currencySymbols[currency] != 'oETH' && +

+ The L1 liquidity pool has {LPBalance} {currencySymbols[currency]}. + The liquidity fee is {feeRate}%. {value && `You will receive ${(Number(value) * 0.97).toFixed(2)} ${currencySymbols[currency]} on L1.`} +

+ } + + {!fast && currencySymbols[currency] === 'oETH' && +

+ {value && `You will receive ${Number(value).toFixed(2)} ETH on L1. Your funds will be available on L1 in 7 days.`} +

+ } + + {!fast && currencySymbols[currency] != 'oETH' && +

+ {value && `You will receive ${Number(value).toFixed(2)} ${currencySymbols[currency]} on L1. Your funds will be available on L1 in 7 days.`} +

+ }