fix(dashboard): dont set brightness when sliding

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2025-10-31 01:33:57 +00:00
parent 9624eab798
commit 4e47111a4d

View File

@@ -197,7 +197,7 @@ export function LightControlTile({
delete bar.dataset.touchProximity delete bar.dataset.touchProximity
const step = LIGHT_CONTROL_TILE_SLIDER_BAR_COUNT - i - 1 const step = LIGHT_CONTROL_TILE_SLIDER_BAR_COUNT - i - 1
requestBrightnessStepChange(step) setIntermediateBrightnessStep(step)
if (barRefs.current[i - 1]) { if (barRefs.current[i - 1]) {
barRefs.current[i - 1]!.dataset.touchProximity = "close" barRefs.current[i - 1]!.dataset.touchProximity = "close"
@@ -259,10 +259,10 @@ export function LightControlTile({
const lastElement = barRefs.current[0] const lastElement = barRefs.current[0]
if (lastElement && x > lastElement.getBoundingClientRect().right) { if (lastElement && x > lastElement.getBoundingClientRect().right) {
lastElement.dataset.thumb = "true" lastElement.dataset.thumb = "true"
requestBrightnessStepChange(LIGHT_CONTROL_TILE_SLIDER_BAR_COUNT - 1) setIntermediateBrightnessStep(LIGHT_CONTROL_TILE_SLIDER_BAR_COUNT - 1)
} else if (firstElement && x < firstElement.getBoundingClientRect().left) { } else if (firstElement && x < firstElement.getBoundingClientRect().left) {
firstElement.dataset.thumb = "true" firstElement.dataset.thumb = "true"
requestBrightnessStepChange(0) setIntermediateBrightnessStep(0)
} }
} }
} }