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