From 9e8050bd486ce45290142ce5964ea4753c72fd7b Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 29 Jul 2026 15:12:45 -0600 Subject: [PATCH] controller: restore Desktop toggle state when a start/stop request fails Greptile P1: on failure the status poll never re-syncs (the desktop did not change), so the toggle stayed disabled until remount. Co-Authored-By: Claude Fable 5 --- app/src/hooks/customHooks.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/hooks/customHooks.js b/app/src/hooks/customHooks.js index deccb9ce..cff3e751 100644 --- a/app/src/hooks/customHooks.js +++ b/app/src/hooks/customHooks.js @@ -1227,6 +1227,7 @@ export const useDesktop = () => { }, [status?.desktop_status]); const localSetDesktop = async (running) => { + const previous = on; setOn(null); try { if (running) { @@ -1242,6 +1243,9 @@ export const useDesktop = () => { description: e.message || 'Could not start/stop the desktop. See server logs.', time: 5000, }); + // The desktop did not change, so the status poll will not re-sync `on`; + // restore it or the toggle stays disabled. + setOn(previous); } }