Fix breaks when opening a reply tree in WebUI (#10046)

fix #10045
lolsob-rspec
rinsuki 2019-02-15 01:03:01 +09:00 committed by Eugen Rochko
parent dae31d8799
commit 1a12ef6099
1 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ class Status extends ImmutablePureComponent {
// Track height changes we know about to compensate scrolling // Track height changes we know about to compensate scrolling
componentDidMount () { 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 () { getSnapshotBeforeUpdate () {
@ -99,7 +99,7 @@ class Status extends ImmutablePureComponent {
// Compensate height changes // Compensate height changes
componentDidUpdate (prevProps, prevState, snapshot) { 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) { if (doShowCard && !this.didShowCard) {
this.didShowCard = true; this.didShowCard = true;
if (snapshot !== null && this.props.updateScrollBottom) { if (snapshot !== null && this.props.updateScrollBottom) {