-
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 chat doesn't scroll to bottom when adding message while linked to an old action #46724
Changes from all commits
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 | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -364,12 +364,16 @@ function ReportActionsList({ | |||||||||||||||
(isFromCurrentUser: boolean) => { | ||||||||||||||||
// If a new comment is added and it's from the current user scroll to the bottom otherwise leave the user positioned where | ||||||||||||||||
// they are now in the list. | ||||||||||||||||
if (!isFromCurrentUser || !hasNewestReportActionRef.current) { | ||||||||||||||||
if (!isFromCurrentUser) { | ||||||||||||||||
return; | ||||||||||||||||
} | ||||||||||||||||
if (!hasNewestReportActionRef.current) { | ||||||||||||||||
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID)); | ||||||||||||||||
return; | ||||||||||||||||
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. Do we need return here ? 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. I'm trying to follow the same logic of scrollToBottomAndMarkReportAsRead. App/src/pages/home/report/ReportActionsList.tsx Lines 415 to 421 in 55a29dd
I guess we need to hold for #46627 then 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. Hmmm, yeah 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. @bernhardoj And I think we should update the description and add new videos for this PR 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 (except native because pressing the send button crashes the iOS and doesn't work on Android, on mWeb disabling strict mode makes it work again). ios.mp4There 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. I'm more talking about why scrolling doesn't work on Android native when go back to the main chat and send message 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. Oh, just reinstalled android app 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. Let me try it 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. Nice, it works. Completed recordings 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. Great job |
||||||||||||||||
} | ||||||||||||||||
InteractionManager.runAfterInteractions(() => reportScrollManager.scrollToBottom()); | ||||||||||||||||
}, | ||||||||||||||||
[reportScrollManager], | ||||||||||||||||
[reportScrollManager, report.reportID], | ||||||||||||||||
); | ||||||||||||||||
useEffect(() => { | ||||||||||||||||
// Why are we doing this, when in the cleanup of the useEffect we are already calling the unsubscribe function? | ||||||||||||||||
|
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.
We are missing handling the case when the chat is on RHN, which caused this issue with the report on RHN navigating to the center.