Fix unnecessary closure capture
This commit is contained in:
parent
af8d963fd2
commit
853fd906cb
1 changed files with 17 additions and 23 deletions
|
@ -3669,16 +3669,13 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
const $emailconfirmTimezoneCurrent = $emailconfirmmodal.find('#emailconfirm-timezone-current');
|
||||
const $emailconfirmTimezoneUtc = $emailconfirmmodal.find('#emailconfirm-timezone-utc');
|
||||
$emailconfirmTimezoneCurrent.off('click.sendEmailCurrentTimezone');
|
||||
$emailconfirmTimezoneCurrent.on('click.sendEmailCurrentTimezone', function(expirationDateRoundedToSecond, isBurnafterreading) {
|
||||
return function() {
|
||||
$emailconfirmTimezoneCurrent.on('click.sendEmailCurrentTimezone', () => {
|
||||
const emailBody = templateEmailBody(expirationDateRoundedToSecond.toLocaleString(), isBurnafterreading);
|
||||
$emailconfirmmodal.modal('hide');
|
||||
triggerEmailSend(emailBody);
|
||||
};
|
||||
} (expirationDateRoundedToSecond, isBurnafterreading));
|
||||
});
|
||||
$emailconfirmTimezoneUtc.off('click.sendEmailUtcTimezone');
|
||||
$emailconfirmTimezoneUtc.on('click.sendEmailUtcTimezone', function(expirationDateRoundedToSecond, isBurnafterreading) {
|
||||
return function() {
|
||||
$emailconfirmTimezoneUtc.on('click.sendEmailUtcTimezone', () => {
|
||||
const emailBody = templateEmailBody(expirationDateRoundedToSecond.toLocaleString(
|
||||
undefined,
|
||||
// we don't use Date.prototype.toUTCString() because we would like to avoid GMT
|
||||
|
@ -3686,8 +3683,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
), isBurnafterreading);
|
||||
$emailconfirmmodal.modal('hide');
|
||||
triggerEmailSend(emailBody);
|
||||
};
|
||||
} (expirationDateRoundedToSecond, isBurnafterreading));
|
||||
});
|
||||
$emailconfirmmodal.modal('show');
|
||||
} else {
|
||||
triggerEmailSend(templateEmailBody(null, isBurnafterreading));
|
||||
|
@ -3863,11 +3859,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
|
||||
$emailLink.removeClass('hidden');
|
||||
$emailLink.off('click.sendEmail');
|
||||
$emailLink.on('click.sendEmail', function(expirationDate, isBurnafterreading) {
|
||||
return function() {
|
||||
$emailLink.on('click.sendEmail', () => {
|
||||
sendEmail(expirationDate, isBurnafterreading);
|
||||
};
|
||||
} (expirationDate, isBurnafterreading));
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
Alert.showError(
|
||||
|
|
Loading…
Reference in a new issue