Skip to content

Commit

Permalink
for #1431: clear email input for form submission
Browse files Browse the repository at this point in the history
  • Loading branch information
groovecoder committed Dec 6, 2019
1 parent 17d76df commit 2c89a39
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/js/scan-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ async function sha1(message) {
async function hashEmailAndSend(emailFormSubmitEvent) {
emailFormSubmitEvent.preventDefault();
const emailForm = emailFormSubmitEvent.target;
let userEmail = document.getElementById("scan-email").value;
const emailInput = document.getElementById("scan-email");
const userEmail = emailInput.value;

// show loader and hash email
emailForm.classList.add("loading-data");
Expand All @@ -35,7 +36,7 @@ async function hashEmailAndSend(emailFormSubmitEvent) {
}

// clear input, send ping, and submit
userEmail = "";
emailInput.value = "";
sendPing(emailForm, "Success");
emailForm.submit();
}

0 comments on commit 2c89a39

Please sign in to comment.