Skip to content

Commit

Permalink
Merge pull request Expensify#30812 from Expensify/srikar-updateSubscr…
Browse files Browse the repository at this point in the history
…ibeOnLeave

Update subscribe on leave
  • Loading branch information
deetergp authored Jan 6, 2024
2 parents 50f2010 + a67c871 commit 0c351a4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2120,6 +2120,24 @@ function leaveRoom(reportID: string, isWorkspaceMemberLeavingWorkspaceRoom = fal
},
];

if (report.parentReportID && report.parentReportActionID) {
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`,
value: {[report.parentReportActionID]: {childReportNotificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN}},
});
successData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`,
value: {[report.parentReportActionID]: {childReportNotificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN}},
});
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`,
value: {[report.parentReportActionID]: {childReportNotificationPreference: report.notificationPreference}},
});
}

type LeaveRoomParameters = {
reportID: string;
};
Expand Down

0 comments on commit 0c351a4

Please sign in to comment.