1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Fix media spoiler of DetailedStatus (#5071)

This commit is contained in:
abcang 2017-09-24 18:15:11 +09:00 committed by Eugen Rochko
parent a0bbeafb04
commit e756c4f5ec

View file

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { is } from 'immutable';
import IconButton from './icon_button'; import IconButton from './icon_button';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { isIOS } from '../is_mobile'; import { isIOS } from '../is_mobile';
@ -196,7 +197,7 @@ export default class MediaGallery extends React.PureComponent {
}; };
componentWillReceiveProps (nextProps) { componentWillReceiveProps (nextProps) {
if (nextProps.sensitive !== this.props.sensitive) { if (!is(nextProps.media, this.props.media)) {
this.setState({ visible: !nextProps.sensitive }); this.setState({ visible: !nextProps.sensitive });
} }
} }