Skip to content

Commit b4b5965

Browse files
authored
Merge pull request #50503 from shubham1206agra/fix-room-join
Fix join rooms notification preference
2 parents 7814eed + 417acc5 commit b4b5965

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/libs/actions/Report.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ function addActions(reportID: string, text = '', file?: FileObject) {
492492

493493
if (shouldUpdateNotificationPrefernece) {
494494
optimisticReport.participants = {
495-
[currentUserAccountID]: {notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS},
495+
[currentUserAccountID]: {notificationPreference: ReportUtils.getDefaultNotificationPreferenceForReport(report)},
496496
};
497497
}
498498

@@ -548,19 +548,6 @@ function addActions(reportID: string, text = '', file?: FileObject) {
548548
},
549549
];
550550

551-
if (shouldUpdateNotificationPrefernece) {
552-
// optimisticReport.notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS;
553-
successData.push({
554-
onyxMethod: Onyx.METHOD.MERGE,
555-
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
556-
value: {
557-
participants: {
558-
[currentUserAccountID]: {notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS},
559-
},
560-
},
561-
});
562-
}
563-
564551
let failureReport: Partial<Report> = {
565552
lastMessageTranslationKey: '',
566553
lastMessageText: '',
@@ -2757,7 +2744,7 @@ function joinRoom(report: OnyxEntry<Report>) {
27572744
updateNotificationPreference(
27582745
report.reportID,
27592746
ReportUtils.getReportNotificationPreference(report),
2760-
CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
2747+
ReportUtils.getDefaultNotificationPreferenceForReport(report),
27612748
report.parentReportID,
27622749
report.parentReportActionID,
27632750
);

0 commit comments

Comments
 (0)