🐛 Fixing seconds counter on totp code
This commit is contained in:
parent
f4e843cdfb
commit
1642de5310
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user