Skip to content

Commit

Permalink
ConfirmTxPage: rm redundant unapprovedTxs const (#19275)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
digiwand authored Jun 1, 2023
1 parent ee9f794 commit d5dd4fa
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions ui/pages/confirm-transaction/confirm-transaction.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
import { isTokenMethodAction } from '../../helpers/utils/transactions.util';
import { usePrevious } from '../../hooks/usePrevious';
import {
getUnapprovedTransactions,
unconfirmedTransactionsListSelector,
unconfirmedTransactionsHashSelector,
} from '../../selectors';
Expand All @@ -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,
]);
Expand All @@ -87,7 +83,6 @@ const ConfirmTransaction = () => {
getTransaction,
paramsTransactionId,
totalUnapproved,
unapprovedTxs,
unconfirmedTxs,
unconfirmedTxsSorted,
]);
Expand Down

0 comments on commit d5dd4fa

Please sign in to comment.