refactor(ui): simplify backlight settings handling (#175)

This commit is contained in:
Adam Shiervani 2025-02-19 11:38:11 +01:00 committed by GitHub
parent b38f899c84
commit 368c1eea90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 7 deletions

View File

@ -239,6 +239,7 @@ export default function SettingsSidebar() {
}
setBacklightSettings(settings);
handleBacklightSettingsSave();
}
const handleBacklightSettingsSave = () => {
@ -362,7 +363,7 @@ export default function SettingsSidebar() {
if ("error" in resp) return;
setUsbEmulationEnabled(resp.result as boolean);
});
}, [getCloudState, send, setDeveloperMode, setHideCursor, setJiggler]);
}, [getCloudState, send, setBacklightSettings, setDeveloperMode, setHideCursor, setJiggler]);
const getDevice = useCallback(async () => {
try {
@ -900,12 +901,6 @@ export default function SettingsSidebar() {
<p className="text-xs text-slate-600 dark:text-slate-400">
The display will wake up when the connection state changes, or when touched.
</p>
<Button
size="SM"
theme="primary"
text="Save Display Settings"
onClick={handleBacklightSettingsSave}
/>
<div className="h-[1px] w-full bg-slate-800/10 dark:bg-slate-300/20" />
<div className="pb-2 space-y-4">
<SectionHeader