@poolse/react-native 2.22.1 → 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
@@ -6114,10 +6114,14 @@ function CallScreen({
6114
6114
  [wakeChrome]
6115
6115
  );
6116
6116
  const hangUp = useCallback(() => {
6117
+ const othersOnCall = (usingSfu ? sfu.participants : mesh.participants).filter(
6118
+ (p) => !p.isSelf
6119
+ ).length;
6117
6120
  sfu.leave();
6118
6121
  mesh.leave();
6119
- void calls.hangUp();
6120
- }, [sfu, mesh, calls]);
6122
+ if (calls.phase === "active" && othersOnCall >= 2) calls.reset();
6123
+ else void calls.hangUp();
6124
+ }, [sfu, mesh, calls, usingSfu]);
6121
6125
  const alone = usingSfu ? sfu.alone : mesh.alone;
6122
6126
  const endedOnEmpty = useRef(false);
6123
6127
  if (calls.phase !== "active") endedOnEmpty.current = false;
@@ -6158,10 +6162,11 @@ function CallScreen({
6158
6162
  const statusText = duration ?? statusLine(calls, status);
6159
6163
  const subtitle = convName && !duration && peerIds.length > 0 ? `${peerTitle} \xB7 ${statusText}` : statusText;
6160
6164
  const showStage = connected && usingSfu && participants.length > 0;
6161
- const error = calls.error ?? (usingSfu ? sfu.error : mesh.error);
6165
+ const rawError = calls.error ?? (usingSfu ? sfu.error : mesh.error);
6166
+ const error = connected ? null : rawError;
6162
6167
  const chromeInsets = {
6163
6168
  top: insets.top + 72,
6164
- bottom: insets.bottom + 150
6169
+ bottom: insets.bottom + 236
6165
6170
  };
6166
6171
  return /* @__PURE__ */ jsxs(
6167
6172
  Modal,