Connect-host wizard: set everConnected in the poll callback (no setState-in-effect lint)
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
447bf04932
commit
43432289fd
@@ -73,6 +73,7 @@ export function ConnectHostWizard({ onClose }: { onClose: () => void }) {
|
|||||||
if (stop) return;
|
if (stop) return;
|
||||||
const n = d.nodes.find((x) => x.id === nodeId) ?? null;
|
const n = d.nodes.find((x) => x.id === nodeId) ?? null;
|
||||||
setNode(n);
|
setNode(n);
|
||||||
|
if (n?.status === "online") setEverConnected(true);
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
};
|
};
|
||||||
@@ -84,10 +85,6 @@ export function ConnectHostWizard({ onClose }: { onClose: () => void }) {
|
|||||||
};
|
};
|
||||||
}, [step, nodeId]);
|
}, [step, nodeId]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (node?.status === "online") setEverConnected(true);
|
|
||||||
}, [node]);
|
|
||||||
|
|
||||||
// Cancelling before the daemon ever connected → drop the orphan pending node so
|
// Cancelling before the daemon ever connected → drop the orphan pending node so
|
||||||
// we don't leave a "waiting for daemon" card behind.
|
// we don't leave a "waiting for daemon" card behind.
|
||||||
const handleClose = useCallback(() => {
|
const handleClose = useCallback(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user