mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix undefined error regression in status component in web UI (#12712)
Regression from #12661
This commit is contained in:
parent
7e074610a6
commit
ca78b1473e
@ -103,11 +103,6 @@ class Status extends ImmutablePureComponent {
|
|||||||
statusId: undefined,
|
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) {
|
static getDerivedStateFromProps(nextProps, prevState) {
|
||||||
if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) {
|
if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) {
|
||||||
return {
|
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 = () => {
|
handleToggleMediaVisibility = () => {
|
||||||
this.setState({ showMedia: !this.state.showMedia });
|
this.setState({ showMedia: !this.state.showMedia });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user