Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: default notification to be hidden for new chat #43638

Merged
merged 6 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4605,7 +4605,13 @@ function buildOptimisticChatReport(
return optimisticChatReport;
}

function buildOptimisticGroupChatReport(participantAccountIDs: number[], reportName: string, avatarUri: string, optimisticReportID?: string) {
function buildOptimisticGroupChatReport(
participantAccountIDs: number[],
reportName: string,
avatarUri: string,
optimisticReportID?: string,
notificationPreference?: NotificationPreference,
) {
return buildOptimisticChatReport(
participantAccountIDs,
reportName,
Expand All @@ -4616,7 +4622,7 @@ function buildOptimisticGroupChatReport(participantAccountIDs: number[], reportN
undefined,
undefined,
undefined,
undefined,
notificationPreference,
undefined,
undefined,
undefined,
Expand Down
15 changes: 13 additions & 2 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -974,9 +974,20 @@ function navigateToAndOpenReport(
if (isEmptyObject(chat)) {
if (isGroupChat) {
// If we are creating a group chat then participantAccountIDs is expected to contain currentUserAccountID
newChat = ReportUtils.buildOptimisticGroupChatReport(participantAccountIDs, reportName ?? '', avatarUri ?? '', optimisticReportID);
newChat = ReportUtils.buildOptimisticGroupChatReport(participantAccountIDs, reportName ?? '', avatarUri ?? '', optimisticReportID, CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN);
dominictb marked this conversation as resolved.
Show resolved Hide resolved
} else {
newChat = ReportUtils.buildOptimisticChatReport([...participantAccountIDs, currentUserAccountID]);
newChat = ReportUtils.buildOptimisticChatReport(
[...participantAccountIDs, currentUserAccountID],
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
);
}
}
const report = isEmptyObject(chat) ? newChat : chat;
Expand Down
Loading