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) {
|
if (!config.requireEmailConfirmation || !app.user.uid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -555,7 +555,7 @@ app.cacheBuster = null;
|
|||||||
} else if (!app.user['email:confirmed']) {
|
} else if (!app.user['email:confirmed']) {
|
||||||
app.alert({
|
app.alert({
|
||||||
alert_id: 'email_confirm',
|
alert_id: 'email_confirm',
|
||||||
message: '[[error:email-not-confirmed]]',
|
message: err ? err.message : '[[error:email-not-confirmed]]',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
timeout: 0,
|
timeout: 0,
|
||||||
clickfn: function() {
|
clickfn: function() {
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ define('forum/chats', ['string', 'sounds', 'forum/infinitescroll'], function(S,
|
|||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.message === '[[error:email-not-confirmed-chat]]') {
|
if (err.message === '[[error:email-not-confirmed-chat]]') {
|
||||||
return showEmailConfirmAlert(err);
|
return app.showEmailConfirmWarning(err);
|
||||||
}
|
}
|
||||||
return app.alertError(err.message);
|
return app.alertError(err.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ define('composer', [
|
|||||||
$('.action-bar button').removeAttr('disabled');
|
$('.action-bar button').removeAttr('disabled');
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.message === '[[error:email-not-confirmed]]') {
|
if (err.message === '[[error:email-not-confirmed]]') {
|
||||||
return showEmailConfirmAlert(err);
|
return app.showEmailConfirmWarning(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
return app.alertError(err.message);
|
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) {
|
function discard(post_uuid) {
|
||||||
if (composer.posts[post_uuid]) {
|
if (composer.posts[post_uuid]) {
|
||||||
$('#cmp-uuid-' + post_uuid).remove();
|
$('#cmp-uuid-' + post_uuid).remove();
|
||||||
|
|||||||
Reference in New Issue
Block a user