add local setting to auto reveal media behind cw
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,6 +466,7 @@ export default class Status extends ImmutablePureComponent {
|
||||
onOpenVideo={this.handleOpenVideo}
|
||||
width={this.props.cachedMediaWidth}
|
||||
cacheWidth={this.props.cacheMediaWidth}
|
||||
revealed={settings.getIn(['media', 'reveal_behind_cw']) && !!status.get('spoiler_text') ? true : undefined}
|
||||
/>)}
|
||||
</Bundle>
|
||||
);
|
||||
@@ -483,6 +484,7 @@ export default class Status extends ImmutablePureComponent {
|
||||
onOpenMedia={this.props.onOpenMedia}
|
||||
cacheWidth={this.props.cacheMediaWidth}
|
||||
defaultWidth={this.props.cachedMediaWidth}
|
||||
revealed={settings.getIn(['media', 'reveal_behind_cw']) && !!status.get('spoiler_text') ? true : undefined}
|
||||
/>
|
||||
)}
|
||||
</Bundle>
|
||||
|
||||
Reference in New Issue
Block a user