Fix front-end crash when a video has a blurhash and is hidden behind a CW

master
Thibaut Girka 6 years ago committed by ThibG
parent 89d2859296
commit 2c767f44bf
  1. 6
      app/javascript/flavours/glitch/features/video/index.js

@ -166,6 +166,10 @@ export default class Video extends React.PureComponent {
setCanvasRef = c => {
this.canvas = c;
if (c && this.props.blurhash) {
this._decode();
}
}
handleMouseDownRoot = e => {
@ -310,6 +314,8 @@ export default class Video extends React.PureComponent {
}
_decode () {
if (!this.canvas) return;
const hash = this.props.blurhash;
const pixels = decode(hash, 32, 32);

Loading…
Cancel
Save