@poolse/react 3.10.1 → 3.10.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/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@ All notable changes to `@poolse/react` are documented here. Format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
5
  [semver](https://semver.org).
6
6
 
7
+ ## [3.10.3] - 2026-11-26
8
+
9
+ ### Changed
10
+
11
+ - `useCallRoom`: a problem during the call (`CallRoom.onError`: switching a
12
+ device, screen sharing, remote audio…) no longer stays in `error` until
13
+ you rejoin; it clears by itself after `ROOM_ERROR_MS` (8 s, exported). A
14
+ failed `join()` still stays until the next attempt.
15
+
7
16
  ## [3.10.1] - 2026-11-23
8
17
 
9
18
  ### Changed
package/dist/index.cjs CHANGED
@@ -2002,6 +2002,7 @@ function formatDayLabel(iso, now = /* @__PURE__ */ new Date()) {
2002
2002
  }
2003
2003
  return d.toLocaleDateString(void 0, { day: "numeric", month: "short", year: "numeric" });
2004
2004
  }
2005
+ var ROOM_ERROR_MS = 8e3;
2005
2006
  function useCallRoom(conversationId, opts) {
2006
2007
  const poolse = usePoolse();
2007
2008
  const [status, setStatus] = react.useState("idle");
@@ -2083,7 +2084,15 @@ function useCallRoom(conversationId, opts) {
2083
2084
  });
2084
2085
  const offAlone = room.onAlone(() => setAlone(true));
2085
2086
  const offDevices = room.onDevices(() => refreshDevices(room));
2086
- const offError = room.onError(setError);
2087
+ let errorTimer = null;
2088
+ const offError = room.onError((err) => {
2089
+ setError(err);
2090
+ if (errorTimer) clearTimeout(errorTimer);
2091
+ errorTimer = setTimeout(() => {
2092
+ errorTimer = null;
2093
+ setError((now) => now === err ? null : now);
2094
+ }, ROOM_ERROR_MS);
2095
+ });
2087
2096
  const offPublish = room.onPublishPermission(() => sync(room));
2088
2097
  setReconnecting(room.isReconnecting());
2089
2098
  setDisconnectReason(null);
@@ -2097,6 +2106,7 @@ function useCallRoom(conversationId, opts) {
2097
2106
  offAlone();
2098
2107
  offDevices();
2099
2108
  offError();
2109
+ if (errorTimer) clearTimeout(errorTimer);
2100
2110
  offPublish();
2101
2111
  offReconnect();
2102
2112
  offDisconnect();
@@ -4858,6 +4868,7 @@ exports.EDIT_WINDOW_MS = EDIT_WINDOW_MS;
4858
4868
  exports.FORMAT_ACTIONS = FORMAT_ACTIONS;
4859
4869
  exports.MESSAGE_PLAYBACK_RATES = MESSAGE_PLAYBACK_RATES;
4860
4870
  exports.PoolseProvider = PoolseProvider;
4871
+ exports.ROOM_ERROR_MS = ROOM_ERROR_MS;
4861
4872
  exports.applyCaptureEvent = applyCaptureEvent;
4862
4873
  exports.applyFormat = applyFormat;
4863
4874
  exports.applySlashCommand = applySlashCommand;