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:
parent
37a2be0fbb
commit
d859181029
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user