mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
3e559e1bf8
commit
9e8050bd48
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue