about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-07-08 15:23:41 +0200
committerThibaut Girka <thib@sitedethib.com>2020-07-08 15:23:41 +0200
commitde938023abba01ca36eeac6f3bc0203121157116 (patch)
tree3b7bdb2b7ede0571177e8d90f130e8e4ca394597 /app
parentc41da2e96294dc24ba7e039cd3151916fff664db (diff)
parent0d2135a46172fd6931f757ef083ad99f4522081d (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app')
-rw-r--r--app/javascript/mastodon/features/audio/index.js2
-rw-r--r--app/javascript/mastodon/features/status/components/card.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/javascript/mastodon/features/audio/index.js b/app/javascript/mastodon/features/audio/index.js
index 686709ac3..f0cd79873 100644
--- a/app/javascript/mastodon/features/audio/index.js
+++ b/app/javascript/mastodon/features/audio/index.js
@@ -103,7 +103,7 @@ class Audio extends React.PureComponent {
   }
 
   componentDidUpdate (prevProps, prevState) {
-    if (prevProps.src !== this.props.src || this.state.width !== prevState.width || this.state.height !== prevState.height) {
+    if (prevProps.src !== this.props.src || this.state.width !== prevState.width || this.state.height !== prevState.height || prevProps.accentColor !== this.props.accentColor) {
       this._clear();
       this._draw();
     }
diff --git a/app/javascript/mastodon/features/status/components/card.js b/app/javascript/mastodon/features/status/components/card.js
index 0af7c54e4..971682df8 100644
--- a/app/javascript/mastodon/features/status/components/card.js
+++ b/app/javascript/mastodon/features/status/components/card.js
@@ -94,7 +94,7 @@ export default class Card extends React.PureComponent {
   componentDidMount () {
     window.addEventListener('resize', this.handleResize, { passive: true });
 
-    if (this.props.card && this.props.card.get('blurhash')) {
+    if (this.props.card && this.props.card.get('blurhash') && this.canvas) {
       this._decode();
     }
   }
@@ -106,7 +106,7 @@ export default class Card extends React.PureComponent {
   componentDidUpdate (prevProps) {
     const { card } = this.props;
 
-    if (card.get('blurhash') && (!prevProps.card || prevProps.card.get('blurhash') !== card.get('blurhash'))) {
+    if (card.get('blurhash') && (!prevProps.card || prevProps.card.get('blurhash') !== card.get('blurhash')) && this.canvas) {
       this._decode();
     }
   }