From 398b93cf51982786746266589ac58b83a8a9289a Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Mon, 12 Sep 2022 18:36:40 +0200 Subject: [PATCH] [FLASK] Fix crash with certain permissions on the snap settings page (#15797) --- ui/pages/settings/flask/view-snap/view-snap.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/pages/settings/flask/view-snap/view-snap.js b/ui/pages/settings/flask/view-snap/view-snap.js index 0fa9964c16c4..cff1a34cdc4d 100644 --- a/ui/pages/settings/flask/view-snap/view-snap.js +++ b/ui/pages/settings/flask/view-snap/view-snap.js @@ -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() { @@ -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( @@ -137,9 +142,7 @@ function ViewSnap() { {t('snapAccess', [snap.manifest.proposedName])} - +