Skip to content

Commit

Permalink
Don't fetch service map data if no license (#62071)
Browse files Browse the repository at this point in the history
Fixes #61994
  • Loading branch information
smith authored Apr 1, 2020
1 parent c98c225 commit 433d06f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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({
Expand All @@ -48,7 +53,7 @@ export function ServiceMap({ serviceName }: ServiceMapProps) {
}
});
}
}, [serviceName, urlParams]);
}, [license, serviceName, urlParams]);

const { ref, height, width } = useRefDimensions();

Expand Down

0 comments on commit 433d06f

Please sign in to comment.