Skip to content

Commit

Permalink
added 'not verified' info to the account page
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Jul 21, 2020
1 parent 8f439c7 commit 340db1c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
22 changes: 11 additions & 11 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<title>Monkey Type</title>
<link rel="stylesheet" href="css/fa.css">
<link rel="stylesheet" href="css/balloon.css">
<link rel="stylesheet" href="css/style.css?v=39">
<link rel="stylesheet" href="css/style.css?v=40">
<link rel="stylesheet" href="themes/serika_dark.css" id="currentTheme">
<link id="favicon" rel="shortcut icon" href="fav.png">
<link rel="shortcut icon" href="fav.png">
Expand Down Expand Up @@ -1353,17 +1353,17 @@ <h1>discord dot</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"></script> -->
<script src="js/chart.js"></script>
<script src="js/chartjs-plugin-trendline.js?v=39"></script>
<script src="js/chartjs-plugin-trendline.js?v=40"></script>
<script src="js/chartjs-plugin-annotation.js"></script>
<script src="js/html2canvas.js"></script>
<script src="js/words.js?v=39"></script>
<script src="js/layouts.js?v=39"></script>
<script src="js/db.js?v=39"></script>
<script src="js/userconfig.js?v=39"></script>
<script src="js/commandline.js?v=39"></script>
<script src="js/leaderboards.js?v=39"></script>
<script src="js/settings.js?v=39"></script>
<script src="js/account.js?v=39"></script>
<script src="js/script.js?v=39"></script>
<script src="js/words.js?v=40"></script>
<script src="js/layouts.js?v=40"></script>
<script src="js/db.js?v=40"></script>
<script src="js/userconfig.js?v=40"></script>
<script src="js/commandline.js?v=40"></script>
<script src="js/leaderboards.js?v=40"></script>
<script src="js/settings.js?v=40"></script>
<script src="js/account.js?v=40"></script>
<script src="js/script.js?v=40"></script>

</html>
12 changes: 8 additions & 4 deletions public/js/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,10 @@ function signOut() {
}

function sendVerificationEmail() {
firebase
.auth()
.currentUser.sendEmailVerification()
let cu = firebase.auth().currentUser;
cu.sendEmailVerification()
.then((e) => {
showNotification("Email sent", 3000);
showNotification("Email sent to " + cu.email, 4000);
})
.catch((e) => {
showNotification("Error: " + e.message, 3000);
Expand All @@ -209,6 +208,11 @@ function sendVerificationEmail() {
firebase.auth().onAuthStateChanged(function (user) {
if (user) {
// User is signed in.
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.`
);
}
updateAccountLoginButton();
accountIconLoading(true);
db_getUserSnapshot().then((e) => {
Expand Down

0 comments on commit 340db1c

Please sign in to comment.