From 62a95f5c88d6adaf61899cf9d4f839bd6f57153c Mon Sep 17 00:00:00 2001 From: Fufeck Date: Wed, 11 Sep 2024 10:53:17 +0200 Subject: [PATCH] fix: pourcent numeros certify when 0 numeros --- components/bal/certification-infos.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/bal/certification-infos.tsx b/components/bal/certification-infos.tsx index 088097954..023619051 100644 --- a/components/bal/certification-infos.tsx +++ b/components/bal/certification-infos.tsx @@ -35,7 +35,8 @@ function CertificationInfos({ openRecoveryDialog }: CertificationInfosProps) { const [isInfosShown, setIsInfosShown] = useState(false); const [isLoading, setIsLoading] = useState(false); const { nbNumeros, nbNumerosCertifies } = baseLocale; - const percentCertified = Math.round((nbNumerosCertifies * 100) / nbNumeros); + const percentCertified = + nbNumeros > 0 ? Math.round((nbNumerosCertifies * 100) / nbNumeros) : 0; // Reload base local when the tab is mounted to be sure to have the updated number // of certified adresses