add local setting to auto reveal media behind cw

This commit is contained in:
ash lea
2019-03-10 15:34:51 -04:00
committed by ThibG
parent 1bf035fb67
commit f534f4869e
6 changed files with 23 additions and 3 deletions

View File

@@ -238,7 +238,8 @@ export default class MediaGallery extends React.PureComponent {
};
componentWillReceiveProps (nextProps) {
if (!is(nextProps.media, this.props.media)) {
console.log(nextProps.revealed);
if (!is(nextProps.media, this.props.media) || nextProps.revealed === true) {
this.setState({ visible: nextProps.revealed === undefined ? (displayMedia !== 'hide_all' && !nextProps.sensitive || displayMedia === 'show_all') : nextProps.revealed });
}
}