Revert "optimize timeline scroll performance"
This commit is contained in:
@@ -399,14 +399,12 @@ export class Timeline extends React.Component<
|
||||
const newestBottomVisibleMessageId =
|
||||
getMessageIdFromElement(newestBottomVisible);
|
||||
|
||||
this.updatePartiallyVisibleMessageIds(
|
||||
this.setState({
|
||||
oldestPartiallyVisibleMessageId,
|
||||
newestBottomVisibleMessageId
|
||||
);
|
||||
newestBottomVisibleMessageId,
|
||||
});
|
||||
|
||||
if (this.props.isNearBottom !== newIsNearBottom) {
|
||||
setIsNearBottom(id, newIsNearBottom);
|
||||
}
|
||||
setIsNearBottom(id, newIsNearBottom);
|
||||
|
||||
if (newestBottomVisibleMessageId) {
|
||||
this.markNewestBottomVisibleMessageRead();
|
||||
@@ -463,19 +461,6 @@ export class Timeline extends React.Component<
|
||||
this.intersectionObserver.observe(atBottomDetectorEl);
|
||||
}
|
||||
|
||||
private updatePartiallyVisibleMessageIds = throttle(
|
||||
(
|
||||
oldestPartiallyVisibleMessageId: string | undefined,
|
||||
newestBottomVisibleMessageId: string | undefined
|
||||
) => {
|
||||
this.setState({
|
||||
oldestPartiallyVisibleMessageId,
|
||||
newestBottomVisibleMessageId,
|
||||
});
|
||||
},
|
||||
100
|
||||
);
|
||||
|
||||
private markNewestBottomVisibleMessageRead = throttle((): void => {
|
||||
const { id, markMessageRead } = this.props;
|
||||
const { newestBottomVisibleMessageId } = this.state;
|
||||
|
Reference in New Issue
Block a user