mirror of https://github.com/jetkvm/kvm.git
refactor: stale display settings
This commit is contained in:
parent
c8c5079579
commit
d75a5eb7ee
|
|
@ -46,10 +46,10 @@ export default function SettingsHardwareRoute() {
|
||||||
}
|
}
|
||||||
|
|
||||||
setBacklightSettings(settings);
|
setBacklightSettings(settings);
|
||||||
handleBacklightSettingsSave();
|
handleBacklightSettingsSave(settings);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleBacklightSettingsSave = () => {
|
const handleBacklightSettingsSave = (backlightSettings: BacklightSettings) => {
|
||||||
send("setBacklightSettings", { params: backlightSettings }, (resp: JsonRpcResponse) => {
|
send("setBacklightSettings", { params: backlightSettings }, (resp: JsonRpcResponse) => {
|
||||||
if ("error" in resp) {
|
if ("error" in resp) {
|
||||||
notifications.error(
|
notifications.error(
|
||||||
|
|
@ -81,7 +81,7 @@ export default function SettingsHardwareRoute() {
|
||||||
const duration = enabled ? 90 : -1;
|
const duration = enabled ? 90 : -1;
|
||||||
send("setVideoSleepMode", { duration }, (resp: JsonRpcResponse) => {
|
send("setVideoSleepMode", { duration }, (resp: JsonRpcResponse) => {
|
||||||
if ("error" in resp) {
|
if ("error" in resp) {
|
||||||
notifications.error(m.hardware_power_saving_failed_error({ error: resp.error.data ||m.unknown_error() }));
|
notifications.error(m.hardware_power_saving_failed_error({ error: resp.error.data || m.unknown_error() }));
|
||||||
setPowerSavingEnabled(!enabled); // Attempt to revert on error
|
setPowerSavingEnabled(!enabled); // Attempt to revert on error
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue