Skip to content

Commit

Permalink
fix bug where chain permissions were not properly represented in the …
Browse files Browse the repository at this point in the history
…permission confirmation
  • Loading branch information
adonesky1 committed Oct 15, 2024
1 parent a770169 commit 85b6091
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ui/components/app/permission-cell/permission-cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const PermissionCell = ({
showOptions,
hideStatus,
accounts,
permissionValue,
chainIds,
}) => {
const infoIcon = IconName.Info;
let infoIconColor = IconColor.iconMuted;
Expand Down Expand Up @@ -71,7 +71,7 @@ const PermissionCell = ({
}

const networksInfo = useSelector((state) =>
getRequestingNetworkInfo(state, permissionValue),
getRequestingNetworkInfo(state, chainIds),
);

return (
Expand Down Expand Up @@ -171,7 +171,7 @@ PermissionCell.propTypes = {
showOptions: PropTypes.bool,
hideStatus: PropTypes.bool,
accounts: PropTypes.array,
permissionValue: PropTypes.array,
chainIds: PropTypes.array,
};

export default PermissionCell;
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import { Box } from '../../component-library';
* @returns {JSX.Element} A permission description node.
*/
function getDescriptionNode(permission, index, accounts) {
const chainIds = permission.permissionValue.caveats.find(
(caveat) => caveat.type === 'restrictNetworkSwitching',
)?.value;
return (
<PermissionCell
permissionName={permission.name}
Expand All @@ -26,7 +29,7 @@ function getDescriptionNode(permission, index, accounts) {
avatarIcon={permission.leftIcon}
key={`${permission.permissionName}-${index}`}
accounts={accounts}
permissionValue={permission.permissionValue.restrictNetworkSwitching}
chainIds={chainIds}
/>
);
}
Expand Down

0 comments on commit 85b6091

Please sign in to comment.