Revert "optimize timeline scroll performance"
This commit is contained in:
parent
827dc66220
commit
1c9651f557
1 changed files with 4 additions and 19 deletions
|
@ -399,14 +399,12 @@ export class Timeline extends React.Component<
|
||||||
const newestBottomVisibleMessageId =
|
const newestBottomVisibleMessageId =
|
||||||
getMessageIdFromElement(newestBottomVisible);
|
getMessageIdFromElement(newestBottomVisible);
|
||||||
|
|
||||||
this.updatePartiallyVisibleMessageIds(
|
this.setState({
|
||||||
oldestPartiallyVisibleMessageId,
|
oldestPartiallyVisibleMessageId,
|
||||||
newestBottomVisibleMessageId
|
newestBottomVisibleMessageId,
|
||||||
);
|
});
|
||||||
|
|
||||||
if (this.props.isNearBottom !== newIsNearBottom) {
|
setIsNearBottom(id, newIsNearBottom);
|
||||||
setIsNearBottom(id, newIsNearBottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newestBottomVisibleMessageId) {
|
if (newestBottomVisibleMessageId) {
|
||||||
this.markNewestBottomVisibleMessageRead();
|
this.markNewestBottomVisibleMessageRead();
|
||||||
|
@ -463,19 +461,6 @@ export class Timeline extends React.Component<
|
||||||
this.intersectionObserver.observe(atBottomDetectorEl);
|
this.intersectionObserver.observe(atBottomDetectorEl);
|
||||||
}
|
}
|
||||||
|
|
||||||
private updatePartiallyVisibleMessageIds = throttle(
|
|
||||||
(
|
|
||||||
oldestPartiallyVisibleMessageId: string | undefined,
|
|
||||||
newestBottomVisibleMessageId: string | undefined
|
|
||||||
) => {
|
|
||||||
this.setState({
|
|
||||||
oldestPartiallyVisibleMessageId,
|
|
||||||
newestBottomVisibleMessageId,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
100
|
|
||||||
);
|
|
||||||
|
|
||||||
private markNewestBottomVisibleMessageRead = throttle((): void => {
|
private markNewestBottomVisibleMessageRead = throttle((): void => {
|
||||||
const { id, markMessageRead } = this.props;
|
const { id, markMessageRead } = this.props;
|
||||||
const { newestBottomVisibleMessageId } = this.state;
|
const { newestBottomVisibleMessageId } = this.state;
|
||||||
|
|
Loading…
Reference in a new issue