From 8d85de31ff96b15edd5fc3865a1268dcae0d1072 Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Fri, 10 Jan 2020 22:07:55 +0100 Subject: [PATCH] [APM] Delay rendering invalid license notification (#53924) * [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 --- .../plugins/apm/public/context/LicenseContext/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/apm/public/context/LicenseContext/index.tsx b/x-pack/legacy/plugins/apm/public/context/LicenseContext/index.tsx index 6228205ad6029..c2c2b0732d4ac 100644 --- a/x-pack/legacy/plugins/apm/public/context/LicenseContext/index.tsx +++ b/x-pack/legacy/plugins/apm/public/context/LicenseContext/index.tsx @@ -16,8 +16,8 @@ export const LicenseContext = React.createContext( 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) {