about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/video/index.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-06-26 19:33:04 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-06-26 19:33:04 +0200
commit3086c645fde2345d34e401bdf3e2f19f19da3294 (patch)
treeed008141ad3a2b7757c1b70d69419082ac3d4537 /app/javascript/mastodon/features/video/index.js
parent915c619394165a114a4ab316165aecac3386cf2f (diff)
Add option to disable blurhash previews (#11188)
* Add option to disable blurhash previews

* Update option text

* Change options order
Diffstat (limited to 'app/javascript/mastodon/features/video/index.js')
-rw-r--r--app/javascript/mastodon/features/video/index.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/video/index.js b/app/javascript/mastodon/features/video/index.js
index b0c408527..0acdd198d 100644
--- a/app/javascript/mastodon/features/video/index.js
+++ b/app/javascript/mastodon/features/video/index.js
@@ -5,7 +5,7 @@ import { fromJS, is } from 'immutable';
 import { throttle } from 'lodash';
 import classNames from 'classnames';
 import { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/fullscreen';
-import { displayMedia } from '../../initial_state';
+import { displayMedia, useBlurhash } from '../../initial_state';
 import Icon from 'mastodon/components/icon';
 import { decode } from 'blurhash';
 
@@ -298,6 +298,8 @@ class Video extends React.PureComponent {
   }
 
   _decode () {
+    if (!useBlurhash) return;
+
     const hash   = this.props.blurhash;
     const pixels = decode(hash, 32, 32);