diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-08-02 19:25:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-02 19:25:10 -0400 |
commit | edb0aaf6b4fbaed298f81778ced68990ab4f5b9a (patch) | |
tree | 977cd3e1f74f99014b274fb7009fd1aab8fadd77 /ext/js/app/popup.js | |
parent | b0df8045f6b749208a1e34fc43a46828a490d604 (diff) |
Improve audio auto play cancellation (#1873)
* Cancel automatic audio playback when hiding the popup
* Don't play audio if the popup is hidden
Diffstat (limited to 'ext/js/app/popup.js')
-rw-r--r-- | ext/js/app/popup.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/js/app/popup.js b/ext/js/app/popup.js index 63657dd3..8bf1d7c9 100644 --- a/ext/js/app/popup.js +++ b/ext/js/app/popup.js @@ -38,6 +38,7 @@ class Popup extends EventDispatcher { this._injectPromise = null; this._injectPromiseComplete = false; this._visible = new DynamicProperty(false); + this._visibleValue = false; this._options = null; this._optionsContext = null; this._contentScale = 1.0; @@ -441,7 +442,10 @@ class Popup extends EventDispatcher { } _onVisibleChange({value}) { + if (this._visibleValue === value) { return; } + this._visibleValue = value; this._frame.style.setProperty('visibility', value ? 'visible' : 'hidden', 'important'); + this._invokeSafe('visibilityChanged', {value}); } _focusParent() { |