Skip to content

Commit

Permalink
Fix media spoiler of DetailedStatus (mastodon#5071)
Browse files Browse the repository at this point in the history
  • Loading branch information
abcang authored and Gargron committed Sep 24, 2017
1 parent a0bbeaf commit e756c4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/javascript/mastodon/components/media_gallery.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { is } from 'immutable';
import IconButton from './icon_button';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { isIOS } from '../is_mobile';
Expand Down Expand Up @@ -196,7 +197,7 @@ export default class MediaGallery extends React.PureComponent {
};

componentWillReceiveProps (nextProps) {
if (nextProps.sensitive !== this.props.sensitive) {
if (!is(nextProps.media, this.props.media)) {
this.setState({ visible: !nextProps.sensitive });
}
}
Expand Down

0 comments on commit e756c4f

Please sign in to comment.