mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Task order fix (#8928)
This commit is contained in:
@@ -403,6 +403,13 @@ export function cron (options = {}) {
|
||||
|
||||
user.history.exp.push({date: now, value: expTally});
|
||||
|
||||
// Remove any remaining completed todos from the list of active todos
|
||||
user.tasksOrder.todos = user.tasksOrder.todos.filter(taskOrderId => {
|
||||
return _.some(tasksByType.todos, taskType => {
|
||||
return taskType._id === taskOrderId && taskType.completed === false;
|
||||
});
|
||||
});
|
||||
|
||||
// preen user history so that it doesn't become a performance problem
|
||||
// also for subscribed users but differently
|
||||
// TODO also do while resting in the inn. Note that later we'll be allowing the value/color of tasks to change while sleeping (https://github.com/HabitRPG/habitica/issues/5232), so the code in performSleepTasks() might be best merged back into here for that. Perhaps wait until then to do preen history for sleeping users.
|
||||
|
||||
Reference in New Issue
Block a user