-
Notifications
You must be signed in to change notification settings - Fork 3k
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: notification count for empty reports #30133
Changes from 3 commits
b0c9b95
90c915b
15294be
7fba759
208d572
d5391d9
04119fd
b5987fe
1cdb174
50580cb
5bff1bd
59cfe6f
bbe1a98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import _ from 'underscore'; | ||
import Onyx from 'react-native-onyx'; | ||
import Navigation from '../Navigation/Navigation'; | ||
import ONYXKEYS from '../../ONYXKEYS'; | ||
import updateUnread from './updateUnread/index'; | ||
import * as ReportUtils from '../ReportUtils'; | ||
|
@@ -8,7 +9,7 @@ Onyx.connect({ | |
key: ONYXKEYS.COLLECTION.REPORT, | ||
waitForCollectionCallback: true, | ||
callback: (reportsFromOnyx) => { | ||
const unreadReports = _.filter(reportsFromOnyx, ReportUtils.isUnread); | ||
const unreadReports = _.filter(reportsFromOnyx, (report) => ReportUtils.isUnread(report) && ReportUtils.shouldReportBeInOptionList(report, Navigation.getTopmostReportId())); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a short "why?" comment would increase the clarity of this fragment? We could just state that we want to keep notification count consistent with what can be accessed from the LHN list There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
updateUnread(_.size(unreadReports)); | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allroundexperts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot about this. Removed now!