Skip to content

Commit

Permalink
fix upgrade script for notification types
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli authored and julianlam committed Oct 22, 2018
1 parent d84030d commit dbc7c2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/upgrades/1.7.6/notification_types.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ module.exports = {
db.getObject('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', {
notificationType_upvote: config.notificationType_upvote || '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_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',
}, next);
},
Expand Down

0 comments on commit dbc7c2c

Please sign in to comment.