diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 13b14d380758..76b9fe40181b 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -492,7 +492,7 @@ function addActions(reportID: string, text = '', file?: FileObject) { if (shouldUpdateNotificationPrefernece) { optimisticReport.participants = { - [currentUserAccountID]: {notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS}, + [currentUserAccountID]: {notificationPreference: ReportUtils.getDefaultNotificationPreferenceForReport(report)}, }; } @@ -548,19 +548,6 @@ function addActions(reportID: string, text = '', file?: FileObject) { }, ]; - if (shouldUpdateNotificationPrefernece) { - // optimisticReport.notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS; - successData.push({ - onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: { - participants: { - [currentUserAccountID]: {notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS}, - }, - }, - }); - } - let failureReport: Partial = { lastMessageTranslationKey: '', lastMessageText: '', @@ -2757,7 +2744,7 @@ function joinRoom(report: OnyxEntry) { updateNotificationPreference( report.reportID, ReportUtils.getReportNotificationPreference(report), - CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS, + ReportUtils.getDefaultNotificationPreferenceForReport(report), report.parentReportID, report.parentReportActionID, );