]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix error when closing a playing audio or video modal
authorThibG <thib@sitedethib.com>
Wed, 15 Jul 2020 19:07:53 +0000 (21:07 +0200)
committerThibaut Girka <thib@sitedethib.com>
Thu, 16 Jul 2020 12:44:53 +0000 (14:44 +0200)
Port bfed7dd5f3127f08ece3070bd67f5737933bac1a to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
app/javascript/flavours/glitch/features/audio/index.js
app/javascript/flavours/glitch/features/video/index.js

index 9cb2307fdab1ae7228efb8f88b98d76161db75bf..4e85e3c58184ad0e1508021882c4529b8a782720 100644 (file)
@@ -283,6 +283,8 @@ class Audio extends React.PureComponent {
 
   _renderCanvas () {
     requestAnimationFrame(() => {
+      if (!this.audio) return;
+
       this.handleTimeUpdate();
       this._clear();
       this._draw();
index 976cdefc0add7c9ebd88eb741afc474d5a153305..cc60a0d2eb9d430a4e8a95cc3b2889f3db1a233a 100644 (file)
@@ -195,6 +195,8 @@ class Video extends React.PureComponent {
 
   _updateTime () {
     requestAnimationFrame(() => {
+      if (!this.video) return;
+
       this.handleTimeUpdate();
 
       if (!this.state.paused) {