Fix undefined error regression in status component in web UI (#12712)

Regression from #12661
remotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
Eugen Rochko 2019-12-30 03:55:11 +01:00 committed by GitHub
parent 7e074610a6
commit ca78b1473e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 20 deletions

View File

@ -103,11 +103,6 @@ class Status extends ImmutablePureComponent {
statusId: undefined,
};
// Track height changes we know about to compensate scrolling
componentDidMount () {
this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');
}
static getDerivedStateFromProps(nextProps, prevState) {
if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) {
return {
@ -119,21 +114,6 @@ class Status extends ImmutablePureComponent {
}
}
// Compensate height changes
componentDidUpdate (prevProps, prevState, snapshot) {
const doShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');
if (doShowCard && !this.didShowCard) {
this.didShowCard = true;
if (snapshot !== null && this.props.updateScrollBottom) {
if (this.node && this.node.offsetTop < snapshot.top) {
this.props.updateScrollBottom(snapshot.height - snapshot.top);
}
}
}
}
handleToggleMediaVisibility = () => {
this.setState({ showMedia: !this.state.showMedia });
}