Skip to content

Commit

Permalink
use reportID in getReportNotificationPreference
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Oct 20, 2023
1 parent e5c0514 commit d3daf61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,13 @@ function getReport(reportID) {
}

/**
* Get the notification preference given a report
* Get the notification preference given a reportID
*
* @param {Object} report
* @param {String} reportID
* @returns {String}
*/
function getReportNotificationPreference(report) {
return lodashGet(report, 'notificationPreference', '');
function getReportNotificationPreference(reportID) {
return lodashGet(getReport(reportID), 'notificationPreference', '');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function addActions(reportID, text = '', file) {
isLastMessageDeletedParentAction: null,
};

if (ReportUtils.getReportNotificationPreference(ReportUtils.getReport(reportID)) === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) {
if (ReportUtils.getReportNotificationPreference(reportID) === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) {
optimisticReport.notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS;
}

Expand Down

0 comments on commit d3daf61

Please sign in to comment.