slice doesnt deep clone derp

v1.18.x
Barış Soner Uşaklı 10 years ago
parent 98a277af9e
commit d2e8d4d86e

@ -16,6 +16,7 @@ var async = require('async'),
posts = require('./posts'),
privileges = require('./privileges'),
utils = require('../public/src/utils'),
util = require('util'),
uploadsController = require('./controllers/uploads');
@ -952,7 +953,11 @@ var async = require('async'),
var memberOf = [];
isMembers.forEach(function(isMember, index) {
if (isMember) {
memberOf.push(groupData[index]);
if (uids.length > 1) {
memberOf.push(util._extend({}, groupData[index]));
} else {
memberOf.push(groupData[index]);
}
}
});

@ -33,7 +33,7 @@ module.exports = function(Posts) {
var userData = results.userData;
userData.forEach(function(userData, i) {
userData.groups = results.groups[i].slice();
userData.groups = results.groups[i];
userData.groups.forEach(function(group) {
group.selected = group.name === results.userSettings[i].groupTitle;

Loading…
Cancel
Save