diff --git a/app/src/config/account.ts b/app/src/config/account.ts index 54484bbe9..19fda7298 100644 --- a/app/src/config/account.ts +++ b/app/src/config/account.ts @@ -219,7 +219,11 @@ ${window.siyuan.languages.account8}`; }); const activationCodeElement = account.element.querySelector("#activationCode"); activationCodeElement.addEventListener("click", () => { - fetchPost("/api/account/checkActivationcode", {data: (activationCodeElement.previousElementSibling as HTMLInputElement).value}, (response) => { + const activationCodeInput = (activationCodeElement.previousElementSibling as HTMLInputElement) + fetchPost("/api/account/checkActivationcode", {data: activationCodeInput.value}, (response) => { + if (0 !== response.code) { + activationCodeInput.value = ""; + } confirmDialog(window.siyuan.languages.activationCode, response.msg, () => { if (response.code === 0) { fetchPost("/api/account/useActivationcode", {data: (activationCodeElement.previousElementSibling as HTMLInputElement).value}, () => {