Don't fetch service map data if no license (#62071) (#62717)

Fixes #61994
This commit is contained in:
Nathan L Smith 2020-04-06 19:35:43 -05:00 committed by GitHub
parent eaeac31b12
commit 0fbf560981
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,12 @@ export function ServiceMap({ serviceName }: ServiceMapProps) {
const license = useLicense();
const { urlParams } = useUrlParams();
const { data } = useFetcher(() => {
const { data = { elements: [] } } = useFetcher(() => {
// When we don't have a license or a valid license, don't make the request.
if (!license || !isValidPlatinumLicense(license)) {
return;
}
const { start, end, environment } = urlParams;
if (start && end) {
return callApmApi({
@ -48,7 +53,7 @@ export function ServiceMap({ serviceName }: ServiceMapProps) {
}
});
}
}, [serviceName, urlParams]);
}, [license, serviceName, urlParams]);
const { ref, height, width } = useRefDimensions();