Skip to content

Commit

Permalink
Merge pull request #50503 from shubham1206agra/fix-room-join
Browse files Browse the repository at this point in the history
Fix join rooms notification preference
  • Loading branch information
lakchote authored Oct 15, 2024
2 parents 7814eed + 417acc5 commit b4b5965
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)},
};
}

Expand Down Expand Up @@ -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<Report> = {
lastMessageTranslationKey: '',
lastMessageText: '',
Expand Down Expand Up @@ -2757,7 +2744,7 @@ function joinRoom(report: OnyxEntry<Report>) {
updateNotificationPreference(
report.reportID,
ReportUtils.getReportNotificationPreference(report),
CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
ReportUtils.getDefaultNotificationPreferenceForReport(report),
report.parentReportID,
report.parentReportActionID,
);
Expand Down

0 comments on commit b4b5965

Please sign in to comment.