mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
[FLASK] Fix an issue with updating snaps that have caveat permissions (#16473)
This commit is contained in:
parent
b2e621b5f9
commit
8f30e03613
@ -14,15 +14,17 @@ export default function UpdateSnapPermissionList({
|
|||||||
const t = useI18nContext();
|
const t = useI18nContext();
|
||||||
|
|
||||||
const ApprovedPermissions = () => {
|
const ApprovedPermissions = () => {
|
||||||
return Object.keys(approvedPermissions).map((approvedPermission) => {
|
return Object.entries(approvedPermissions).map(
|
||||||
|
([permissionName, permissionValue]) => {
|
||||||
const { label, rightIcon } = getPermissionDescription(
|
const { label, rightIcon } = getPermissionDescription(
|
||||||
t,
|
t,
|
||||||
approvedPermission,
|
permissionName,
|
||||||
|
permissionValue,
|
||||||
);
|
);
|
||||||
const { date } = approvedPermissions[approvedPermission];
|
const { date } = permissionValue;
|
||||||
const formattedDate = formatDate(date, 'yyyy-MM-dd');
|
const formattedDate = formatDate(date, 'yyyy-MM-dd');
|
||||||
return (
|
return (
|
||||||
<div className="approved-permission" key={approvedPermission}>
|
<div className="approved-permission" key={permissionName}>
|
||||||
<i className="fas fa-check" />
|
<i className="fas fa-check" />
|
||||||
<div className="permission-description">
|
<div className="permission-description">
|
||||||
{label}
|
{label}
|
||||||
@ -37,17 +39,20 @@ export default function UpdateSnapPermissionList({
|
|||||||
{rightIcon && <i className={rightIcon} />}
|
{rightIcon && <i className={rightIcon} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const RevokedPermissions = () => {
|
const RevokedPermissions = () => {
|
||||||
return Object.keys(revokedPermissions).map((revokedPermission) => {
|
return Object.entries(revokedPermissions).map(
|
||||||
|
([permissionName, permissionValue]) => {
|
||||||
const { label, rightIcon } = getPermissionDescription(
|
const { label, rightIcon } = getPermissionDescription(
|
||||||
t,
|
t,
|
||||||
revokedPermission,
|
permissionName,
|
||||||
|
permissionValue,
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<div className="revoked-permission" key={revokedPermission}>
|
<div className="revoked-permission" key={permissionName}>
|
||||||
<i className="fas fa-x" />
|
<i className="fas fa-x" />
|
||||||
<div className="permission-description">
|
<div className="permission-description">
|
||||||
{label}
|
{label}
|
||||||
@ -62,14 +67,20 @@ export default function UpdateSnapPermissionList({
|
|||||||
{rightIcon && <i className={rightIcon} />}
|
{rightIcon && <i className={rightIcon} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const NewPermissions = () => {
|
const NewPermissions = () => {
|
||||||
return Object.keys(newPermissions).map((newPermission) => {
|
return Object.entries(newPermissions).map(
|
||||||
const { label, rightIcon } = getPermissionDescription(t, newPermission);
|
([permissionName, permissionValue]) => {
|
||||||
|
const { label, rightIcon } = getPermissionDescription(
|
||||||
|
t,
|
||||||
|
permissionName,
|
||||||
|
permissionValue,
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<div className="new-permission" key={newPermission}>
|
<div className="new-permission" key={permissionName}>
|
||||||
<i className="fas fa-arrow-right" />
|
<i className="fas fa-arrow-right" />
|
||||||
<div className="permission-description">
|
<div className="permission-description">
|
||||||
{label}
|
{label}
|
||||||
@ -84,7 +95,8 @@ export default function UpdateSnapPermissionList({
|
|||||||
{rightIcon && <i className={rightIcon} />}
|
{rightIcon && <i className={rightIcon} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user