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

lolsob-rspec
Sorin Davidoi 2017-07-25 02:13:05 +02:00 committed by Eugen Rochko
parent 1c9aac4878
commit 348994c2de
1 changed files with 11 additions and 9 deletions

View File

@ -31,6 +31,7 @@ export default class StatusList extends ImmutablePureComponent {
intersectionObserverWrapper = new IntersectionObserverWrapper();
handleScroll = debounce(() => {
if (this.node) {
const { scrollTop, scrollHeight, clientHeight } = this.node;
const offset = scrollHeight - scrollTop - clientHeight;
this._oldScrollPosition = scrollHeight - scrollTop;
@ -42,6 +43,7 @@ export default class StatusList extends ImmutablePureComponent {
} else if (this.props.onScroll) {
this.props.onScroll();
}
}
}, 200, {
trailing: true,
});