From d46208aa2820cb96cba075c618ec932eb6c1d939 Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Wed, 6 Dec 2023 15:42:28 +0000 Subject: [PATCH] fix(site): fetch health data only if has permissions --- .../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 a48de3251c665..f87cf31314e0a 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) {