Skip to content

Commit

Permalink
Fix condition
Browse files Browse the repository at this point in the history
  • Loading branch information
youssef-lr committed Jun 15, 2023
1 parent ccd79e8 commit 286c623
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/libs/actions/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 286c623

Please # to comment.