@poolse/react-native 2.22.1 → 2.23.1

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
@@ -5763,7 +5763,10 @@ function CallVideoGrid({
5763
5763
  const others = useMemo(() => participants.filter((p) => !p.isSelf), [participants]);
5764
5764
  const columns = others.length + 1 <= 6 ? 2 : 3;
5765
5765
  const rows = Math.ceil((others.length + 1) / columns);
5766
- const tileHeight = size.height > 0 ? (size.height - GAP * (rows - 1)) / rows : 0;
5766
+ const padTop = safeArea?.top ?? 0;
5767
+ const padBottom = safeArea?.bottom ?? 0;
5768
+ const availableHeight = size.height > 0 ? size.height - padTop - padBottom : 0;
5769
+ const tileHeight = availableHeight > 0 ? (availableHeight - GAP * (rows - 1)) / rows : 0;
5767
5770
  const scrolls = tileHeight > 0 && tileHeight < MIN_TILE_HEIGHT;
5768
5771
  if (participants.length === 0) return /* @__PURE__ */ jsx(View, { style: styles30.stage, onLayout });
5769
5772
  if (others.length <= 1) {
@@ -5811,17 +5814,24 @@ function CallVideoGrid({
5811
5814
  },
5812
5815
  participant.userId
5813
5816
  )) });
5814
- return /* @__PURE__ */ jsx(View, { style: styles30.stage, onLayout, children: scrolls ? /* @__PURE__ */ jsx(
5815
- ScrollView,
5817
+ return /* @__PURE__ */ jsx(
5818
+ View,
5816
5819
  {
5817
- contentContainerStyle: [
5818
- styles30.scroll,
5819
- { paddingBottom: (chromeInsets?.bottom ?? 0) + GAP }
5820
- ],
5821
- showsVerticalScrollIndicator: false,
5822
- children: grid
5820
+ style: [styles30.stage, { paddingTop: padTop, paddingBottom: padBottom }],
5821
+ onLayout,
5822
+ children: scrolls ? /* @__PURE__ */ jsx(
5823
+ ScrollView,
5824
+ {
5825
+ contentContainerStyle: [
5826
+ styles30.scroll,
5827
+ { paddingBottom: (chromeInsets?.bottom ?? 0) + GAP }
5828
+ ],
5829
+ showsVerticalScrollIndicator: false,
5830
+ children: grid
5831
+ }
5832
+ ) : grid
5823
5833
  }
5824
- ) : grid });
5834
+ );
5825
5835
  }
5826
5836
  var styles30 = StyleSheet.create({
5827
5837
  stage: { flex: 1, overflow: "hidden" },
@@ -6114,10 +6124,14 @@ function CallScreen({
6114
6124
  [wakeChrome]
6115
6125
  );
6116
6126
  const hangUp = useCallback(() => {
6127
+ const othersOnCall = (usingSfu ? sfu.participants : mesh.participants).filter(
6128
+ (p) => !p.isSelf
6129
+ ).length;
6117
6130
  sfu.leave();
6118
6131
  mesh.leave();
6119
- void calls.hangUp();
6120
- }, [sfu, mesh, calls]);
6132
+ if (calls.phase === "active" && othersOnCall >= 2) calls.reset();
6133
+ else void calls.hangUp();
6134
+ }, [sfu, mesh, calls, usingSfu]);
6121
6135
  const alone = usingSfu ? sfu.alone : mesh.alone;
6122
6136
  const endedOnEmpty = useRef(false);
6123
6137
  if (calls.phase !== "active") endedOnEmpty.current = false;
@@ -6158,10 +6172,11 @@ function CallScreen({
6158
6172
  const statusText = duration ?? statusLine(calls, status);
6159
6173
  const subtitle = convName && !duration && peerIds.length > 0 ? `${peerTitle} \xB7 ${statusText}` : statusText;
6160
6174
  const showStage = connected && usingSfu && participants.length > 0;
6161
- const error = calls.error ?? (usingSfu ? sfu.error : mesh.error);
6175
+ const rawError = calls.error ?? (usingSfu ? sfu.error : mesh.error);
6176
+ const error = connected ? null : rawError;
6162
6177
  const chromeInsets = {
6163
6178
  top: insets.top + 72,
6164
- bottom: insets.bottom + 150
6179
+ bottom: insets.bottom + 236
6165
6180
  };
6166
6181
  return /* @__PURE__ */ jsxs(
6167
6182
  Modal,