From f99c1f44e8c12a2568ed75f06dbc95ffb6110138 Mon Sep 17 00:00:00 2001 From: Resulte Lee Date: Wed, 22 Jun 2022 22:22:40 +0800 Subject: [PATCH] fix: don't trigger countdown if failed to send verification code (#815) * feat: add countdown when no captcha provider found * fix: add countdown when sent code successfully --- web/src/common/CountDownInput.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/common/CountDownInput.js b/web/src/common/CountDownInput.js index c7da5346..22ef207c 100644 --- a/web/src/common/CountDownInput.js +++ b/web/src/common/CountDownInput.js @@ -69,7 +69,11 @@ export const CountDownInput = (props) => { const loadCaptcha = () => { UserBackend.getCaptcha("admin", authConfig.appName, false).then(res => { if (res.type === "none") { - UserBackend.sendCode("none", "", "", ...onButtonClickArgs); + UserBackend.sendCode("none", "", "", ...onButtonClickArgs).then(res => { + if (res) { + handleCountDown(60); + } + }); } else if (res.type === "Default") { setCheckId(res.captchaId); setCaptchaImg(res.captchaImage);