@poolse/react 2.19.0 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1477,14 +1477,20 @@ function useCalls(userId, opts = {}) {
1477
1477
  setIncoming(null);
1478
1478
  return;
1479
1479
  }
1480
+ setActiveConversationId(target.conversationId);
1481
+ setActiveCallId(target.callId);
1482
+ setActiveMedia(target.media);
1483
+ setPhase("active");
1484
+ setIncoming(null);
1480
1485
  try {
1481
1486
  await calls.accept(target);
1482
- setActiveConversationId(target.conversationId);
1483
- setActiveCallId(target.callId);
1484
- setActiveMedia(target.media);
1485
- setPhase("active");
1486
- setIncoming(null);
1487
1487
  } catch (err) {
1488
+ const message = err instanceof Error ? err.message : String(err);
1489
+ if (message.includes("timed out")) return;
1490
+ setPhase("idle");
1491
+ setActiveConversationId(null);
1492
+ setActiveCallId(null);
1493
+ setActiveMedia(null);
1488
1494
  setError(err instanceof Error ? err : new Error(String(err)));
1489
1495
  }
1490
1496
  },