fix upgrade script for notification types

v1.18.x
Barış Soner Uşaklı 6 years ago
parent 5ef708d765
commit 54c638c3c8

@ -12,12 +12,14 @@ module.exports = {
db.getObject('config', next); db.getObject('config', next);
}, },
function (config, next) { function (config, next) {
var postNotifications = parseInt(config.sendPostNotifications, 10) === 1 ? 'notification' : 'none';
var chatNotifications = parseInt(config.sendChatNotifications, 10) === 1 ? 'notification' : 'none';
db.setObject('config', { db.setObject('config', {
notificationType_upvote: config.notificationType_upvote || 'notification', notificationType_upvote: config.notificationType_upvote || 'notification',
'notificationType_new-topic': config['notificationType_new-topic'] || 'notification', 'notificationType_new-topic': config['notificationType_new-topic'] || 'notification',
'notificationType_new-reply': config['notificationType_new-reply'] || config.sendPostNotifications || 'notification', 'notificationType_new-reply': config['notificationType_new-reply'] || postNotifications,
notificationType_follow: config.notificationType_follow || 'notification', notificationType_follow: config.notificationType_follow || 'notification',
'notificationType_new-chat': config['notificationType_new-chat'] || config.sendChatNotifications || 'notification', 'notificationType_new-chat': config['notificationType_new-chat'] || chatNotifications,
'notificationType_group-invite': config['notificationType_group-invite'] || 'notification', 'notificationType_group-invite': config['notificationType_group-invite'] || 'notification',
}, next); }, next);
}, },

Loading…
Cancel
Save