From f3a2e15f8e0274b5fdf28e3ce062084dc142cb2e Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 7 Sep 2023 04:24:24 +0200 Subject: [PATCH] Fix mute button and volume slider feeling disconnected in web UI (#26827) --- app/javascript/mastodon/features/audio/index.jsx | 7 ++++--- app/javascript/mastodon/features/video/index.jsx | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/javascript/mastodon/features/audio/index.jsx b/app/javascript/mastodon/features/audio/index.jsx index 3f642bc74e..da0a652326 100644 --- a/app/javascript/mastodon/features/audio/index.jsx +++ b/app/javascript/mastodon/features/audio/index.jsx @@ -466,8 +466,9 @@ class Audio extends PureComponent { render () { const { src, intl, alt, lang, editable, autoPlay, sensitive, blurhash } = this.props; - const { paused, muted, volume, currentTime, duration, buffer, dragging, revealed } = this.state; + const { paused, volume, currentTime, duration, buffer, dragging, revealed } = this.state; const progress = Math.min((currentTime / duration) * 100, 100); + const muted = this.state.muted || volume === 0; let warning; @@ -557,12 +558,12 @@ class Audio extends PureComponent {
-
+
diff --git a/app/javascript/mastodon/features/video/index.jsx b/app/javascript/mastodon/features/video/index.jsx index 3f7e0ada14..9143619d01 100644 --- a/app/javascript/mastodon/features/video/index.jsx +++ b/app/javascript/mastodon/features/video/index.jsx @@ -501,8 +501,9 @@ class Video extends PureComponent { render () { const { preview, src, aspectRatio, onOpenVideo, onCloseVideo, intl, alt, lang, detailed, sensitive, editable, blurhash, autoFocus } = this.props; - const { currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state; + const { currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, revealed } = this.state; const progress = Math.min((currentTime / duration) * 100, 100); + const muted = this.state.muted || volume === 0; let preload; @@ -593,12 +594,12 @@ class Video extends PureComponent {
-
+