Skip to content
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
3 changes: 0 additions & 3 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import * as Environment from '@libs/Environment/Environment';
import * as ErrorUtils from '@libs/ErrorUtils';
import Log from '@libs/Log';
import Navigation from '@libs/Navigation/Navigation';
import clearReportNotifications from '@libs/Notification/clearReportNotifications';
import LocalNotification from '@libs/Notification/LocalNotification';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils';
Expand Down Expand Up @@ -475,8 +474,6 @@ function openReport(
return;
}

clearReportNotifications(reportID);

const optimisticReport = reportActionsExist(reportID)
? {}
: {
Expand Down
20 changes: 10 additions & 10 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,17 +291,17 @@ function ReportScreen({
[route],
);

// Clear notifications for the current report when the app is focused
useAppFocusEvent(
useCallback(() => {
// Check if this is the top-most ReportScreen since the Navigator preserves multiple at a time
if (!isTopMostReportId) {
return;
}
// Clear notifications for the current report when it's opened and re-focused
const clearNotifications = useCallback(() => {
// Check if this is the top-most ReportScreen since the Navigator preserves multiple at a time
if (!isTopMostReportId) {
return;
}

clearReportNotifications(report.reportID);
}, [report.reportID, isTopMostReportId]),
);
clearReportNotifications(report.reportID);
}, [report.reportID, isTopMostReportId]);
useEffect(clearNotifications, [clearNotifications]);
useAppFocusEvent(clearNotifications);

useEffect(() => {
Timing.end(CONST.TIMING.CHAT_RENDER);
Expand Down