mirror of
https://github.com/soconnor0919/hristudio.git
synced 2025-12-12 23:24: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 {
|
try {
|
||||||
await service.connect();
|
await service.connect();
|
||||||
|
// Connection successful - state will be updated by event handler
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (mountedRef.current) {
|
if (mountedRef.current) {
|
||||||
setIsConnecting(false);
|
setIsConnecting(false);
|
||||||
@@ -231,6 +232,7 @@ export function useWizardRos(
|
|||||||
const timeoutId = setTimeout(() => {
|
const timeoutId = setTimeout(() => {
|
||||||
connect().catch((error) => {
|
connect().catch((error) => {
|
||||||
console.error("[useWizardRos] Auto-connect failed:", error);
|
console.error("[useWizardRos] Auto-connect failed:", error);
|
||||||
|
// Don't retry automatically - let user manually connect
|
||||||
});
|
});
|
||||||
}, 100); // Small delay to prevent immediate connection attempts
|
}, 100); // Small delay to prevent immediate connection attempts
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user