From 8484427138e3807176fbd9bae70b2bf717e3228f Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Fri, 20 Oct 2023 11:58:37 +0200 Subject: [PATCH] Revert "use reportID in getReportNotificationPreference" This reverts commit d3daf618b68941007ad1e5fd843c303111f73ed0. --- src/libs/ReportUtils.js | 8 ++++---- src/libs/actions/Report.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 6934abaa86b3..064b475a0aaa 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -778,13 +778,13 @@ function getReport(reportID) { } /** - * Get the notification preference given a reportID + * Get the notification preference given a report * - * @param {String} reportID + * @param {Object} report * @returns {String} */ -function getReportNotificationPreference(reportID) { - return lodashGet(getReport(reportID), 'notificationPreference', ''); +function getReportNotificationPreference(report) { + return lodashGet(report, 'notificationPreference', ''); } /** diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index ecfe1e077a5e..d505d8d7268f 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(reportID) === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) { + if (ReportUtils.getReportNotificationPreference(ReportUtils.getReport(reportID)) === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN) { optimisticReport.notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS; }