mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
ConfirmTxPage: rm redundant unapprovedTxs const (#19275)
* fix typo: uncofirmedTransactions -> unconfirmedTransactions * txHelper: reorganize lines and improve test * ConfirmTx: rn unconfirmedTxs->unconfirmedTxsSorted * ConfirmTx: rn unconfirmedMessages-> unconfirmedTxs * ConfirmTxPage: rm redundant unapprovedTxs const * lint: rm unused getUnapprovedTransactions
This commit is contained in:
parent
ee9f7949f9
commit
d5dd4fa881
@ -31,7 +31,6 @@ import {
|
||||
import { isTokenMethodAction } from '../../helpers/utils/transactions.util';
|
||||
import { usePrevious } from '../../hooks/usePrevious';
|
||||
import {
|
||||
getUnapprovedTransactions,
|
||||
unconfirmedTransactionsListSelector,
|
||||
unconfirmedTransactionsHashSelector,
|
||||
} from '../../selectors';
|
||||
@ -56,21 +55,18 @@ const ConfirmTransaction = () => {
|
||||
|
||||
const mostRecentOverviewPage = useSelector(getMostRecentOverviewPage);
|
||||
const sendTo = useSelector(getSendTo);
|
||||
const unapprovedTxs = useSelector(getUnapprovedTransactions);
|
||||
|
||||
const unconfirmedTxsSorted = useSelector(unconfirmedTransactionsListSelector);
|
||||
const unconfirmedTxs = useSelector(unconfirmedTransactionsHashSelector);
|
||||
|
||||
const totalUnapproved = unconfirmedTxsSorted.length || 0;
|
||||
const getTransaction = useCallback(() => {
|
||||
return totalUnapproved
|
||||
? unapprovedTxs[paramsTransactionId] ||
|
||||
unconfirmedTxs[paramsTransactionId] ||
|
||||
unconfirmedTxsSorted[0]
|
||||
? unconfirmedTxs[paramsTransactionId] || unconfirmedTxsSorted[0]
|
||||
: {};
|
||||
}, [
|
||||
paramsTransactionId,
|
||||
totalUnapproved,
|
||||
unapprovedTxs,
|
||||
unconfirmedTxs,
|
||||
unconfirmedTxsSorted,
|
||||
]);
|
||||
@ -87,7 +83,6 @@ const ConfirmTransaction = () => {
|
||||
getTransaction,
|
||||
paramsTransactionId,
|
||||
totalUnapproved,
|
||||
unapprovedTxs,
|
||||
unconfirmedTxs,
|
||||
unconfirmedTxsSorted,
|
||||
]);
|
||||
|
Loading…
Reference in New Issue
Block a user