From: abcang Date: Tue, 18 Jul 2017 13:24:57 +0000 (+0900) Subject: Fixed issue that the NSFW image is not hidden on detail page (#4244) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=afa52e4d636f8fdc4b21b90e4f006d8ea434b4e9;p=mastodon.git Fixed issue that the NSFW image is not hidden on detail page (#4244) --- diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js index 89a358e38..92d7d494e 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 }); }