From 990b7086323912990684c5395d220c2617744798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Wed, 7 Dec 2022 10:23:19 +0000 Subject: [PATCH] fix: isPro check on change request configuration (#2610) https://linear.app/unleash/issue/2-487/bug-change-request-badge-is-not-working-on-pro Using the new `isPro()` from `useUiConfig()` seems to fix this in Pro, correctly showing the premium feature info: ![image](https://user-images.githubusercontent.com/14320932/205958034-f412471a-c732-425a-bb14-64b62ea1e665.png) The errors described in the issue should be fixed by the new `useEnterpriseSWR`. See: https://unleash-internal.slack.com/archives/C046LV6HH6W/p1670337216187539?thread_ts=1670331887.521059&cid=C046LV6HH6W --- .../ChangeRequestConfiguration.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx index 7396885461..b8a6663e3d 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx @@ -23,14 +23,11 @@ export const ChangeRequestConfiguration = () => { const projectId = useRequiredPathParam('projectId'); const projectName = useProjectNameOrId(projectId); const { hasAccess } = useContext(AccessContext); - const { isOss, uiConfig } = useUiConfig(); - const isPro = !( - Boolean(uiConfig.versionInfo?.current.oss) || - Boolean(uiConfig.versionInfo?.current.enterprise) - ); + const { isOss, isPro } = useUiConfig(); + usePageTitle(`Project change request – ${projectName}`); - if (isOss() || isPro) { + if (isOss() || isPro()) { return ( }