Skip to content

Commit

Permalink
Fix crash with certain permissions on the snap settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding committed Sep 12, 2022
1 parent 34e2faa commit dbfd1ac
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ui/pages/settings/flask/view-snap/view-snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ import {
removeSnap,
removePermissionsFor,
} from '../../../../store/actions';
import { getSnaps, getSubjectsWithPermission } from '../../../../selectors';
import {
getSnaps,
getSubjectsWithPermission,
getPermissions,
} from '../../../../selectors';
import { formatDate } from '../../../../helpers/utils/util';

function ViewSnap() {
Expand All @@ -50,6 +54,7 @@ function ViewSnap() {
const connectedSubjects = useSelector((state) =>
getSubjectsWithPermission(state, snap?.permissionName),
);
const permissions = useSelector((state) => getPermissions(state, snap?.id));
const dispatch = useDispatch();
const onDisconnect = (connectedOrigin, snapPermissionName) => {
dispatch(
Expand Down Expand Up @@ -137,9 +142,7 @@ function ViewSnap() {
{t('snapAccess', [snap.manifest.proposedName])}
</Typography>
<Box width={FRACTIONS.TEN_TWELFTHS}>
<PermissionsConnectPermissionList
permissions={snap.manifest.initialPermissions}
/>
<PermissionsConnectPermissionList permissions={permissions} />
</Box>
</div>
<div className="view-snap__section">
Expand Down

0 comments on commit dbfd1ac

Please sign in to comment.