diff options
author | ThibG <thib@sitedethib.com> | 2020-07-15 21:07:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-15 21:07:53 +0200 |
commit | bfed7dd5f3127f08ece3070bd67f5737933bac1a (patch) | |
tree | 1475db20ee48561da82e8fb5cc78592e14294248 /app/javascript | |
parent | 6f798eb574e8521c3ac4ab01248e99a77509a72e (diff) |
Fix error when closing a playing audio or video modal (#14310)
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/mastodon/features/audio/index.js | 2 | ||||
-rw-r--r-- | app/javascript/mastodon/features/video/index.js | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/audio/index.js b/app/javascript/mastodon/features/audio/index.js index 2f85ebb7e..1ab1c3117 100644 --- a/app/javascript/mastodon/features/audio/index.js +++ b/app/javascript/mastodon/features/audio/index.js @@ -298,6 +298,8 @@ class Audio extends React.PureComponent { _renderCanvas () { requestAnimationFrame(() => { + if (!this.audio) return; + this.handleTimeUpdate(); this._clear(); this._draw(); diff --git a/app/javascript/mastodon/features/video/index.js b/app/javascript/mastodon/features/video/index.js index fb12567f0..99dcdca22 100644 --- a/app/javascript/mastodon/features/video/index.js +++ b/app/javascript/mastodon/features/video/index.js @@ -182,6 +182,8 @@ class Video extends React.PureComponent { _updateTime () { requestAnimationFrame(() => { + if (!this.video) return; + this.handleTimeUpdate(); if (!this.state.paused) { |