Correct code to not iterate over mongoose object

This commit is contained in:
Blade Barringer
2015-11-05 13:08:37 -06:00
parent 1e4570ff88
commit 4cbda6818c

View File

@@ -580,7 +580,22 @@ function _populateDefaultsForNewUser(user) {
if (user.registeredThrough === "habitica-web") {
taskTypes = ['habits', 'dailys', 'todos', 'rewards', 'tags'];
_.each(user.flags.tutorial.common, function(value, section) {
var tutorialCommonSections = [
'habits',
'dailies',
'todos',
'rewards',
'party',
'pets',
'gems',
'skills',
'classes',
'tavern',
'equipment',
'items',
];
_.each(tutorialCommonSections, function(section) {
user.flags.tutorial.common[section] = true;
});
} else {
@@ -588,7 +603,23 @@ function _populateDefaultsForNewUser(user) {
user.flags.showTour = false;
_.each(user.flags.tour, function(value, section) {
var tourSections = [
'showTour',
'intro',
'classes',
'stats',
'tavern',
'party',
'guilds',
'challenges',
'market',
'pets',
'mounts',
'hall',
'equipment',
];
_.each(tourSections, function(section) {
user.flags.tour[section] = -2;
});
}