diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js index 89a358e384c..92d7d494e10 100644 --- a/app/javascript/mastodon/components/media_gallery.js +++ b/app/javascript/mastodon/components/media_gallery.js @@ -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 }); }