Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hide task from LHN when not open #48534

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/libs/actions/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ function editTaskAssignee(report: OnyxTypes.Report, ownerAccountID: number, assi

let assigneeChatReportOnyxData;
const assigneeChatReportID = assigneeChatReport ? assigneeChatReport.reportID : '-1';
const parentReport = getParentReport(report);
const taskOwnerAccountID = getTaskOwnerAccountID(report);
const optimisticReport: OptimisticReport = {
reportName,
managerID: assigneeAccountID ?? report.managerID,
Expand All @@ -583,9 +585,10 @@ function editTaskAssignee(report: OnyxTypes.Report, ownerAccountID: number, assi
},
participants: {
[currentUserAccountID]: {
notificationPreference: [assigneeAccountID, ownerAccountID].includes(currentUserAccountID)
? CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS
: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
notificationPreference:
[assigneeAccountID, taskOwnerAccountID].includes(currentUserAccountID) && !parentReport
? CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS
: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
},
},
};
Expand Down Expand Up @@ -631,7 +634,6 @@ function editTaskAssignee(report: OnyxTypes.Report, ownerAccountID: number, assi
];

if (currentUserAccountID === assigneeAccountID) {
const parentReport = getParentReport(report);
if (!isEmptyObject(parentReport)) {
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
Expand All @@ -648,7 +650,6 @@ function editTaskAssignee(report: OnyxTypes.Report, ownerAccountID: number, assi

if (report.managerID === currentUserAccountID) {
const hasOutstandingChildTask = getOutstandingChildTask(report);
const parentReport = getParentReport(report);
if (!isEmptyObject(parentReport)) {
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
Expand Down
Loading