1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

fix: use approvals selector fn in permission selectors (#19095)

This commit is contained in:
OGPoyraz 2023-05-11 16:40:51 +02:00 committed by GitHub
parent 37a2be0fbb
commit d859181029
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,9 @@
import { ApprovalType } from '@metamask/controller-utils';
///: BEGIN:ONLY_INCLUDE_IN(snaps)
import { WALLET_SNAP_PERMISSION_KEY } from '@metamask/rpc-methods';
///: END:ONLY_INCLUDE_IN
import { CaveatTypes } from '../../shared/constants/permissions';
import { getApprovalRequestsByType } from './approvals';
import {
getMetaMaskAccountsOrdered,
getOriginOfCurrentTab,
@ -341,9 +343,10 @@ export function getFirstSnapInstallOrUpdateRequest(state) {
///: END:ONLY_INCLUDE_IN
export function getPermissionsRequests(state) {
return Object.values(state.metamask.pendingApprovals)
.filter(({ type }) => type === 'wallet_requestPermissions')
.map(({ requestData }) => requestData);
return getApprovalRequestsByType(
state,
ApprovalType.WalletRequestPermissions,
).map(({ requestData }) => requestData);
}
export function getFirstPermissionRequest(state) {