Skip to content

Commit

Permalink
Fixed issue that the NSFW image is not hidden on detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
abcang committed Jul 18, 2017
1 parent 7f43758 commit e809009
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/javascript/mastodon/components/media_gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ export default class MediaGallery extends React.PureComponent {
visible: !this.props.sensitive,
};

componentWillReceiveProps (nextProps) {
if (nextProps.sensitive !== this.props.sensitive) {
this.setState({ visible: !nextProps.sensitive });
}
}

handleOpen = () => {
this.setState({ visible: !this.state.visible });
}
Expand Down

0 comments on commit e809009

Please sign in to comment.