Skip to content

Commit

Permalink
fix global brightness slider jump to 100, when set to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Feb 17, 2025
1 parent 5bedd5c commit bdb9fc6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/GlobalActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const GlobalActionBar = ({
const togglePause = useStore((state) => state.togglePause)

useEffect(() => {
setBrightness((globalBrightness || 1) * 100)
setBrightness((globalBrightness || 0) * 100)
}, [globalBrightness])

return (
Expand Down Expand Up @@ -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
)
}
/>
</Stack>
Expand Down

0 comments on commit bdb9fc6

Please sign in to comment.