From 34313380269718821aa88cfd9f36976ff9f5e252 Mon Sep 17 00:00:00 2001 From: Onokaev Date: Thu, 6 Oct 2022 14:25:14 +0300 Subject: [PATCH] fix crashing on permissions panel --- src/app/views/authentication/profile/Profile.tsx | 2 +- .../views/query-runner/request/permissions/Permission.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/views/authentication/profile/Profile.tsx b/src/app/views/authentication/profile/Profile.tsx index 60bafbe91..a826ee5ee 100644 --- a/src/app/views/authentication/profile/Profile.tsx +++ b/src/app/views/authentication/profile/Profile.tsx @@ -175,7 +175,7 @@ const Profile = (props: any) => { return (
{showProfileComponent(persona)} - {permissionsPanelOpen && } + {permissionsPanelOpen && }
); } diff --git a/src/app/views/query-runner/request/permissions/Permission.tsx b/src/app/views/query-runner/request/permissions/Permission.tsx index 21e935398..dd452a24a 100644 --- a/src/app/views/query-runner/request/permissions/Permission.tsx +++ b/src/app/views/query-runner/request/permissions/Permission.tsx @@ -27,12 +27,12 @@ import messages from '../../../../../messages'; export const Permission = ( permissionProps?: IPermissionProps ) : JSX.Element => { - const { sampleQuery, scopes, dimensions, authToken, permissionsPanelOpen } = + const { sampleQuery, scopes, dimensions, authToken } = useSelector( (state: IRootState) => state ); const { pending: loading } = scopes; const tokenPresent = !!authToken.token; const dispatch = useDispatch(); - const panel = permissionsPanelOpen + const panel = permissionProps?.panel; const classProps = { styles: permissionProps!.styles, @@ -240,7 +240,7 @@ export const Permission = ( permissionProps?: IPermissionProps ) : JSX.Element = return( <> - {permissionsPanelOpen ? displayPermissionsPanel() : displayPermissionsAsTab()} + {panel ? displayPermissionsPanel() : displayPermissionsAsTab()} ); } \ No newline at end of file