mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
fix js error removed dupe code
This commit is contained in:
@@ -537,7 +537,7 @@ app.cacheBuster = null;
|
||||
});
|
||||
};
|
||||
|
||||
function showEmailConfirmWarning() {
|
||||
function showEmailConfirmWarning(err) {
|
||||
if (!config.requireEmailConfirmation || !app.user.uid) {
|
||||
return;
|
||||
}
|
||||
@@ -555,7 +555,7 @@ app.cacheBuster = null;
|
||||
} else if (!app.user['email:confirmed']) {
|
||||
app.alert({
|
||||
alert_id: 'email_confirm',
|
||||
message: '[[error:email-not-confirmed]]',
|
||||
message: err ? err.message : '[[error:email-not-confirmed]]',
|
||||
type: 'warning',
|
||||
timeout: 0,
|
||||
clickfn: function() {
|
||||
|
||||
@@ -207,7 +207,7 @@ define('forum/chats', ['string', 'sounds', 'forum/infinitescroll'], function(S,
|
||||
}, function(err) {
|
||||
if (err) {
|
||||
if (err.message === '[[error:email-not-confirmed-chat]]') {
|
||||
return showEmailConfirmAlert(err);
|
||||
return app.showEmailConfirmWarning(err);
|
||||
}
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ define('composer', [
|
||||
discard(composer.active);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
translator.translate('[[modules:composer.discard]]', function(translated) {
|
||||
bootbox.confirm(translated, function(confirm) {
|
||||
if (confirm) {
|
||||
@@ -506,7 +506,7 @@ define('composer', [
|
||||
$('.action-bar button').removeAttr('disabled');
|
||||
if (err) {
|
||||
if (err.message === '[[error:email-not-confirmed]]') {
|
||||
return showEmailConfirmAlert(err);
|
||||
return app.showEmailConfirmWarning(err);
|
||||
}
|
||||
|
||||
return app.alertError(err.message);
|
||||
@@ -519,25 +519,6 @@ define('composer', [
|
||||
}
|
||||
}
|
||||
|
||||
function showEmailConfirmAlert(err) {
|
||||
app.alert({
|
||||
alert_id: 'email_confirm',
|
||||
title: '[[global:alert.error]]',
|
||||
message: err.message,
|
||||
type: 'danger',
|
||||
timeout: 0,
|
||||
clickfn: function() {
|
||||
app.removeAlert('email_confirm');
|
||||
socket.emit('user.emailConfirm', {}, function(err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
app.alertSuccess('[[notifications:email-confirm-sent]]');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function discard(post_uuid) {
|
||||
if (composer.posts[post_uuid]) {
|
||||
$('#cmp-uuid-' + post_uuid).remove();
|
||||
|
||||
Reference in New Issue
Block a user