Node.js based forum software built for the modern web
feat: updated email confirmation alert to more closely reflect email usage, remembering dismissal
Julian Lambbbacd86ab7a
diff --git a/public/language/en-GB/error.json b/public/language/en-GB/error.jsonindex c1c77d9def..a6c5bfb8aa 100644--- a/public/language/en-GB/error.json+++ b/public/language/en-GB/error.json@@ -38,7 +38,7 @@"email-not-confirmed": "You are unable to post until your email is confirmed, please click here to confirm your email.","email-not-confirmed-chat": "You are unable to chat until your email is confirmed, please click here to confirm your email.","email-not-confirmed-email-sent": "Your email has not been confirmed yet, please check your inbox for the confirmation email. You won't be able to post or chat until your email is confirmed.",- "no-email-to-confirm": "This forum requires email confirmation, please click here to enter an email",+ "no-email-to-confirm": "Your account does not have an email set. An email is necessary for account recovery. Please click here to enter an email.","email-confirm-failed": "We could not confirm your email, please try again later.","confirm-email-already-sent": "Confirmation email already sent, please wait %1 minute(s) to send another one.","sendmail-not-found": "The sendmail executable could not be found, please ensure it is installed and executable by the user running NodeBB.",diff --git a/public/src/app.js b/public/src/app.jsindex ed504fa00d..816a89b6fd 100644--- a/public/src/app.js+++ b/public/src/app.js@@ -732,21 +732,26 @@ app.cacheBuster = null;});};- app.showEmailConfirmWarning = function (err) {- if (!app.user.uid) {+ app.showEmailConfirmWarning = async (err) => {+ const storage = await app.require('storage');++ if (!app.user.uid || parseInt(storage.getItem('email-confirm-dismiss'), 10) === 1) {return;}var msg = {alert_id: 'email_confirm',type: 'warning',timeout: 0,+ closefn: () => {+ storage.setItem('email-confirm-dismiss', 1);+ },};if (!app.user.email) {msg.message = '[[error:no-email-to-confirm]]';msg.clickfn = function () {app.removeAlert('email_confirm');- ajaxify.go('user/' + app.user.userslug + '/edit');+ ajaxify.go('user/' + app.user.userslug + '/edit/email');};app.alert(msg);} else if (!app.user['email:confirmed'] && !app.user.isEmailConfirmSent) {