mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
feat: updated email confirmation alert to more closely reflect email usage, remembering dismissal
This commit is contained in:
@@ -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": "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-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.",
|
"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.",
|
"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.",
|
"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.",
|
"sendmail-not-found": "The sendmail executable could not be found, please ensure it is installed and executable by the user running NodeBB.",
|
||||||
|
|||||||
@@ -732,21 +732,26 @@ app.cacheBuster = null;
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
app.showEmailConfirmWarning = function (err) {
|
app.showEmailConfirmWarning = async (err) => {
|
||||||
if (!app.user.uid) {
|
const storage = await app.require('storage');
|
||||||
|
|
||||||
|
if (!app.user.uid || parseInt(storage.getItem('email-confirm-dismiss'), 10) === 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var msg = {
|
var msg = {
|
||||||
alert_id: 'email_confirm',
|
alert_id: 'email_confirm',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
timeout: 0,
|
timeout: 0,
|
||||||
|
closefn: () => {
|
||||||
|
storage.setItem('email-confirm-dismiss', 1);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!app.user.email) {
|
if (!app.user.email) {
|
||||||
msg.message = '[[error:no-email-to-confirm]]';
|
msg.message = '[[error:no-email-to-confirm]]';
|
||||||
msg.clickfn = function () {
|
msg.clickfn = function () {
|
||||||
app.removeAlert('email_confirm');
|
app.removeAlert('email_confirm');
|
||||||
ajaxify.go('user/' + app.user.userslug + '/edit');
|
ajaxify.go('user/' + app.user.userslug + '/edit/email');
|
||||||
};
|
};
|
||||||
app.alert(msg);
|
app.alert(msg);
|
||||||
} else if (!app.user['email:confirmed'] && !app.user.isEmailConfirmSent) {
|
} else if (!app.user['email:confirmed'] && !app.user.isEmailConfirmSent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user