Skip to content

Commit

Permalink
Fix breaks when opening a reply tree in WebUI (mastodon#10046)
Browse files Browse the repository at this point in the history
  • Loading branch information
rinsuki authored and Gargron committed Feb 14, 2019
1 parent aa83219 commit f9a338b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/javascript/mastodon/components/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Status extends ImmutablePureComponent {

// Track height changes we know about to compensate scrolling
componentDidMount () {
this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status.get('card');
this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');
}

getSnapshotBeforeUpdate () {
Expand All @@ -99,7 +99,7 @@ class Status extends ImmutablePureComponent {

// Compensate height changes
componentDidUpdate (prevProps, prevState, snapshot) {
const doShowCard = !this.props.muted && !this.props.hidden && this.props.status.get('card');
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) {
Expand Down

0 comments on commit f9a338b

Please sign in to comment.