diff options
Diffstat (limited to 'app/javascript/mastodon/components/status.js')
-rw-r--r-- | app/javascript/mastodon/components/status.js | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 8102d1e06..a918a94f8 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -37,16 +37,13 @@ export default class Status extends ImmutablePureComponent { onBlock: PropTypes.func, onEmbed: PropTypes.func, onHeightChange: PropTypes.func, + onToggleHidden: PropTypes.func, muted: PropTypes.bool, hidden: PropTypes.bool, onMoveUp: PropTypes.func, onMoveDown: PropTypes.func, }; - state = { - isExpanded: false, - } - // Avoid checking props that are functions (and whose equality will always // evaluate to false. See react-immutable-pure-component for usage. updateOnProps = [ @@ -56,8 +53,6 @@ export default class Status extends ImmutablePureComponent { 'hidden', ] - updateOnStates = ['isExpanded'] - handleClick = () => { if (!this.context.router) { return; @@ -76,7 +71,7 @@ export default class Status extends ImmutablePureComponent { } handleExpandedToggle = () => { - this.setState({ isExpanded: !this.state.isExpanded }); + this.props.onToggleHidden(this._properStatus()); }; renderLoadingMediaGallery () { @@ -140,7 +135,6 @@ export default class Status extends ImmutablePureComponent { let statusAvatar, prepend; const { hidden, featured } = this.props; - const { isExpanded } = this.state; let { status, account, ...other } = this.props; @@ -248,7 +242,7 @@ export default class Status extends ImmutablePureComponent { </a> </div> - <StatusContent status={status} onClick={this.handleClick} expanded={isExpanded} onExpandedToggle={this.handleExpandedToggle} /> + <StatusContent status={status} onClick={this.handleClick} expanded={!status.get('hidden')} onExpandedToggle={this.handleExpandedToggle} /> {media} |