-
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 #43021
Changes from all commits
0c7c71d
276b5fd
d4e7d5d
5975d53
9a3491b
7fcaeca
9e034c7
5a8f69a
2abf605
9a8a96b
9f7ea10
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 |
---|---|---|
|
@@ -210,12 +210,9 @@ function ReportActionsList({ | |
[sortedReportActions, isOffline], | ||
); | ||
|
||
// whisper action doesn't affect lastVisibleActionCreated, so we should not take it into account while checking if there is the newest report action | ||
const newestVisibleReportAction = useMemo(() => sortedVisibleReportActions.find((item) => !ReportActionsUtils.isWhisperAction(item)) ?? null, [sortedVisibleReportActions]); | ||
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 believe it's a back-end bug. After we start s split bill, BE doesn't return the updated ![]() So I removed this change from this PR. If not when we reload this report and send any action like message, expense, ... the chat will not scroll to the bottom 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. @mountiny Do you know why it is different on backend? The comment says that whisper does not affect the 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. Is this for the same account that created the split bill request? If so, we should use the whisper 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. Commented in Slack 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. Following along because I'm the BZ team member on #41188. Do you all feel that a regression was introduced in that issue? It's due to be paid out, but I will hold on that if there's a regression. 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. There was no regression as such. 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. Awesome. Thanks, @parasharrajat! |
||
|
||
const lastActionIndex = sortedVisibleReportActions[0]?.reportActionID; | ||
const reportActionSize = useRef(sortedVisibleReportActions.length); | ||
const hasNewestReportAction = newestVisibleReportAction?.created === report.lastVisibleActionCreated; | ||
const hasNewestReportAction = sortedVisibleReportActions[0]?.created === report.lastVisibleActionCreated; | ||
const hasNewestReportActionRef = useRef(hasNewestReportAction); | ||
hasNewestReportActionRef.current = hasNewestReportAction; | ||
const previousLastIndex = useRef(lastActionIndex); | ||
|
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.
Mutating the object early here may have caused a regression: #54528
For more details, check: #54528 (comment)