diff --git a/grafana-plugin/src/GrafanaPluginRootPage.tsx b/grafana-plugin/src/GrafanaPluginRootPage.tsx index 1115e2e5..870c1cae 100644 --- a/grafana-plugin/src/GrafanaPluginRootPage.tsx +++ b/grafana-plugin/src/GrafanaPluginRootPage.tsx @@ -91,6 +91,7 @@ export const Root = observer((props: AppRootProps) => { const pathWithoutLeadingSlash = path.replace(/^\//, ''); const store = useStore(); + const { backendLicense } = store; useEffect(() => { store.updateBasicData(); @@ -120,11 +121,13 @@ export const Root = observer((props: AppRootProps) => { grafanaUser: window.grafanaBootData.user, enableLiveSettings: store.hasFeature(AppFeature.LiveSettings), enableCloudPage: store.hasFeature(AppFeature.CloudConnection), + backendLicense, }), [meta, pathWithoutLeadingSlash, page, store.features] ) ); useEffect(() => { + /* @ts-ignore */ onNavChanged(navModel); }, [navModel, onNavChanged]); diff --git a/grafana-plugin/src/components/NavBar/NavBarSubtitle.tsx b/grafana-plugin/src/components/NavBar/NavBarSubtitle.tsx index 083ecd3b..e9fe292e 100644 --- a/grafana-plugin/src/components/NavBar/NavBarSubtitle.tsx +++ b/grafana-plugin/src/components/NavBar/NavBarSubtitle.tsx @@ -4,29 +4,27 @@ import { Card } from '@grafana/ui'; import cn from 'classnames/bind'; import gitHubStarSVG from 'assets/img/github_star.svg'; -import { useStore } from 'state/useStore'; import { APP_SUBTITLE, GRAFANA_LICENSE_OSS } from 'utils/consts'; import styles from './NavBarSubtitle.module.css'; const cx = cn.bind(styles); -function NavBarSubtitle() { - const store = useStore(); - if (store.backendLicense === GRAFANA_LICENSE_OSS) { - return APP_SUBTITLE; +function NavBarSubtitle({ backendLicense }: { backendLicense: string }) { + if (backendLicense === GRAFANA_LICENSE_OSS) { + return ( +