From 2bc11d2e6396cb08bd1892463134cfc26e614632 Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Wed, 6 Dec 2023 12:47:58 -0300 Subject: [PATCH] fix(site): fetch health data only if has permissions (#11062) --- .../Dashboard/DeploymentBanner/DeploymentBanner.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/src/components/Dashboard/DeploymentBanner/DeploymentBanner.tsx b/site/src/components/Dashboard/DeploymentBanner/DeploymentBanner.tsx index a48de3251c..f87cf31314 100644 --- a/site/src/components/Dashboard/DeploymentBanner/DeploymentBanner.tsx +++ b/site/src/components/Dashboard/DeploymentBanner/DeploymentBanner.tsx @@ -12,7 +12,9 @@ export const DeploymentBanner: FC = () => { const deploymentStatsQuery = useQuery(deploymentStats()); const healthQuery = useQuery({ ...health(), - enabled: dashboard.experiments.includes("deployment_health_page"), + enabled: + dashboard.experiments.includes("deployment_health_page") && + permissions.viewDeploymentValues, }); if (!permissions.viewDeploymentValues || !deploymentStatsQuery.data) {