Don't hijack scrollbar when status is unmounted, fixes #404

This commit is contained in:
Alex Gleason 2020-09-09 14:35:04 -05:00
parent 8c137b0c3c
commit 3631d6d61d
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -151,14 +151,16 @@ class Status extends ImmutablePureComponent {
} }
componentWillUnmount() { componentWillUnmount() {
if (this.node && this.props.getScrollPosition) { // FIXME: Run this code only when a status is being deleted.
const position = this.props.getScrollPosition(); //
if (position !== null && this.node.offsetTop < position.top) { // if (this.node && this.props.getScrollPosition) {
requestAnimationFrame(() => { // const position = this.props.getScrollPosition();
this.props.updateScrollBottom(position.height - position.top); // if (position !== null && this.node.offsetTop < position.top) {
}); // requestAnimationFrame(() => {
} // this.props.updateScrollBottom(position.height - position.top);
} // });
// }
// }
} }
handleToggleMediaVisibility = () => { handleToggleMediaVisibility = () => {