mirror of https://github.com/jetkvm/kvm.git
refactor(ui): simplify backlight settings handling (#175)
This commit is contained in:
parent
b38f899c84
commit
368c1eea90
|
@ -239,6 +239,7 @@ export default function SettingsSidebar() {
|
||||||
}
|
}
|
||||||
|
|
||||||
setBacklightSettings(settings);
|
setBacklightSettings(settings);
|
||||||
|
handleBacklightSettingsSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleBacklightSettingsSave = () => {
|
const handleBacklightSettingsSave = () => {
|
||||||
|
@ -362,7 +363,7 @@ export default function SettingsSidebar() {
|
||||||
if ("error" in resp) return;
|
if ("error" in resp) return;
|
||||||
setUsbEmulationEnabled(resp.result as boolean);
|
setUsbEmulationEnabled(resp.result as boolean);
|
||||||
});
|
});
|
||||||
}, [getCloudState, send, setDeveloperMode, setHideCursor, setJiggler]);
|
}, [getCloudState, send, setBacklightSettings, setDeveloperMode, setHideCursor, setJiggler]);
|
||||||
|
|
||||||
const getDevice = useCallback(async () => {
|
const getDevice = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -900,12 +901,6 @@ export default function SettingsSidebar() {
|
||||||
<p className="text-xs text-slate-600 dark:text-slate-400">
|
<p className="text-xs text-slate-600 dark:text-slate-400">
|
||||||
The display will wake up when the connection state changes, or when touched.
|
The display will wake up when the connection state changes, or when touched.
|
||||||
</p>
|
</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="h-[1px] w-full bg-slate-800/10 dark:bg-slate-300/20" />
|
||||||
<div className="pb-2 space-y-4">
|
<div className="pb-2 space-y-4">
|
||||||
<SectionHeader
|
<SectionHeader
|
||||||
|
|
Loading…
Reference in New Issue