From a0631d8b27193a8094c94d43094d4a55e0091039 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bonnet?= <bonnet.rem@gmail.com>
Date: Thu, 26 Sep 2024 16:03:34 +0200
Subject: [PATCH] fix(need-redeploy-flag): hide if no service deployment state
 to avoid glitch reloading (#1695)

---
 .../feature/src/lib/need-redeploy-flag/need-redeploy-flag.tsx   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libs/domains/services/feature/src/lib/need-redeploy-flag/need-redeploy-flag.tsx b/libs/domains/services/feature/src/lib/need-redeploy-flag/need-redeploy-flag.tsx
index 5c09fcb2010..f00e1a300a3 100644
--- a/libs/domains/services/feature/src/lib/need-redeploy-flag/need-redeploy-flag.tsx
+++ b/libs/domains/services/feature/src/lib/need-redeploy-flag/need-redeploy-flag.tsx
@@ -17,6 +17,8 @@ export function NeedRedeployFlag() {
   })
   const { mutate: deployService } = useDeployService({ environmentId })
 
+  if (!serviceDeploymentStatus) return null
+
   const serviceDeploymentStatusState =
     serviceDeploymentStatus?.service_deployment_status ?? ServiceDeploymentStatusEnum.NEVER_DEPLOYED