mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 21:09:18 +08:00
fixed account verification notice duplicating
This commit is contained in:
parent
107907f1d1
commit
04e96902ce
1 changed files with 2 additions and 13 deletions
|
@ -232,24 +232,13 @@ function signOut() {
|
|||
});
|
||||
}
|
||||
|
||||
function sendVerificationEmail() {
|
||||
let cu = firebase.auth().currentUser;
|
||||
cu.sendEmailVerification()
|
||||
.then((e) => {
|
||||
showNotification("Email sent to " + cu.email, 4000);
|
||||
})
|
||||
.catch((e) => {
|
||||
showNotification("Error: " + e.message, 3000);
|
||||
console.error(e.message);
|
||||
});
|
||||
}
|
||||
|
||||
firebase.auth().onAuthStateChanged(function (user) {
|
||||
if (user) {
|
||||
// User is signed in.
|
||||
$(".pageAccount .content p.accountVerificatinNotice").remove();
|
||||
if (user.emailVerified === false) {
|
||||
$(".pageAccount .content").prepend(
|
||||
`<p style="text-align:center">Your account is not verified. Click <a onClick="sendVerificationEmail()">here</a> to resend the verification email.`
|
||||
`<p class="accountVerificatinNotice" style="text-align:center">Your account is not verified. Click <a onClick="sendVerificationEmail()">here</a> to resend the verification email.`
|
||||
);
|
||||
}
|
||||
updateAccountLoginButton();
|
||||
|
|
Loading…
Reference in a new issue