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