Add preference to always display sensitive media (#6448)
This commit is contained in:
parent
1167c6dbf8
commit
76f3d5d16b
12 changed files with 38 additions and 26 deletions
|
@ -6,7 +6,7 @@ import IconButton from './icon_button';
|
|||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import { isIOS } from '../is_mobile';
|
||||
import classNames from 'classnames';
|
||||
import { autoPlayGif } from '../initial_state';
|
||||
import { autoPlayGif, displaySensitiveMedia } from '../initial_state';
|
||||
|
||||
const messages = defineMessages({
|
||||
toggle_visible: { id: 'media_gallery.toggle_visible', defaultMessage: 'Toggle visibility' },
|
||||
|
@ -187,7 +187,7 @@ export default class MediaGallery extends React.PureComponent {
|
|||
};
|
||||
|
||||
state = {
|
||||
visible: !this.props.sensitive,
|
||||
visible: !this.props.sensitive || displaySensitiveMedia,
|
||||
};
|
||||
|
||||
componentWillReceiveProps (nextProps) {
|
||||
|
|
|
@ -4,6 +4,7 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
|||
import { throttle } from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
import { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/fullscreen';
|
||||
import { displaySensitiveMedia } from '../../initial_state';
|
||||
|
||||
const messages = defineMessages({
|
||||
play: { id: 'video.play', defaultMessage: 'Play' },
|
||||
|
@ -107,7 +108,7 @@ export default class Video extends React.PureComponent {
|
|||
fullscreen: false,
|
||||
hovered: false,
|
||||
muted: false,
|
||||
revealed: !this.props.sensitive,
|
||||
revealed: !this.props.sensitive || displaySensitiveMedia,
|
||||
};
|
||||
|
||||
setPlayerRef = c => {
|
||||
|
|
|
@ -5,6 +5,7 @@ const getMeta = (prop) => initialState && initialState.meta && initialState.meta
|
|||
|
||||
export const reduceMotion = getMeta('reduce_motion');
|
||||
export const autoPlayGif = getMeta('auto_play_gif');
|
||||
export const displaySensitiveMedia = getMeta('display_sensitive_media');
|
||||
export const unfollowModal = getMeta('unfollow_modal');
|
||||
export const boostModal = getMeta('boost_modal');
|
||||
export const deleteModal = getMeta('delete_modal');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue