From 1642de5310af5d7830fc44dfeb927dc659e13414 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Fri, 1 Dec 2023 09:51:20 +0100 Subject: [PATCH] :bug: Fixing seconds counter on totp code --- .../Components/Layouts/LoginCustomer/StepTotp/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/front/Components/Layouts/LoginCustomer/StepTotp/index.tsx b/src/front/Components/Layouts/LoginCustomer/StepTotp/index.tsx index 73c4d312..bfc704f3 100644 --- a/src/front/Components/Layouts/LoginCustomer/StepTotp/index.tsx +++ b/src/front/Components/Layouts/LoginCustomer/StepTotp/index.tsx @@ -19,10 +19,11 @@ export default function StepTotp(props: IProps) { useEffect(() => { const interval = setInterval(() => { - if (secondsBeforeNewCode > 1) { + if (secondsBeforeNewCode > 0) { setSecondsBeforeNewCode(secondsBeforeNewCode - 1); - } else { - setDisableNewCodeButton(false); + if (secondsBeforeNewCode === 1) { + setDisableNewCodeButton(false); + } } }, 1000); return () => clearInterval(interval);