fix: don't format wrap input amount (#7592)
* fix: don't format wrap input amount * lint
This commit is contained in:
parent
79e74e1d13
commit
0aa5727cdd
@ -31,7 +31,6 @@ import { ThemedText } from 'theme/components'
|
||||
import invariant from 'tiny-invariant'
|
||||
import { isL2ChainId } from 'utils/chains'
|
||||
import { SignatureExpiredError } from 'utils/errors'
|
||||
import { NumberType, useFormatter } from 'utils/formatNumbers'
|
||||
import { formatSwapPriceUpdatedEventProperties } from 'utils/loggingFormatters'
|
||||
import { didUserReject } from 'utils/swapErrorToUserReadableMessage'
|
||||
import { tradeMeaningfullyDiffers } from 'utils/tradeMeaningFullyDiffer'
|
||||
@ -82,7 +81,6 @@ function useConfirmModalState({
|
||||
const [confirmModalState, setConfirmModalState] = useState<ConfirmModalState>(ConfirmModalState.REVIEWING)
|
||||
const [approvalError, setApprovalError] = useState<PendingModalError>()
|
||||
const [pendingModalSteps, setPendingModalSteps] = useState<PendingConfirmModalState[]>([])
|
||||
const { formatCurrencyAmount } = useFormatter()
|
||||
|
||||
// This is a function instead of a memoized value because we do _not_ want it to update as the allowance changes.
|
||||
// For example, if the user needs to complete 3 steps initially, we should always show 3 step indicators
|
||||
@ -117,14 +115,7 @@ function useConfirmModalState({
|
||||
const nativeCurrency = useNativeCurrency(chainId)
|
||||
|
||||
const [wrapTxHash, setWrapTxHash] = useState<string>()
|
||||
const { execute: onWrap } = useWrapCallback(
|
||||
nativeCurrency,
|
||||
trade.inputAmount.currency,
|
||||
formatCurrencyAmount({
|
||||
amount: trade.inputAmount,
|
||||
type: NumberType.SwapTradeAmount,
|
||||
})
|
||||
)
|
||||
const { execute: onWrap } = useWrapCallback(nativeCurrency, trade.inputAmount.currency, trade.inputAmount.toExact())
|
||||
const wrapConfirmed = useIsTransactionConfirmed(wrapTxHash)
|
||||
const prevWrapConfirmed = usePrevious(wrapConfirmed)
|
||||
const catchUserReject = async (e: any, errorType: PendingModalError) => {
|
||||
|
Loading…
Reference in New Issue
Block a user