Update Orb of Rebirth to ignore completed todos (#13773)

* added logic to exclude completed tasks from having task.value set to 0

* logic refinement

* fix(rebirth): complete D

Co-authored-by: SabreCat <sabe@habitica.com>
This commit is contained in:
Natalie L
2022-01-31 16:33:11 -05:00
committed by GitHub
parent 3a28fd58ef
commit de70ad65f5

View File

@@ -42,7 +42,7 @@ export default function rebirth (user, tasks = [], req = {}, analytics) {
each(tasks, task => { each(tasks, task => {
if (!task.challenge || !task.challenge.id || task.challenge.broken) { if (!task.challenge || !task.challenge.id || task.challenge.broken) {
if (task.type !== 'reward') { if (task.type !== 'reward' && task.type !== 'todo') {
task.value = 0; task.value = 0;
} }
if (task.type === 'daily') { if (task.type === 'daily') {
@@ -52,6 +52,9 @@ export default function rebirth (user, tasks = [], req = {}, analytics) {
task.counterDown = 0; task.counterDown = 0;
task.counterUp = 0; task.counterUp = 0;
} }
if (task.type === 'todo' && task.completed !== true) {
task.value = 0;
}
} }
}); });