From a768efad066b10509f0a36a4bccf55e56c614976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 15 Jul 2022 18:15:13 +0200 Subject: [PATCH] status/volume: Small cleanup There is no point in splitting out a function that has one caller and sets a single property. Part-of: --- 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 bbbfb454b..21aef0a6f 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 {