sceyt-chat-react-uikit 1.8.7-beta.8 → 1.8.7-beta.9

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/index.js CHANGED
@@ -43798,6 +43798,7 @@ function useChatController(_ref5) {
43798
43798
  var visibleUnreadReportedRef = React.useRef(new Set());
43799
43799
  var restoreRef = React.useRef(null);
43800
43800
  var lastBootKeyRef = React.useRef(null);
43801
+ var pendingBootScrolledRef = React.useRef(false);
43801
43802
  var highlightedItemIdRef = React.useRef(null);
43802
43803
  var highlightTimeoutRef = React.useRef(null);
43803
43804
  var unreadRestoreCompletedRef = React.useRef(false);
@@ -44996,6 +44997,7 @@ function useChatController(_ref5) {
44996
44997
  currentJumpIdRef.current += 1;
44997
44998
  activeChannelIdRef.current = channel.id;
44998
44999
  lastBootKeyRef.current = null;
45000
+ pendingBootScrolledRef.current = false;
44999
45001
  restoreRef.current = null;
45000
45002
  windowLoadScopeRef.current = null;
45001
45003
  activeEdgeIntentRef.current = null;
@@ -45092,13 +45094,26 @@ function useChatController(_ref5) {
45092
45094
  return;
45093
45095
  }
45094
45096
  if (!lastBootKeyRef.current) {
45095
- lastBootKeyRef.current = channel.id + ":" + getMessageLocalRef(messages[0]);
45096
- var preservePendingHistoryEdge = pendingEdgeCheckAfterLoadRef.current && activeEdgeIntentRef.current === 'previous';
45097
- restoreRef.current = unreadScrollTo && unreadMessageId ? {
45098
- mode: 'reveal-unread-separator'
45099
- } : preservePendingHistoryEdge ? null : isScrollInteractionActive() ? null : {
45100
- mode: 'to-bottom'
45101
- };
45097
+ var hasConfirmedMessages = messages.some(function (m) {
45098
+ return !!m.id;
45099
+ });
45100
+ if (hasConfirmedMessages) {
45101
+ lastBootKeyRef.current = channel.id + ":" + getMessageLocalRef(messages[0]);
45102
+ pendingBootScrolledRef.current = false;
45103
+ var preservePendingHistoryEdge = pendingEdgeCheckAfterLoadRef.current && activeEdgeIntentRef.current === 'previous';
45104
+ restoreRef.current = unreadScrollTo && unreadMessageId ? {
45105
+ mode: 'reveal-unread-separator'
45106
+ } : preservePendingHistoryEdge ? null : isScrollInteractionActive() ? null : {
45107
+ mode: 'to-bottom'
45108
+ };
45109
+ } else if (!pendingBootScrolledRef.current) {
45110
+ pendingBootScrolledRef.current = true;
45111
+ if (!restoreRef.current) {
45112
+ restoreRef.current = {
45113
+ mode: 'to-bottom'
45114
+ };
45115
+ }
45116
+ }
45102
45117
  }
45103
45118
  var restoreState = restoreRef.current;
45104
45119
  if (!restoreState) {
package/index.modern.js CHANGED
@@ -43797,6 +43797,7 @@ function useChatController(_ref5) {
43797
43797
  var visibleUnreadReportedRef = useRef(new Set());
43798
43798
  var restoreRef = useRef(null);
43799
43799
  var lastBootKeyRef = useRef(null);
43800
+ var pendingBootScrolledRef = useRef(false);
43800
43801
  var highlightedItemIdRef = useRef(null);
43801
43802
  var highlightTimeoutRef = useRef(null);
43802
43803
  var unreadRestoreCompletedRef = useRef(false);
@@ -44995,6 +44996,7 @@ function useChatController(_ref5) {
44995
44996
  currentJumpIdRef.current += 1;
44996
44997
  activeChannelIdRef.current = channel.id;
44997
44998
  lastBootKeyRef.current = null;
44999
+ pendingBootScrolledRef.current = false;
44998
45000
  restoreRef.current = null;
44999
45001
  windowLoadScopeRef.current = null;
45000
45002
  activeEdgeIntentRef.current = null;
@@ -45091,13 +45093,26 @@ function useChatController(_ref5) {
45091
45093
  return;
45092
45094
  }
45093
45095
  if (!lastBootKeyRef.current) {
45094
- lastBootKeyRef.current = channel.id + ":" + getMessageLocalRef(messages[0]);
45095
- var preservePendingHistoryEdge = pendingEdgeCheckAfterLoadRef.current && activeEdgeIntentRef.current === 'previous';
45096
- restoreRef.current = unreadScrollTo && unreadMessageId ? {
45097
- mode: 'reveal-unread-separator'
45098
- } : preservePendingHistoryEdge ? null : isScrollInteractionActive() ? null : {
45099
- mode: 'to-bottom'
45100
- };
45096
+ var hasConfirmedMessages = messages.some(function (m) {
45097
+ return !!m.id;
45098
+ });
45099
+ if (hasConfirmedMessages) {
45100
+ lastBootKeyRef.current = channel.id + ":" + getMessageLocalRef(messages[0]);
45101
+ pendingBootScrolledRef.current = false;
45102
+ var preservePendingHistoryEdge = pendingEdgeCheckAfterLoadRef.current && activeEdgeIntentRef.current === 'previous';
45103
+ restoreRef.current = unreadScrollTo && unreadMessageId ? {
45104
+ mode: 'reveal-unread-separator'
45105
+ } : preservePendingHistoryEdge ? null : isScrollInteractionActive() ? null : {
45106
+ mode: 'to-bottom'
45107
+ };
45108
+ } else if (!pendingBootScrolledRef.current) {
45109
+ pendingBootScrolledRef.current = true;
45110
+ if (!restoreRef.current) {
45111
+ restoreRef.current = {
45112
+ mode: 'to-bottom'
45113
+ };
45114
+ }
45115
+ }
45101
45116
  }
45102
45117
  var restoreState = restoreRef.current;
45103
45118
  if (!restoreState) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sceyt-chat-react-uikit",
3
- "version": "1.8.7-beta.8",
3
+ "version": "1.8.7-beta.9",
4
4
  "description": "Interactive React UI Components for Sceyt Chat.",
5
5
  "author": "Sceyt",
6
6
  "license": "MIT",