bug fixed in case several emails subscribed for same pad & authorId

This commit is contained in:
quenenni 2013-04-06 22:40:40 +02:00
parent af7fa15060
commit e79b95af3f

View file

@ -101,6 +101,9 @@ exports.handleClientMessage_emailUnsubscriptionSuccess = function(hook, context)
exports.handleClientMessage_emailNotificationGetUserInfo = function (hook, context) { // return the existing options for this userId
var result = context.payload;
// Only use first data from the server. (case when 2 emails subscribed for the same pad & authorId)
if ($('.ep_email_settings').is(':visible') == false) {
if(result.success == true){ // If data found, set the options with them
$('[name=ep_email]').val(result.email);
$('[name=ep_email_onStart]').prop('checked', result.onStart);
@ -113,6 +116,7 @@ exports.handleClientMessage_emailNotificationGetUserInfo = function (hook, conte
if (result.formName == 'ep_email_form_mysettings') {
$('.ep_email_settings').slideToggle();
}
}
}
exports.handleClientMessage_emailNotificationMissingParams = function (hook, context) { // Settings are missing in settings.json file