diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 064b475a0aaa..6934abaa86b3 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -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', ''); } /** diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index d505d8d7268f..ecfe1e077a5e 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -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; }