Browse Source

Fixed issue that the NSFW image is not hidden on detail page (#4244)

master
abcang 7 years ago
committed by Eugen Rochko
parent
commit
afa52e4d63
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      app/javascript/mastodon/components/media_gallery.js

+ 6
- 0
app/javascript/mastodon/components/media_gallery.js View File

@ -183,6 +183,12 @@ export default class MediaGallery extends React.PureComponent {
visible: !this.props.sensitive, visible: !this.props.sensitive,
}; };
componentWillReceiveProps (nextProps) {
if (nextProps.sensitive !== this.props.sensitive) {
this.setState({ visible: !nextProps.sensitive });
}
}
handleOpen = () => { handleOpen = () => {
this.setState({ visible: !this.state.visible }); this.setState({ visible: !this.state.visible });
} }

Loading…
Cancel
Save