From 286c6234546598d6e15890b66c11ea09ac819adb Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Thu, 15 Jun 2023 18:59:25 +0100 Subject: [PATCH] Fix condition --- src/libs/actions/Task.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libs/actions/Task.js b/src/libs/actions/Task.js index 77a0d5d40bee..4003ba8002f0 100644 --- a/src/libs/actions/Task.js +++ b/src/libs/actions/Task.js @@ -308,12 +308,10 @@ function editTaskAndNavigate(report, ownerEmail, ownerAccountID, {title, descrip // If we make a change to the assignee, we want to add a comment to the assignee's chat let optimisticAssigneeAddComment; let assigneeChatReportID; - if (assigneeAccountID && assigneeAccountID !== report.managerID) { - const assigneeChatReport = ReportUtils.getChatByParticipants([assigneeAccountID]); + if (assigneeAccountID && assigneeAccountID !== report.managerID && assigneeAccountID !== ownerAccountID) { + assigneeChatReportID = ReportUtils.getChatByParticipants([assigneeAccountID]).reportID; - // assigneeChatReportID may not exist if we're assigning the task to ourselves and if it's not shared in a room - if (assigneeChatReport && assigneeChatReport.reportID !== report.parentReportID.toString()) { - assigneeChatReportID = assigneeChatReport.reportID; + if (assigneeChatReportID !== report.parentReportID.toString()) { optimisticAssigneeAddComment = ReportUtils.buildOptimisticTaskCommentReportAction( report.reportID, reportName,