mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 04:20:53 +01:00
[FLASK] Fix crash with certain permissions on the snap settings page (#15797)
This commit is contained in:
parent
0eded43d4a
commit
b16606156f
@ -24,7 +24,11 @@ import {
|
|||||||
removeSnap,
|
removeSnap,
|
||||||
removePermissionsFor,
|
removePermissionsFor,
|
||||||
} from '../../../../store/actions';
|
} from '../../../../store/actions';
|
||||||
import { getSnaps, getSubjectsWithPermission } from '../../../../selectors';
|
import {
|
||||||
|
getSnaps,
|
||||||
|
getSubjectsWithPermission,
|
||||||
|
getPermissions,
|
||||||
|
} from '../../../../selectors';
|
||||||
import { formatDate } from '../../../../helpers/utils/util';
|
import { formatDate } from '../../../../helpers/utils/util';
|
||||||
|
|
||||||
function ViewSnap() {
|
function ViewSnap() {
|
||||||
@ -50,6 +54,7 @@ function ViewSnap() {
|
|||||||
const connectedSubjects = useSelector((state) =>
|
const connectedSubjects = useSelector((state) =>
|
||||||
getSubjectsWithPermission(state, snap?.permissionName),
|
getSubjectsWithPermission(state, snap?.permissionName),
|
||||||
);
|
);
|
||||||
|
const permissions = useSelector((state) => getPermissions(state, snap?.id));
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const onDisconnect = (connectedOrigin, snapPermissionName) => {
|
const onDisconnect = (connectedOrigin, snapPermissionName) => {
|
||||||
dispatch(
|
dispatch(
|
||||||
@ -137,9 +142,7 @@ function ViewSnap() {
|
|||||||
{t('snapAccess', [snap.manifest.proposedName])}
|
{t('snapAccess', [snap.manifest.proposedName])}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Box width={FRACTIONS.TEN_TWELFTHS}>
|
<Box width={FRACTIONS.TEN_TWELFTHS}>
|
||||||
<PermissionsConnectPermissionList
|
<PermissionsConnectPermissionList permissions={permissions} />
|
||||||
permissions={snap.manifest.initialPermissions}
|
|
||||||
/>
|
|
||||||
</Box>
|
</Box>
|
||||||
</div>
|
</div>
|
||||||
<div className="view-snap__section">
|
<div className="view-snap__section">
|
||||||
|
Loading…
Reference in New Issue
Block a user