From aebd3235d755cb1ff95995b461e497fea2d52e8b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 11 Sep 2025 14:43:11 +0200 Subject: ... --- .../gkleen@sif/shell/quickshell/Services/Brightness.qml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml') diff --git a/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml b/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml index 87c7c05b..8318df50 100644 --- a/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml +++ b/accounts/gkleen@sif/shell/quickshell/Services/Brightness.qml @@ -23,14 +23,21 @@ Singleton { return val; } - Component.onCompleted: root.currBrightness = root.calcCurrBrightness() Connections { target: currFile - function onLoaded() { root.currBrightness = root.calcCurrBrightness(); } + function onLoaded() { + const b = root.calcCurrBrightness(); + if (typeof b !== 'undefined') + root.currBrightness = b; + } } Connections { target: maxFile - function onLoaded() { root.currBrightness = root.calcCurrBrightness(); } + function onLoaded() { + const b = root.calcCurrBrightness(); + if (typeof b !== 'undefined') + root.currBrightness = b; + } } onCurrBrightnessChanged: { -- cgit v1.2.3