refactor: stale display settings

This commit is contained in:
Adam Shiervani 2025-10-28 10:48:13 +01:00
parent c8c5079579
commit d75a5eb7ee
1 changed files with 3 additions and 3 deletions

View File

@ -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;
} }