Skip to content

Commit

Permalink
[7.x] [APM] Delay rendering invalid license notification (#539… (#54646)
Browse files Browse the repository at this point in the history
* [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
  • Loading branch information
dgieselaar authored Jan 14, 2020
1 parent 388303b commit 05fc86a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 05fc86a

Please sign in to comment.