logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: afa52e4d636f8fdc4b21b90e4f006d8ea434b4e9
parent: 8949aad030f47b89397ecb371f0464926286ab8f
Author: abcang <abcang1015@gmail.com>
Date:   Tue, 18 Jul 2017 22:24:57 +0900

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


Diffstat:

Mapp/javascript/mastodon/components/media_gallery.js6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git 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 }); }