From 9cdd517849d5f06141d7c3d84503a3365506e455 Mon Sep 17 00:00:00 2001 From: abcang Date: Sun, 24 Sep 2017 18:15:11 +0900 Subject: [PATCH] Fix media spoiler of DetailedStatus (#5071) --- app/javascript/mastodon/components/media_gallery.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js index d84e4229c9..52b34971b4 100644 --- a/app/javascript/mastodon/components/media_gallery.js +++ b/app/javascript/mastodon/components/media_gallery.js @@ -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'; @@ -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 }); } }