about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-08-02 22:29:17 +0200
committerThibaut Girka <thib@sitedethib.com>2020-08-02 22:29:17 +0200
commitb578d709570508ea119056e7b65c289390b58887 (patch)
treeecdd7c7ea4a09c8a733fab02d9b2ea39e4eeaf4c /app/javascript
parent141ac8db8b98230188b13f1da801611bcdc6a9f1 (diff)
parent8ce962e14819c55f3772076fb0cb57cf1476b7f1 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/features/audio/index.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/javascript/mastodon/features/audio/index.js b/app/javascript/mastodon/features/audio/index.js
index a4e00ba96..5b8172694 100644
--- a/app/javascript/mastodon/features/audio/index.js
+++ b/app/javascript/mastodon/features/audio/index.js
@@ -115,6 +115,10 @@ class Audio extends React.PureComponent {
   }
 
   togglePlay = () => {
+    if (!this.audioContext) {
+      this._initAudioContext();
+    }
+
     if (this.state.paused) {
       this.setState({ paused: false }, () => this.audio.play());
     } else {
@@ -133,10 +137,6 @@ class Audio extends React.PureComponent {
   handlePlay = () => {
     this.setState({ paused: false });
 
-    if (this.canvas && !this.audioContext) {
-      this._initAudioContext();
-    }
-
     if (this.audioContext && this.audioContext.state === 'suspended') {
       this.audioContext.resume();
     }