From bb20c44fde976ed02f89cadaf4e0e139141233b7 Mon Sep 17 00:00:00 2001 From: SabreCat Date: Thu, 19 May 2022 14:28:35 -0500 Subject: [PATCH] fix(needs-work): don't show Gold/Experience depletion for manager --- website/client/src/components/tasks/task.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/website/client/src/components/tasks/task.vue b/website/client/src/components/tasks/task.vue index 7cd044fd19..fe68cf1f67 100644 --- a/website/client/src/components/tasks/task.vue +++ b/website/client/src/components/tasks/task.vue @@ -1162,6 +1162,18 @@ export default { async score (direction) { if (this.showTaskLockIcon) return; if (this.task.type === 'habit' && !this.task[direction]) return; + if ( + this.isGroupTask && direction === 'down' + && ['todo', 'daily'].indexOf(this.task.type) !== -1 + && this.task.group.assignedUsers && !this.task.group.assignedUsers[this.user._id] + ) { + this.$store.dispatch('tasks:needsWork', { + taskId: this.task._id, + userId: keys(this.task.group.assignedUsers)[0], + }); + this.task.completed = false; + return; + } if (this.isYesterdaily === true) { await this.beforeTaskScore(this.task); this.task.completed = !this.task.completed;