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

lolsob-rspec
abcang 2017-07-18 22:24:57 +09:00 committed by Eugen Rochko
parent fe4429446f
commit c5cd48bff7
1 changed files with 6 additions and 0 deletions

View File

@ -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 });
}