[gnome-shell] status/volume: Small cleanup



commit a768efad066b10509f0a36a4bccf55e56c614976
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 15 18:15:13 2022 +0200

    status/volume: Small cleanup
    
    There is no point in splitting out a function that has one caller
    and sets a single property.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2380>

 js/ui/status/volume.js | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js
index bbbfb454be..21aef0a6f7 100644
--- a/js/ui/status/volume.js
+++ b/js/ui/status/volume.js
@@ -254,19 +254,16 @@ var OutputStreamSlider = class extends StreamSlider {
         return false;
     }
 
-    _updateSliderIcon() {
+    _portChanged() {
+        const hasHeadphones = this._findHeadphones(this._stream);
+        if (hasHeadphones === this._hasHeadphones)
+            return;
+
+        this._hasHeadphones = hasHeadphones;
         this._icon.icon_name = this._hasHeadphones
             ? 'audio-headphones-symbolic'
             : 'audio-speakers-symbolic';
     }
-
-    _portChanged() {
-        let hasHeadphones = this._findHeadphones(this._stream);
-        if (hasHeadphones != this._hasHeadphones) {
-            this._hasHeadphones = hasHeadphones;
-            this._updateSliderIcon();
-        }
-    }
 };
 
 var InputStreamSlider = class extends StreamSlider {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]