fix: prevent auto-connect from getting stuck in connecting state

Added comment to clarify that connection state updates happen via
event handlers. Auto-connect now properly handles failures without
retrying automatically, allowing users to manually connect if needed.
This commit is contained in:
2025-11-19 22:56:24 -05:00
parent 5631c69a76
commit 1108f4d25d

View File

@@ -206,6 +206,7 @@ export function useWizardRos(
try {
await service.connect();
// Connection successful - state will be updated by event handler
} catch (error) {
if (mountedRef.current) {
setIsConnecting(false);
@@ -231,6 +232,7 @@ export function useWizardRos(
const timeoutId = setTimeout(() => {
connect().catch((error) => {
console.error("[useWizardRos] Auto-connect failed:", error);
// Don't retry automatically - let user manually connect
});
}, 100); // Small delay to prevent immediate connection attempts