mirror of
https://github.com/soconnor0919/hristudio.git
synced 2025-12-11 06:34:44 -05:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user