[7.x] [APM] Delay rendering invalid license notification (#539… (#54646)

* [APM] Delay rendering invalid license notification

Don't render an invalid license notification if the license information has not been loaded. (Don't render any UI either).

* Show UI if license has not loaded
This commit is contained in:
Dario Gieselaar 2020-01-14 09:36:56 +01:00 committed by GitHub
parent 388303bc34
commit 05fc86a8b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,8 +16,8 @@ export const LicenseContext = React.createContext<ILicense | undefined>(
export function LicenseProvider({ children }: { children: React.ReactChild }) {
const { license$ } = useApmPluginContext().plugins.licensing;
const license = useObservable(license$);
const hasInvalidLicense = !license?.isActive;
const license = useObservable(license$, { isActive: true } as ILicense);
const hasInvalidLicense = !license.isActive;
// if license is invalid show an error message
if (hasInvalidLicense) {