From 1222ca42ca463358e5d80a5d9811debad16d8bdf Mon Sep 17 00:00:00 2001 From: Falk Date: Wed, 13 Mar 2024 13:20:58 +0100 Subject: [PATCH] fix(task-selection): prevent action on init It's possible to pass an action to the component in case a new customer/project/task is selected. This action should not get triggered when initially setting up the component with the already selected data. --- app/components/task-selection/component.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/components/task-selection/component.js b/app/components/task-selection/component.js index 4601f6328..551dd70a3 100644 --- a/app/components/task-selection/component.js +++ b/app/components/task-selection/component.js @@ -97,6 +97,8 @@ export default class TaskSelectionComponent extends Component { task: null, }; + const options = { preventAction: true }; + // the objects are possibily wrapped in a proxy which would // confuse the upcoming null check const [customer, project, task] = await Promise.all([ @@ -106,11 +108,11 @@ export default class TaskSelectionComponent extends Component { ]); if (task) { - this.onTaskChange(task); + this.onTaskChange(task, options); } else if (project) { - this.onProjectChange(project); + this.onProjectChange(project, options); } else if (customer) { - this.onCustomerChange(customer); + this.onCustomerChange(customer, options); } else { this.tracking.fetchCustomers.perform(); }