From 47db9f5d96282511d0c25fade55d5e7f9d40a5fd Mon Sep 17 00:00:00 2001 From: Shubham Agrawal Date: Wed, 9 Oct 2024 18:58:32 +0530 Subject: [PATCH] Fix join rooms notification preference --- src/libs/actions/Report.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 95bd2aa0b834..d479ba72a35d 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, );