소스 검색

fix(status_list): Guard against missing ref (#4353)

master
Sorin Davidoi 6 년 전
committed by Eugen Rochko
부모
커밋
696bcff6bf
1개의 변경된 파일12개의 추가작업 그리고 10개의 파일을 삭제
  1. +12
    -10
      app/javascript/mastodon/components/status_list.js

+ 12
- 10
app/javascript/mastodon/components/status_list.js 파일 보기

@@ -31,16 +31,18 @@ export default class StatusList extends ImmutablePureComponent {
intersectionObserverWrapper = new IntersectionObserverWrapper();

handleScroll = debounce(() => {
const { scrollTop, scrollHeight, clientHeight } = this.node;
const offset = scrollHeight - scrollTop - clientHeight;
this._oldScrollPosition = scrollHeight - scrollTop;

if (250 > offset && this.props.onScrollToBottom && !this.props.isLoading) {
this.props.onScrollToBottom();
} else if (scrollTop < 100 && this.props.onScrollToTop) {
this.props.onScrollToTop();
} else if (this.props.onScroll) {
this.props.onScroll();
if (this.node) {
const { scrollTop, scrollHeight, clientHeight } = this.node;
const offset = scrollHeight - scrollTop - clientHeight;
this._oldScrollPosition = scrollHeight - scrollTop;

if (250 > offset && this.props.onScrollToBottom && !this.props.isLoading) {
this.props.onScrollToBottom();
} else if (scrollTop < 100 && this.props.onScrollToTop) {
this.props.onScrollToTop();
} else if (this.props.onScroll) {
this.props.onScroll();
}
}
}, 200, {
trailing: true,


불러오는 중...
취소
저장