Skip to content

Commit

Permalink
[7.x] [APM]: Fix render error when license has not been loaded… (elas…
Browse files Browse the repository at this point in the history
  • Loading branch information
dgieselaar authored Jan 14, 2020
1 parent 17135a6 commit 51dccb9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 51dccb9

Please sign in to comment.