Skip to content

Commit

Permalink
Merge pull request #30013 from Expensify/marcaaron-fixGlobalUnreadInd…
Browse files Browse the repository at this point in the history
…icator

Remove hidden reports like threads from the global unread count
  • Loading branch information
marcaaron authored Oct 26, 2023
2 parents d46a691 + 8084b25 commit e47a256
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 e47a256

Please sign in to comment.