From bd6ffeb97f913694481381991162142a91507502 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Sat, 1 Jun 2024 21:20:28 +0530 Subject: [PATCH] Removed completed label --- app/components/task/holder.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/components/task/holder.js b/app/components/task/holder.js index d862a8b0..4fea4e77 100644 --- a/app/components/task/holder.js +++ b/app/components/task/holder.js @@ -19,7 +19,12 @@ export default class TasksHolderComponent extends Component { constructor() { super(...arguments); - if (!this.args.dev) { + if (this.args.dev) { + this.status = + this.args.task.status === TASK_KEYS.COMPLETED + ? TASK_KEYS.DONE + : this.args.task.status; + } else { this.status = this.args.task.status === TASK_KEYS.DONE ? TASK_KEYS.COMPLETED @@ -30,11 +35,7 @@ export default class TasksHolderComponent extends Component { const statusToDisplay = this.availabletaskStatusList.filter( (taskStatus) => { if (this.args.dev) { - return ( - taskStatus.key !== 'ALL' && - (taskStatus.key !== TASK_KEYS.COMPLETED || - this.args.task.status === TASK_KEYS.COMPLETED) - ); + return taskStatus.key !== 'ALL' && taskStatus.key !== 'COMPLETED'; } else { return taskStatus.key !== 'ALL' && taskStatus.key !== 'DONE'; } @@ -45,13 +46,10 @@ export default class TasksHolderComponent extends Component { get taskStyleClass() { const statusNotOverDueList = [ - TASK_KEYS.COMPLETED, + this.args.dev ? TASK_KEYS.DONE : TASK_KEYS.COMPLETED, TASK_KEYS.VERIFIED, TASK_KEYS.AVAILABLE, ]; - if (this.args.dev) { - statusNotOverDueList.push(TASK_KEYS.DONE); - } if ( this.args.task.endsOn * 1000 < Date.now() && !statusNotOverDueList.includes(this.status)