diff options
author | ThibG <thib@sitedethib.com> | 2020-07-15 21:07:53 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-07-16 14:44:53 +0200 |
commit | f94cb947671add34feb13d8d85a67260d2f699a9 (patch) | |
tree | 4bfd6ec330f01a7187dd643d709eda81137c40a7 /app/javascript | |
parent | 1c6c40d17c233171c6252503df10da72fd039cf6 (diff) |
[Glitch] Fix error when closing a playing audio or video modal
Port bfed7dd5f3127f08ece3070bd67f5737933bac1a to glitch-soc Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/flavours/glitch/features/audio/index.js | 2 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/features/video/index.js | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js index 9cb2307fd..4e85e3c58 100644 --- a/app/javascript/flavours/glitch/features/audio/index.js +++ b/app/javascript/flavours/glitch/features/audio/index.js @@ -283,6 +283,8 @@ class Audio extends React.PureComponent { _renderCanvas () { requestAnimationFrame(() => { + if (!this.audio) return; + this.handleTimeUpdate(); this._clear(); this._draw(); diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index 976cdefc0..cc60a0d2e 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -195,6 +195,8 @@ class Video extends React.PureComponent { _updateTime () { requestAnimationFrame(() => { + if (!this.video) return; + this.handleTimeUpdate(); if (!this.state.paused) { |