Merge branch 'release' into develop
This commit is contained in:
+1
-1
Submodule habitica-images updated: 5afe493854...5a79037fca
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "habitica",
|
||||
"version": "4.225.0",
|
||||
"version": "4.225.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "habitica",
|
||||
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
|
||||
"version": "4.225.0",
|
||||
"version": "4.225.2",
|
||||
"main": "./website/server/index.js",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.17.8",
|
||||
|
||||
@@ -25953,8 +25953,8 @@
|
||||
width: 114px;
|
||||
height: 90px;
|
||||
}
|
||||
.shield_special_spring2022Mage {
|
||||
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shield_special_spring2022Mage.png');
|
||||
.shield_special_spring2022Rogue {
|
||||
background-image: url('https://habitica-assets.s3.amazonaws.com/mobileApp/images/shield_special_spring2022Rogue.png');
|
||||
width: 114px;
|
||||
height: 117px;
|
||||
}
|
||||
|
||||
@@ -838,6 +838,32 @@ api.moveTask = {
|
||||
|
||||
// In memory updates
|
||||
const order = owner.tasksOrder[`${task.type}s`];
|
||||
|
||||
if (order.indexOf(task._id) === -1) { // task is missing from list, list needs repair
|
||||
const taskListQuery = { type: task.type };
|
||||
if (group) {
|
||||
taskListQuery['group.id'] = owner._id;
|
||||
taskListQuery.userId = { $exists: false };
|
||||
} else if (challenge) {
|
||||
taskListQuery['challenge.id'] = owner._id;
|
||||
taskListQuery.userId = { $exists: false };
|
||||
} else {
|
||||
taskListQuery.userId = owner._id;
|
||||
}
|
||||
const taskList = await Tasks.Task.find(
|
||||
taskListQuery,
|
||||
{ _id: 1 },
|
||||
).exec();
|
||||
for (const foundTask of taskList) {
|
||||
if (order.indexOf(foundTask._id) === -1) {
|
||||
order.push(foundTask._id);
|
||||
}
|
||||
}
|
||||
const fixQuery = { $set: {} };
|
||||
fixQuery.$set[`tasksOrder.${task.type}s`] = order;
|
||||
await owner.update(fixQuery).exec();
|
||||
}
|
||||
|
||||
moveTask(order, task._id, to);
|
||||
|
||||
// Server updates
|
||||
|
||||
@@ -160,6 +160,21 @@ api.groupMoveTask = {
|
||||
|
||||
const order = group.tasksOrder[`${task.type}s`];
|
||||
|
||||
if (order.indexOf(task._id) === -1) { // task is missing from list, list needs repair
|
||||
const taskList = await Tasks.Task.find(
|
||||
{ 'group.id': group._id, userId: { $exists: false }, type: task.type },
|
||||
{ _id: 1 },
|
||||
).exec();
|
||||
for (const foundTask of taskList) {
|
||||
if (order.indexOf(foundTask._id) === -1) {
|
||||
order.push(foundTask._id);
|
||||
}
|
||||
}
|
||||
const fixQuery = { $set: {} };
|
||||
fixQuery.$set[`tasksOrder.${task.type}s`] = order;
|
||||
await group.update(fixQuery).exec();
|
||||
}
|
||||
|
||||
moveTask(order, task._id, to);
|
||||
|
||||
await group.save();
|
||||
|
||||
Reference in New Issue
Block a user