|
|
|
@ -2,6 +2,7 @@ import React, { useContext, useEffect, useState } from 'react'; |
|
|
|
|
import { useDispatch, useSelector, shallowEqual } from 'react-redux'; |
|
|
|
|
import { useHistory } from 'react-router-dom'; |
|
|
|
|
import { getBlockExplorerLink } from '@metamask/etherscan-link'; |
|
|
|
|
import { isEqual } from 'lodash'; |
|
|
|
|
|
|
|
|
|
import { I18nContext } from '../../../contexts/i18n'; |
|
|
|
|
import { |
|
|
|
@ -71,22 +72,25 @@ export default function SmartTransactionStatus() { |
|
|
|
|
const t = useContext(I18nContext); |
|
|
|
|
const history = useHistory(); |
|
|
|
|
const dispatch = useDispatch(); |
|
|
|
|
const fetchParams = useSelector(getFetchParams) || {}; |
|
|
|
|
const fetchParams = useSelector(getFetchParams, isEqual) || {}; |
|
|
|
|
const { destinationTokenInfo = {}, sourceTokenInfo = {} } = |
|
|
|
|
fetchParams?.metaData || {}; |
|
|
|
|
const hardwareWalletUsed = useSelector(isHardwareWallet); |
|
|
|
|
const hardwareWalletType = useSelector(getHardwareWalletType); |
|
|
|
|
const needsTwoConfirmations = true; |
|
|
|
|
const selectedQuote = useSelector(getSelectedQuote); |
|
|
|
|
const topQuote = useSelector(getTopQuote); |
|
|
|
|
const selectedQuote = useSelector(getSelectedQuote, isEqual); |
|
|
|
|
const topQuote = useSelector(getTopQuote, isEqual); |
|
|
|
|
const usedQuote = selectedQuote || topQuote; |
|
|
|
|
const currentSmartTransactions = useSelector(getCurrentSmartTransactions); |
|
|
|
|
const currentSmartTransactions = useSelector( |
|
|
|
|
getCurrentSmartTransactions, |
|
|
|
|
isEqual, |
|
|
|
|
); |
|
|
|
|
const smartTransactionsOptInStatus = useSelector( |
|
|
|
|
getSmartTransactionsOptInStatus, |
|
|
|
|
); |
|
|
|
|
const chainId = useSelector(getCurrentChainId); |
|
|
|
|
const rpcPrefs = useSelector(getRpcPrefsForCurrentProvider, shallowEqual); |
|
|
|
|
const swapsNetworkConfig = useSelector(getSwapsNetworkConfig); |
|
|
|
|
const swapsNetworkConfig = useSelector(getSwapsNetworkConfig, shallowEqual); |
|
|
|
|
const smartTransactionsEnabled = useSelector(getSmartTransactionsEnabled); |
|
|
|
|
const currentSmartTransactionsEnabled = useSelector( |
|
|
|
|
getCurrentSmartTransactionsEnabled, |
|
|
|
|