From 9505d3f529b6df68a07c1be1ec8de715d2259b98 Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Thu, 9 Jan 2020 22:23:26 +0100 Subject: [PATCH] Show UI if license has not loaded --- .../plugins/apm/public/context/LicenseContext/index.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 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 b366c3d916fcd..0bd3896782603 100644 --- a/x-pack/legacy/plugins/apm/public/context/LicenseContext/index.tsx +++ b/x-pack/legacy/plugins/apm/public/context/LicenseContext/index.tsx @@ -16,12 +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; - - if (!license) { - return null; - } + const license = useObservable(license$, { isActive: true } as ILicense); + const hasInvalidLicense = !license.isActive; // if license is invalid show an error message if (hasInvalidLicense) {