[APM]: Fix render error when license has not been loaded (#54718)
This commit is contained in:
parent
46b34db465
commit
8d57df0fe6
|
@ -16,8 +16,9 @@ export const LicenseContext = React.createContext<ILicense | undefined>(
|
|||
|
||||
export function LicenseProvider({ children }: { children: React.ReactChild }) {
|
||||
const { license$ } = useApmPluginContext().plugins.licensing;
|
||||
const license = useObservable(license$, { isActive: true } as ILicense);
|
||||
const hasInvalidLicense = !license.isActive;
|
||||
const license = useObservable(license$);
|
||||
// if license is not loaded yet, consider it valid
|
||||
const hasInvalidLicense = license?.isActive === false;
|
||||
|
||||
// if license is invalid show an error message
|
||||
if (hasInvalidLicense) {
|
||||
|
|
Loading…
Reference in a new issue