Skip to content

Commit

Permalink
[FLASK] 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 authored Sep 12, 2022
1 parent 45916b9 commit 398b93c
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 398b93c

Please sign in to comment.