about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorabcang <abcang1015@gmail.com>2017-07-18 22:24:57 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-07-18 15:24:57 +0200
commitafa52e4d636f8fdc4b21b90e4f006d8ea434b4e9 (patch)
tree4456adeb2f76dcc49124b494bafd2831e9132a5d /app/javascript
parent8949aad030f47b89397ecb371f0464926286ab8f (diff)
Fixed issue that the NSFW image is not hidden on detail page (#4244)
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/components/media_gallery.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/javascript/mastodon/components/media_gallery.js b/app/javascript/mastodon/components/media_gallery.js
index 89a358e38..92d7d494e 100644
--- a/app/javascript/mastodon/components/media_gallery.js
+++ b/app/javascript/mastodon/components/media_gallery.js
@@ -183,6 +183,12 @@ export default class MediaGallery extends React.PureComponent {
     visible: !this.props.sensitive,
   };
 
+  componentWillReceiveProps (nextProps) {
+    if (nextProps.sensitive !== this.props.sensitive) {
+      this.setState({ visible: !nextProps.sensitive });
+    }
+  }
+
   handleOpen = () => {
     this.setState({ visible: !this.state.visible });
   }