diff --git a/web/src/ResetModal.js b/web/src/ResetModal.js index 794f8c4e..4ca43f50 100644 --- a/web/src/ResetModal.js +++ b/web/src/ResetModal.js @@ -23,6 +23,8 @@ export const ResetModal = (props) => { const [confirmLoading, setConfirmLoading] = React.useState(false); const [sendButtonText, setSendButtonText] = React.useState(i18next.t("user:Send Code")); const [sendCodeCoolDown, setCoolDown] = React.useState(false); + const [dest, setDest] = React.useState(""); + const [code, setCode] = React.useState(""); const {buttonText, destType, coolDownTime} = props; const showModal = () => { @@ -34,8 +36,6 @@ export const ResetModal = (props) => { }; const handleOk = () => { - let dest = document.getElementById("dest").value; - let code = document.getElementById("code").value; if (dest === "") { Setting.showMessage("error", i18next.t("user:Empty " + destType)); return; @@ -68,7 +68,6 @@ export const ResetModal = (props) => { const sendCode = () => { if (sendCodeCoolDown) return; - let dest = document.getElementById("dest").value; if (dest === "") { Setting.showMessage("error", i18next.t("user:Empty " + destType)); return; @@ -105,13 +104,13 @@ export const ResetModal = (props) => { >