about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components/media_gallery.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-05-07 15:00:55 +0200
committerThibaut Girka <thib@sitedethib.com>2018-05-07 15:00:55 +0200
commit658ac4396cf1b7cab034701082645747c39f7af2 (patch)
treea45b66d3a626deda3c84c3e163675e1552f7ddb7 /app/javascript/flavours/glitch/components/media_gallery.js
parent6b94237810fefde05b3732ae2d657ce4f342b3b5 (diff)
Hide media in report modal regardless of whether they are marked sensitive
The rationale behind this is that if the user wants to report violent media,
they might not want to see it repeatedly. The “sensitive” property is still
kept, displaying different messages for hidden media depending on whether
they are marked as sensitive.
Diffstat (limited to 'app/javascript/flavours/glitch/components/media_gallery.js')
-rw-r--r--app/javascript/flavours/glitch/components/media_gallery.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/components/media_gallery.js b/app/javascript/flavours/glitch/components/media_gallery.js
index 925132b07..7f5150f7b 100644
--- a/app/javascript/flavours/glitch/components/media_gallery.js
+++ b/app/javascript/flavours/glitch/components/media_gallery.js
@@ -202,6 +202,7 @@ export default class MediaGallery extends React.PureComponent {
 
   static propTypes = {
     sensitive: PropTypes.bool,
+    revealed: PropTypes.bool,
     standalone: PropTypes.bool,
     letterbox: PropTypes.bool,
     fullwidth: PropTypes.bool,
@@ -216,7 +217,7 @@ export default class MediaGallery extends React.PureComponent {
   };
 
   state = {
-    visible: !this.props.sensitive || displaySensitiveMedia,
+    visible: this.props.revealed === undefined ? (!this.props.sensitive || displaySensitiveMedia) : this.props.revealed,
   };
 
   componentWillReceiveProps (nextProps) {