|
|
|
@ -15,7 +15,11 @@ import { |
|
|
|
|
getTokenValueParam, |
|
|
|
|
} from '../../helpers/utils/token-util'; |
|
|
|
|
import { useTokenTracker } from '../../hooks/useTokenTracker'; |
|
|
|
|
import { getTokens, getNativeCurrency } from '../../ducks/metamask/metamask'; |
|
|
|
|
import { |
|
|
|
|
getTokens, |
|
|
|
|
getNativeCurrency, |
|
|
|
|
isAddressLedger, |
|
|
|
|
} from '../../ducks/metamask/metamask'; |
|
|
|
|
import { |
|
|
|
|
transactionFeeSelector, |
|
|
|
|
txDataSelector, |
|
|
|
@ -24,7 +28,6 @@ import { |
|
|
|
|
getUseNonceField, |
|
|
|
|
getCustomNonceValue, |
|
|
|
|
getNextSuggestedNonce, |
|
|
|
|
doesAddressRequireLedgerHidConnection, |
|
|
|
|
} from '../../selectors'; |
|
|
|
|
|
|
|
|
|
import { useApproveTransaction } from '../../hooks/useApproveTransaction'; |
|
|
|
@ -36,10 +39,8 @@ import { isEqualCaseInsensitive } from '../../helpers/utils/util'; |
|
|
|
|
import { getCustomTxParamsData } from './confirm-approve.util'; |
|
|
|
|
import ConfirmApproveContent from './confirm-approve-content'; |
|
|
|
|
|
|
|
|
|
const doesAddressRequireLedgerHidConnectionByFromAddress = (address) => ( |
|
|
|
|
state, |
|
|
|
|
) => { |
|
|
|
|
return doesAddressRequireLedgerHidConnection(state, address); |
|
|
|
|
const isAddressLedgerByFromAddress = (address) => (state) => { |
|
|
|
|
return isAddressLedger(state, address); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default function ConfirmApprove() { |
|
|
|
@ -59,9 +60,7 @@ export default function ConfirmApprove() { |
|
|
|
|
const nextNonce = useSelector(getNextSuggestedNonce); |
|
|
|
|
const customNonceValue = useSelector(getCustomNonceValue); |
|
|
|
|
|
|
|
|
|
const ledgerWalletRequiredHidConnection = useSelector( |
|
|
|
|
doesAddressRequireLedgerHidConnectionByFromAddress(from), |
|
|
|
|
); |
|
|
|
|
const fromAddressIsLedger = useSelector(isAddressLedgerByFromAddress(from)); |
|
|
|
|
|
|
|
|
|
const transaction = |
|
|
|
|
currentNetworkTxList.find( |
|
|
|
@ -219,9 +218,7 @@ export default function ConfirmApprove() { |
|
|
|
|
} |
|
|
|
|
warning={submitWarning} |
|
|
|
|
txData={transaction} |
|
|
|
|
ledgerWalletRequiredHidConnection={ |
|
|
|
|
ledgerWalletRequiredHidConnection |
|
|
|
|
} |
|
|
|
|
fromAddressIsLedger={fromAddressIsLedger} |
|
|
|
|
/> |
|
|
|
|
{showCustomizeGasPopover && ( |
|
|
|
|
<EditGasPopover |
|
|
|
|