Skip to content

Commit

Permalink
Show UI if license has not loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
dgieselaar committed Jan 9, 2020
1 parent 8d6fb09 commit 9505d3f
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +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;

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) {
Expand Down

0 comments on commit 9505d3f

Please sign in to comment.