Release mergeback v3.86.0 (#8685)

* 3.85.0

* New User Tasks for Mobile (#8682)

* feat(mobile): different default tasks

* fix(linting): missing space

* fix(user): correct client type logic

* test(integration): tasks by platform

* fix(test): remove only

* test(user): deeper checks on tasks

* refactor(test): whitespace for readability

* feat(subs): Jackalope Pets (#8684)

* chore(sprites): compile

* chore(i18n): update locales

* 3.86.0
This commit is contained in:
Sabe Jones
2017-04-18 19:23:24 -05:00
committed by GitHub
parent 4275da0a2e
commit 91ed55cf66
201 changed files with 4199 additions and 3476 deletions

View File

@@ -31,10 +31,16 @@ function findTag (user, tagName) {
}
function _populateDefaultTasks (user, taskTypes) {
let defaultsData;
if (user.registeredThrough === 'habitica-android' || user.registeredThrough === 'habitica-ios') {
defaultsData = shared.content.userDefaultsMobile;
} else {
defaultsData = shared.content.userDefaults;
}
let tagsI = taskTypes.indexOf('tag');
if (tagsI !== -1) {
user.tags = _.map(shared.content.userDefaults.tags, (tag) => {
user.tags = _.map(defaultsData.tags, (tag) => {
let newTag = _.cloneDeep(tag);
// tasks automatically get _id=helpers.uuid() from TaskSchema id.default, but tags are Schema.Types.Mixed - so we need to manually invoke here
@@ -53,7 +59,7 @@ function _populateDefaultTasks (user, taskTypes) {
}
_.each(taskTypes, (taskType) => {
let tasksOfType = _.map(shared.content.userDefaults[`${taskType}s`], (taskDefaults) => {
let tasksOfType = _.map(defaultsData[`${taskType}s`], (taskDefaults) => {
let newTask = new Tasks[taskType](taskDefaults);
newTask.userId = user._id;
@@ -106,12 +112,17 @@ function _setUpNewUser (user) {
user.flags.tutorial.common[section] = true;
});
} else {
taskTypes = ['todo', 'tag'];
user.flags.showTour = false;
_.each(iterableFlags.tour, (val, section) => {
user.flags.tour[section] = -2;
});
if (user.registeredThrough === 'habitica-android' || user.registeredThrough === 'habitica-ios') {
taskTypes = ['habit', 'daily', 'todo', 'reward', 'tag'];
} else {
taskTypes = ['todo', 'tag'];
}
}
return _populateDefaultTasks(user, taskTypes);