From 0a6a56817760c2d47d9709c1b3f02dc40c8ed2a5 Mon Sep 17 00:00:00 2001 From: Pedro Figueiredo Date: Mon, 23 Sep 2024 11:20:08 +0100 Subject: [PATCH] Address review feedback --- ui/pages/confirmations/selectors/confirm.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/pages/confirmations/selectors/confirm.ts b/ui/pages/confirmations/selectors/confirm.ts index 2b9a3e22803b..ea479d03d2fb 100644 --- a/ui/pages/confirmations/selectors/confirm.ts +++ b/ui/pages/confirmations/selectors/confirm.ts @@ -1,6 +1,5 @@ import { ApprovalType } from '@metamask/controller-utils'; -import { createSelector } from 'reselect'; import { getPendingApprovals } from '../../../selectors/approvals'; import { ConfirmMetamaskState } from '../types/confirm'; import { createDeepEqualSelector } from '../../../selectors/util'; @@ -21,14 +20,14 @@ export function pendingConfirmationsSelector(state: ConfirmMetamaskState) { export function pendingConfirmationsSortedSelector( state: ConfirmMetamaskState, ) { - return getPendingApprovals(state) + return Object.values(state.metamask.pendingApprovals ?? {}) .filter(({ type }) => ConfirmationApprovalTypes.includes(type as ApprovalType), ) .sort((a1, a2) => a1.time - a2.time); } -export const oldestPendingConfirmationSelector = createSelector( +export const oldestPendingConfirmationSelector = createDeepEqualSelector( pendingConfirmationsSortedSelector, (pendingConfirmations) => pendingConfirmations[0], );