From bdb9fc6b33aabcc8deaf6ba305398676fcdbdd97 Mon Sep 17 00:00:00 2001 From: YeonV Date: Mon, 17 Feb 2025 20:59:30 +0100 Subject: [PATCH] fix global brightness slider jump to 100, when set to 0 --- src/components/GlobalActionBar.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/GlobalActionBar.tsx b/src/components/GlobalActionBar.tsx index a0aec53e..651854f6 100644 --- a/src/components/GlobalActionBar.tsx +++ b/src/components/GlobalActionBar.tsx @@ -28,7 +28,7 @@ const GlobalActionBar = ({ const togglePause = useStore((state) => state.togglePause) useEffect(() => { - setBrightness((globalBrightness || 1) * 100) + setBrightness((globalBrightness || 0) * 100) }, [globalBrightness]) return ( @@ -130,8 +130,10 @@ const GlobalActionBar = ({ min={0} max={100} onChangeCommitted={(_e, val) => - typeof val === 'number' && - setSystemSetting('global_brightness', val / 100) + setSystemSetting( + 'global_brightness', + typeof val === 'number' ? val / 100 : 0 + ) } />