From 22aeebe8d3be975fdf7ae2e9c5b090587e15f9b4 Mon Sep 17 00:00:00 2001 From: Kininaru Date: Sat, 15 May 2021 11:47:09 +0800 Subject: [PATCH] fix: reset phone email data error and removed dom API from it Signed-off-by: Kininaru --- web/src/ResetModal.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/web/src/ResetModal.js b/web/src/ResetModal.js index 794f8c4e..6e70cc8e 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) => { > - {" " + sendButtonText + " "}} + setDest(e.target.value)} + addonAfter={} /> - + setCode(e.target.value)}/>