Skip to content

Commit

Permalink
Remove hidden reports like threads from the global unread count
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Oct 19, 2023
1 parent 20cd522 commit b4c0c1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/UnreadIndicatorUpdater/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import Onyx from 'react-native-onyx';
import ONYXKEYS from '../../ONYXKEYS';
import updateUnread from './updateUnread/index';
import * as ReportUtils from '../ReportUtils';
import CONST from '../../CONST';

Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (reportsFromOnyx) => {
const unreadReports = _.filter(reportsFromOnyx, ReportUtils.isUnread);
const unreadReports = _.filter(reportsFromOnyx, (report) => ReportUtils.isUnread(report) || report.notificationPreference !== CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN);
updateUnread(_.size(unreadReports));
},
});

0 comments on commit b4c0c1d

Please sign in to comment.