Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Julian Lam
2017-12-28 16:26:35 -05:00
20 changed files with 188 additions and 183 deletions

View File

@@ -1,6 +1,7 @@
'use strict';
var async = require('async');
var winston = require('winston');
var user = require('../../user');
var meta = require('../../meta');
@@ -112,7 +113,12 @@ module.exports = function (SocketUser) {
reason: reason,
};
emailer.send('banned', uid, data, next);
emailer.send('banned', uid, data, function (err) {
if (err) {
winston.error('[emailer.send] ' + err.message);
}
next();
});
},
function (next) {
user.ban(uid, until, reason, next);

View File

@@ -205,7 +205,7 @@ Upgrade.incrementProgress = function (value) {
if (this.total) {
percentage = Math.floor((this.current / this.total) * 100) + '%';
filled = Math.floor((this.current / this.total) * 15);
unfilled = Math.min(0, 15 - filled);
unfilled = Math.max(0, 15 - filled);
}
readline.cursorTo(process.stdout, 0);

View File

@@ -31,7 +31,7 @@ widgets.render = function (uid, options, callback) {
var returnData = {};
async.each(locations, function (location, done) {
widgetsByLocation[location] = (data.global[location] || []).concat(data[options.template][location] || []);
widgetsByLocation[location] = (data[options.template][location] || []).concat(data.global[location] || []);
if (!widgetsByLocation[location].length) {
return done(null, { location: location, widgets: [] });