@poolse/react-native 2.8.2 → 2.8.3

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.cjs CHANGED
@@ -5236,6 +5236,10 @@ var styles24 = reactNative.StyleSheet.create({
5236
5236
  callBtnText: { color: "#ffffff", fontSize: 16, fontWeight: "600" },
5237
5237
  warn: { fontSize: 12, textAlign: "center", marginTop: 12 }
5238
5238
  });
5239
+ function isCallOver(phase) {
5240
+ if (phase === void 0) return false;
5241
+ return phase !== "ringing-in" && phase !== "ringing-out" && phase !== "active";
5242
+ }
5239
5243
  function isStalePush(sentAt, now, staleAfterMs) {
5240
5244
  if (typeof sentAt !== "number" || !Number.isFinite(sentAt)) return false;
5241
5245
  const age = now - sentAt;
@@ -5281,7 +5285,14 @@ function useVoipCalls({
5281
5285
  } catch {
5282
5286
  }
5283
5287
  };
5284
- void ready.current.then(show, show);
5288
+ const done = () => {
5289
+ show();
5290
+ try {
5291
+ voipPush.onVoipNotificationCompleted?.(call.callId);
5292
+ } catch {
5293
+ }
5294
+ };
5295
+ void ready.current.then(done, done);
5285
5296
  if (isStalePush(sentAt, Date.now(), staleRef.current)) dismiss.current(call.callId);
5286
5297
  });
5287
5298
  react.useEffect(() => {
@@ -5332,7 +5343,10 @@ function useVoipCalls({
5332
5343
  }));
5333
5344
  callKeep.addEventListener("answerCall", (({ callUUID }) => {
5334
5345
  const call = shown.current.get(callUUID);
5335
- shown.current.delete(callUUID);
5346
+ try {
5347
+ callKeep.setCurrentCallActive?.(callUUID);
5348
+ } catch {
5349
+ }
5336
5350
  if (!call) {
5337
5351
  void handlers.current.calls?.accept();
5338
5352
  return;
@@ -5381,7 +5395,7 @@ function useVoipCalls({
5381
5395
  }
5382
5396
  }, [phase, incoming]);
5383
5397
  react.useEffect(() => {
5384
- if (phase === "ringing-in" || phase === "ringing-out") return;
5398
+ if (!isCallOver(phase)) return;
5385
5399
  for (const callId of [...shown.current.keys()]) dismiss.current(callId);
5386
5400
  }, [phase]);
5387
5401
  }