stream-chat-react 11.23.2 → 11.23.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.
@@ -39531,23 +39531,24 @@ var useTimeElapsed = function (_a) {
39531
39531
  var _c = React.useState(0), secondsElapsed = _c[0], setSecondsElapsed = _c[1];
39532
39532
  var updateInterval = React.useRef();
39533
39533
  var startCounter = React.useCallback(function () {
39534
+ if (updateInterval.current)
39535
+ return;
39534
39536
  updateInterval.current = setInterval(function () {
39535
39537
  setSecondsElapsed(function (prev) { return prev + 1; });
39536
39538
  }, 1000);
39537
39539
  }, []);
39538
39540
  var stopCounter = React.useCallback(function () {
39539
39541
  clearInterval(updateInterval.current);
39542
+ updateInterval.current = undefined;
39540
39543
  }, []);
39541
39544
  React.useEffect(function () {
39542
39545
  if (!startOnMount)
39543
39546
  return;
39544
- updateInterval.current = setInterval(function () {
39545
- setSecondsElapsed(function (prev) { return prev + 1; });
39546
- }, 1000);
39547
+ startCounter();
39547
39548
  return function () {
39548
39549
  stopCounter();
39549
39550
  };
39550
- }, [startOnMount, stopCounter]);
39551
+ }, [startCounter, startOnMount, stopCounter]);
39551
39552
  return {
39552
39553
  secondsElapsed: secondsElapsed,
39553
39554
  startCounter: startCounter,
@@ -39583,6 +39584,9 @@ var AudioRecordingInProgress = function () {
39583
39584
  if (!(recorder === null || recorder === void 0 ? void 0 : recorder.mediaRecorder))
39584
39585
  return;
39585
39586
  var mediaRecorder = recorder.mediaRecorder;
39587
+ if (mediaRecorder.state === 'recording') {
39588
+ startCounter();
39589
+ }
39586
39590
  mediaRecorder.addEventListener('start', startCounter);
39587
39591
  mediaRecorder.addEventListener('resume', startCounter);
39588
39592
  mediaRecorder.addEventListener('stop', stopCounter);
@@ -51576,23 +51576,24 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, ReactDOM, streamC
51576
51576
  var _c = React$2.useState(0), secondsElapsed = _c[0], setSecondsElapsed = _c[1];
51577
51577
  var updateInterval = React$2.useRef();
51578
51578
  var startCounter = React$2.useCallback(function () {
51579
+ if (updateInterval.current)
51580
+ return;
51579
51581
  updateInterval.current = setInterval(function () {
51580
51582
  setSecondsElapsed(function (prev) { return prev + 1; });
51581
51583
  }, 1000);
51582
51584
  }, []);
51583
51585
  var stopCounter = React$2.useCallback(function () {
51584
51586
  clearInterval(updateInterval.current);
51587
+ updateInterval.current = undefined;
51585
51588
  }, []);
51586
51589
  React$2.useEffect(function () {
51587
51590
  if (!startOnMount)
51588
51591
  return;
51589
- updateInterval.current = setInterval(function () {
51590
- setSecondsElapsed(function (prev) { return prev + 1; });
51591
- }, 1000);
51592
+ startCounter();
51592
51593
  return function () {
51593
51594
  stopCounter();
51594
51595
  };
51595
- }, [startOnMount, stopCounter]);
51596
+ }, [startCounter, startOnMount, stopCounter]);
51596
51597
  return {
51597
51598
  secondsElapsed: secondsElapsed,
51598
51599
  startCounter: startCounter,
@@ -51628,6 +51629,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, ReactDOM, streamC
51628
51629
  if (!(recorder === null || recorder === void 0 ? void 0 : recorder.mediaRecorder))
51629
51630
  return;
51630
51631
  var mediaRecorder = recorder.mediaRecorder;
51632
+ if (mediaRecorder.state === 'recording') {
51633
+ startCounter();
51634
+ }
51631
51635
  mediaRecorder.addEventListener('start', startCounter);
51632
51636
  mediaRecorder.addEventListener('resume', startCounter);
51633
51637
  mediaRecorder.addEventListener('stop', stopCounter);
@@ -63915,7 +63919,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, ReactDOM, streamC
63915
63919
 
63916
63920
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
63917
63921
 
63918
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var version$1 = '11.23.2';
63922
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var version$1 = '11.23.3';
63919
63923
 
63920
63924
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var useChat = function (_a) {
63921
63925
  var _b, _c;