diff --git a/ui/src/components/sidebar/settings.tsx b/ui/src/components/sidebar/settings.tsx
index a02af45..48212a5 100644
--- a/ui/src/components/sidebar/settings.tsx
+++ b/ui/src/components/sidebar/settings.tsx
@@ -230,8 +230,18 @@ export default function SettingsSidebar() {
[send, setDeveloperMode],
);
- const handleBacklightSettingChange = useCallback((settings: BacklightSettings) => {
- send("setBacklightSettings", { settings }, resp => {
+ const handleBacklightSettingsChange = (settings: BacklightSettings) => {
+ // If the user has set the display to dim after it turns off, set the dim_after
+ // value to never.
+ if (settings.dim_after > settings.off_after && settings.off_after != 0) {
+ settings.dim_after = 0;
+ }
+
+ setBacklightSettings(settings);
+ }
+
+ const handleBacklightSettingsSave = () => {
+ send("setBacklightSettings", { params: settings.backlightSettings }, resp => {
if ("error" in resp) {
notifications.error(
`Failed to set backlight settings: ${resp.error.data || "Unknown error"}`,
@@ -240,7 +250,7 @@ export default function SettingsSidebar() {
}
notifications.success("Backlight settings updated successfully");
});
- }, [send]);
+ };
const handleUpdateSSHKey = useCallback(() => {
send("setSSHKeyState", { sshKey }, resp => {
@@ -829,7 +839,6 @@ export default function SettingsSidebar() {
/>
+ The display will wake up when the connection state changes, or when touched. +
+