Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronfigueiredo committed Sep 24, 2024
1 parent 3eee470 commit 8e9da4f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ui/pages/confirmations/selectors/confirm.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
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';
import { getPreferences } from '../../../selectors/selectors';
import { createDeepEqualSelector } from '../../../selectors/util';
import { ConfirmMetamaskState } from '../types/confirm';

const ConfirmationApprovalTypes = [
ApprovalType.PersonalSign,
Expand All @@ -27,11 +28,16 @@ export function pendingConfirmationsSortedSelector(
.sort((a1, a2) => a1.time - a2.time);
}

export const oldestPendingConfirmationSelector = createDeepEqualSelector(
const firstPendingConfirmationSelector = createSelector(
pendingConfirmationsSortedSelector,
(pendingConfirmations) => pendingConfirmations[0],
);

export const oldestPendingConfirmationSelector = createDeepEqualSelector(
firstPendingConfirmationSelector,
(firstPendingConfirmation) => firstPendingConfirmation,
);

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function getIsRedesignedConfirmationsDeveloperEnabled(state: any) {
return getPreferences(state).isRedesignedConfirmationsDeveloperEnabled;
Expand Down

0 comments on commit 8e9da4f

Please sign in to comment.