diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-02-15 17:13:32 +0100 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2019-02-15 17:34:15 +0100 |
commit | 2769b5446681898e8332cb505f499dac2a6e5717 (patch) | |
tree | 7b5408504b56a187fb909eb124938b19593e796e /app/javascript/flavours/glitch/components | |
parent | 435a367c108047170dc752ef766a4264dd90b5c8 (diff) |
[Glitch] Fix occasional crash in detailed toot view
Port f9a338b473e181dd725f9185d09394624088efac to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r-- | app/javascript/flavours/glitch/components/status.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 51fee0eec..349f9c6cc 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -217,7 +217,7 @@ export default class Status extends ImmutablePureComponent { this.setState({ autoCollapsed: true }); } - this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status.get('card') && this.props.settings.get('inline_preview_cards'); + this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card') && this.props.settings.get('inline_preview_cards'); } getSnapshotBeforeUpdate (prevProps, prevState) { @@ -230,7 +230,7 @@ export default class Status extends ImmutablePureComponent { // Hack to fix timeline jumps on second rendering when auto-collapsing componentDidUpdate (prevProps, prevState, snapshot) { - const doShowCard = !this.props.muted && !this.props.hidden && this.props.status.get('card') && this.props.settings.get('inline_preview_cards'); + const doShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card') && this.props.settings.get('inline_preview_cards'); if (this.state.autoCollapsed || (doShowCard && !this.didShowCard)) { if (doShowCard) this.didShowCard = true; if (this.state.autoCollapsed) this.setState({ autoCollapsed: false }); |