about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-06-26 19:33:04 +0200
committerThibaut Girka <thib@sitedethib.com>2019-06-26 23:19:26 +0200
commit4175f131557f3633d38e78692698469c3652e398 (patch)
treeeb3844f56783fe8b7a5ca6f45c424eee4ec406df /app/javascript/flavours/glitch/components
parent383136d9bb290ebca7d8414b151c14d6038d5bc3 (diff)
[Glitch] Add option to disable blurhash previews
Port 3086c645fde2345d34e401bdf3e2f19f19da3294 to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r--app/javascript/flavours/glitch/components/media_gallery.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/components/media_gallery.js b/app/javascript/flavours/glitch/components/media_gallery.js
index 291caff45..04d3ce751 100644
--- a/app/javascript/flavours/glitch/components/media_gallery.js
+++ b/app/javascript/flavours/glitch/components/media_gallery.js
@@ -6,7 +6,7 @@ import IconButton from './icon_button';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 import { isIOS } from 'flavours/glitch/util/is_mobile';
 import classNames from 'classnames';
-import { autoPlayGif, displayMedia } from 'flavours/glitch/util/initial_state';
+import { autoPlayGif, displayMedia, useBlurhash } from 'flavours/glitch/util/initial_state';
 import { decode } from 'blurhash';
 
 const messages = defineMessages({
@@ -101,6 +101,8 @@ class Item extends React.PureComponent {
   }
 
   _decode () {
+    if (!useBlurhash) return;
+
     const hash   = this.props.attachment.get('blurhash');
     const pixels = decode(hash, 32, 32);