Skip to content

Commit

Permalink
[APM] Delay rendering invalid license notification (#53924)
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 committed Jan 13, 2020
1 parent 58f5a45 commit 8d85de3
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 8d85de3

Please sign in to comment.