fix(tasks): manager lock icon, coerce task value to Number

This commit is contained in:
Sabe Jones
2021-05-19 14:44:08 -05:00
committed by SabreCat
parent 072b09e030
commit 801b902bb8
2 changed files with 6 additions and 2 deletions

View File

@@ -1046,13 +1046,17 @@ export default {
showTaskLockIcon () {
if (this.isUser) return false;
if (this.isGroupTask) {
if (this.teamManagerAccess) return false;
if (this.isOpenTask) {
if (!this.task.completed) return false;
if (this.task.group.completedBy === this.user._id) return false;
return true;
}
if (this.task.group.assignedUsers.indexOf(this.user._id) !== -1) return false;
if (
this.task.group.assignedUsers.length > 0
&& this.task.group.assignedUsers.indexOf(this.user._id) === -1
) return true;
if (this.teamManagerAccess) return false;
}
return true;
},

View File

@@ -410,7 +410,7 @@ async function scoreTask (user, task, direction, req, res) {
if (localTask) {
localTask.completed = task.completed;
localTask.value = task.value + delta;
localTask.value = Number(task.value) + Number(delta);
await localTask.save();
}