-
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 "New messages" banner shows up every time sending a message in a chat #44724
Changes from all commits
eebf281
391e4f6
4e24f27
57edf6c
fc6420e
2762037
7a29255
8c427a2
8acb474
1d6de85
f93774e
d0fddfe
62cf228
0608ee8
126d3ce
76d15b5
f7ec477
c923fac
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 |
---|---|---|
|
@@ -271,7 +271,9 @@ function ReportActionsList({ | |
const isFromNotification = route?.params?.referrer === CONST.REFERRER.NOTIFICATION; | ||
if ((Visibility.isVisible() || isFromNotification) && scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD) { | ||
Report.readNewestAction(report.reportID); | ||
Navigation.setParams({referrer: undefined}); | ||
if (isFromNotification) { | ||
Navigation.setParams({referrer: undefined}); | ||
} | ||
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. This also fixes the test of UnreadIndicatorsTest. When the test runner opens the report screen, if it's unread (which is true), it will call both functions above to mark the report as read and remove the When the referrer param is updated, the report screen is re-mounted (on test only), but the readNewestAction optimisticData isn't completed yet and triggers the above logic again, repeatedly, infinitely. This doesn't happen when we still use withOnyx, specifically the I think the best solution is to clear the Given the re-mount behavior when updating param is only occurs on test, I updated the code to only clears it when |
||
} else { | ||
readActionSkipped.current = true; | ||
} | ||
|
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.
This fixes the reassure extra render count. This effect is run on mount and on
menuItems
prop update.enteredSubMenuIndexes
initial value is[]
and we update it to[]
which has different references. UsingCONST.EMPTY_ARRAY
so it has stable references.