mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-19 10:14:11 +00:00
Merge pull request #6188 from crookedneighbor/fix_user
Correct code to not iterate over mongoose object
This commit is contained in:
commit
9cf3c72002
1 changed files with 33 additions and 2 deletions
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue