sceyt-chat-react-uikit 1.7.7-beta.6 → 1.7.7-beta.7

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.
Files changed (3) hide show
  1. package/index.js +99 -49
  2. package/index.modern.js +99 -49
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -16065,7 +16065,7 @@ function createChannel(action) {
16065
16065
  }, _marked$2, null, [[0, 17]]);
16066
16066
  }
16067
16067
  function getChannels(action) {
16068
- var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys, _mappedChannels2, channelMessageMap, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, allChannelsData, allChannelList, _t2, _t3, _t4;
16068
+ var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys, _mappedChannels2, channelMessageMap, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, _connectionStatus, allChannelsData, allChannelList, _t2, _t3, _t4;
16069
16069
  return _regenerator().w(function (_context2) {
16070
16070
  while (1) switch (_context2.p = _context2.n) {
16071
16071
  case 0:
@@ -16223,7 +16223,7 @@ function getChannels(action) {
16223
16223
  hiddenList = store.getState().ChannelReducer.hideChannelList;
16224
16224
  log.info('[getChannels] hiddenList state:', hiddenList);
16225
16225
  if (hiddenList) {
16226
- _context2.n = 27;
16226
+ _context2.n = 28;
16227
16227
  break;
16228
16228
  }
16229
16229
  log.info('[getChannels] starting all channels query (hiddenList is false)');
@@ -16248,18 +16248,26 @@ function getChannels(action) {
16248
16248
  i = 0;
16249
16249
  case 19:
16250
16250
  if (!(i <= 4)) {
16251
- _context2.n = 26;
16251
+ _context2.n = 27;
16252
16252
  break;
16253
16253
  }
16254
16254
  if (!hasNext) {
16255
- _context2.n = 24;
16255
+ _context2.n = 25;
16256
16256
  break;
16257
16257
  }
16258
16258
  _context2.p = 20;
16259
+ _connectionStatus = store.getState().UserReducer.connectionStatus;
16260
+ if (!(_connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
16261
+ _context2.n = 21;
16262
+ break;
16263
+ }
16264
+ log.warn('[getChannels] connection not ready, aborting. Status:', _connectionStatus);
16265
+ return _context2.a(3, 27);
16266
+ case 21:
16259
16267
  log.info('[getChannels] loading all channels page:', i + 1);
16260
- _context2.n = 21;
16268
+ _context2.n = 22;
16261
16269
  return effects.call(allChannelsQuery.loadNextPage);
16262
- case 21:
16270
+ case 22:
16263
16271
  allChannelsData = _context2.v;
16264
16272
  hasNext = allChannelsData.hasNext;
16265
16273
  allChannelList = allChannelsData.channels;
@@ -16270,33 +16278,34 @@ function getChannels(action) {
16270
16278
  addChannelsToAllChannels(allChannelList);
16271
16279
  totalAllChannelsAdded += (allChannelList === null || allChannelList === void 0 ? void 0 : allChannelList.length) || 0;
16272
16280
  log.info('[getChannels] total all channels added so far:', totalAllChannelsAdded);
16273
- _context2.n = 23;
16281
+ _context2.n = 24;
16274
16282
  break;
16275
- case 22:
16276
- _context2.p = 22;
16283
+ case 23:
16284
+ _context2.p = 23;
16277
16285
  _t3 = _context2.v;
16278
16286
  log.error(_t3, 'Error on get all channels page:', i + 1);
16279
- case 23:
16280
- _context2.n = 25;
16281
- break;
16287
+ return _context2.a(3, 27);
16282
16288
  case 24:
16283
- log.info('[getChannels] no more pages available, stopping at iteration:', i);
16289
+ _context2.n = 26;
16290
+ break;
16284
16291
  case 25:
16292
+ log.info('[getChannels] no more pages available, stopping at iteration:', i);
16293
+ case 26:
16285
16294
  i++;
16286
16295
  _context2.n = 19;
16287
16296
  break;
16288
- case 26:
16297
+ case 27:
16289
16298
  log.info('[getChannels] all channels query completed, total channels added:', totalAllChannelsAdded);
16290
- _context2.n = 28;
16299
+ _context2.n = 29;
16291
16300
  break;
16292
- case 27:
16293
- log.info('[getChannels] skipping all channels query (hiddenList is true)');
16294
16301
  case 28:
16302
+ log.info('[getChannels] skipping all channels query (hiddenList is true)');
16303
+ case 29:
16295
16304
  log.info('[getChannels] completed successfully. Final mapped channels count:', ((_mappedChannels4 = mappedChannels) === null || _mappedChannels4 === void 0 ? void 0 : _mappedChannels4.length) || 0);
16296
- _context2.n = 30;
16305
+ _context2.n = 31;
16297
16306
  break;
16298
- case 29:
16299
- _context2.p = 29;
16307
+ case 30:
16308
+ _context2.p = 30;
16300
16309
  _t4 = _context2.v;
16301
16310
  log.error('[getChannels] error occurred:', JSON.stringify(_t4), 'Error on get channels');
16302
16311
  log.error('[getChannels] error details:', {
@@ -16304,10 +16313,10 @@ function getChannels(action) {
16304
16313
  code: _t4.code,
16305
16314
  stack: _t4.stack
16306
16315
  });
16307
- case 30:
16316
+ case 31:
16308
16317
  return _context2.a(2);
16309
16318
  }
16310
- }, _marked2$1, null, [[20, 22], [1, 29]]);
16319
+ }, _marked2$1, null, [[20, 23], [1, 30]]);
16311
16320
  }
16312
16321
  function searchChannels(action) {
16313
16322
  var payload, params, contactsMap, SceytChatClient, getFromContacts, searchBy, _params$filter2, _types2, channelQueryBuilder, channelTypesFilter, types, allChannels, publicChannels, chatsGroups, contactsList, contactsWithChannelsMap, lowerCaseSearchBy, handleChannels, channelsMap, _iterator, _step, channel, channelQuery, channelsData, _iterator2, _step2, _channel, channelsToAdd, _t5;
@@ -16630,39 +16639,66 @@ function searchChannelsForForward(action) {
16630
16639
  }, _marked5, null, [[0, 7]]);
16631
16640
  }
16632
16641
  function channelsLoadMore(action) {
16633
- var payload, limit, channelQuery, channelsData, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, channelMessageMap, _t8;
16642
+ var _mappedChannels5, _mappedChannels7, _mappedChannels8, payload, limit, channelQuery, channelsData, channelList, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys2, _mappedChannels6, channelMessageMap, _t8;
16634
16643
  return _regenerator().w(function (_context6) {
16635
16644
  while (1) switch (_context6.p = _context6.n) {
16636
16645
  case 0:
16637
- _context6.p = 0;
16646
+ log.info('[channelsLoadMore] start load more channels');
16647
+ _context6.p = 1;
16638
16648
  payload = action.payload;
16639
16649
  limit = payload.limit;
16650
+ log.info('[channelsLoadMore] input payload:', JSON.stringify({
16651
+ limit: limit
16652
+ }));
16640
16653
  channelQuery = query.channelQuery;
16654
+ log.info('[channelsLoadMore] channelQuery exists:', !!channelQuery);
16655
+ if (channelQuery) {
16656
+ _context6.n = 2;
16657
+ break;
16658
+ }
16659
+ log.error('[channelsLoadMore] channelQuery is null or undefined, cannot load more');
16660
+ return _context6.a(2);
16661
+ case 2:
16641
16662
  if (limit) {
16663
+ log.info('[channelsLoadMore] setting query limit to:', limit);
16642
16664
  channelQuery.limit = limit;
16665
+ } else {
16666
+ log.info('[channelsLoadMore] no limit provided, using existing query limit');
16643
16667
  }
16644
- _context6.n = 1;
16668
+ _context6.n = 3;
16645
16669
  return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
16646
- case 1:
16647
- _context6.n = 2;
16670
+ case 3:
16671
+ log.info('[channelsLoadMore] loading next page...');
16672
+ _context6.n = 4;
16648
16673
  return effects.call(channelQuery.loadNextPage);
16649
- case 2:
16674
+ case 4:
16650
16675
  channelsData = _context6.v;
16651
- _context6.n = 3;
16676
+ channelList = channelsData.channels;
16677
+ log.info('[channelsLoadMore] channelsData received:', JSON.stringify({
16678
+ channelsCount: (channelList === null || channelList === void 0 ? void 0 : channelList.length) || 0,
16679
+ hasNext: channelsData.hasNext
16680
+ }));
16681
+ _context6.n = 5;
16652
16682
  return effects.put(channelHasNextAC(channelsData.hasNext));
16653
- case 3:
16654
- _context6.n = 4;
16683
+ case 5:
16684
+ log.info('[channelsLoadMore] hasNext set to:', channelsData.hasNext);
16685
+ _context6.n = 6;
16655
16686
  return effects.call(setChannelsInMap, channelsData.channels);
16656
- case 4:
16687
+ case 6:
16657
16688
  _yield$call3 = _context6.v;
16658
16689
  mappedChannels = _yield$call3.channels;
16659
16690
  channelsForUpdateLastReactionMessage = _yield$call3.channelsForUpdateLastReactionMessage;
16660
- if (!channelsForUpdateLastReactionMessage.length) {
16661
- _context6.n = 6;
16691
+ log.info('[channelsLoadMore] setChannelsInMap result:', JSON.stringify({
16692
+ mappedChannelsCount: ((_mappedChannels5 = mappedChannels) === null || _mappedChannels5 === void 0 ? void 0 : _mappedChannels5.length) || 0,
16693
+ channelsForUpdateLastReactionMessageCount: (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length) || 0
16694
+ }));
16695
+ if (!(channelsForUpdateLastReactionMessage !== null && channelsForUpdateLastReactionMessage !== void 0 && channelsForUpdateLastReactionMessage.length)) {
16696
+ _context6.n = 8;
16662
16697
  break;
16663
16698
  }
16699
+ log.info('[channelsLoadMore] processing channels for reaction message update:', channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length);
16664
16700
  channelMessageMap = {};
16665
- _context6.n = 5;
16701
+ _context6.n = 7;
16666
16702
  return effects.call(function () {
16667
16703
  try {
16668
16704
  return Promise.resolve(Promise.all(channelsForUpdateLastReactionMessage.map(function (channel) {
@@ -16670,9 +16706,10 @@ function channelsLoadMore(action) {
16670
16706
  return Promise.resolve(new Promise(function (resolve) {
16671
16707
  channel.getMessagesById([channel.newReactions[0].messageId]).then(function (messages) {
16672
16708
  channelMessageMap[channel.id] = messages[0];
16709
+ log.info('[channelsLoadMore] successfully fetched reaction message for channel:', channel === null || channel === void 0 ? void 0 : channel.id);
16673
16710
  resolve(true);
16674
16711
  })["catch"](function (e) {
16675
- log.error(e, 'Error on getMessagesById');
16712
+ log.error(e, 'Error on getMessagesById for channel:', channel === null || channel === void 0 ? void 0 : channel.id);
16676
16713
  resolve(true);
16677
16714
  });
16678
16715
  }));
@@ -16684,30 +16721,43 @@ function channelsLoadMore(action) {
16684
16721
  return Promise.reject(e);
16685
16722
  }
16686
16723
  });
16687
- case 5:
16724
+ case 7:
16725
+ log.info('[channelsLoadMore] reaction messages fetched:', channelMessageMap ? (_Object$keys2 = Object.keys(channelMessageMap)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length : 0);
16688
16726
  mappedChannels = mappedChannels.map(function (channel) {
16689
16727
  if (channelMessageMap[channel.id]) {
16690
16728
  channel.lastReactedMessage = channelMessageMap[channel.id];
16691
16729
  }
16692
16730
  return channel;
16693
16731
  });
16694
- case 6:
16695
- _context6.n = 7;
16696
- return effects.put(addChannelsAC(mappedChannels));
16697
- case 7:
16698
- _context6.n = 8;
16699
- return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
16732
+ log.info('[channelsLoadMore] mappedChannels updated with reaction messages, final count:', ((_mappedChannels6 = mappedChannels) === null || _mappedChannels6 === void 0 ? void 0 : _mappedChannels6.length) || 0);
16733
+ _context6.n = 9;
16734
+ break;
16700
16735
  case 8:
16736
+ log.info('[channelsLoadMore] no channels need reaction message update');
16737
+ case 9:
16738
+ log.info('[channelsLoadMore] adding channels to state, count:', ((_mappedChannels7 = mappedChannels) === null || _mappedChannels7 === void 0 ? void 0 : _mappedChannels7.length) || 0);
16701
16739
  _context6.n = 10;
16740
+ return effects.put(addChannelsAC(mappedChannels));
16741
+ case 10:
16742
+ _context6.n = 11;
16743
+ return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
16744
+ case 11:
16745
+ log.info('[channelsLoadMore] completed successfully. Total channels added:', ((_mappedChannels8 = mappedChannels) === null || _mappedChannels8 === void 0 ? void 0 : _mappedChannels8.length) || 0);
16746
+ _context6.n = 13;
16702
16747
  break;
16703
- case 9:
16704
- _context6.p = 9;
16748
+ case 12:
16749
+ _context6.p = 12;
16705
16750
  _t8 = _context6.v;
16706
- log.error(_t8, 'Error in load more channels');
16707
- case 10:
16751
+ log.error('[channelsLoadMore] error occurred:', _t8);
16752
+ log.error('[channelsLoadMore] error details:', JSON.stringify({
16753
+ message: _t8 === null || _t8 === void 0 ? void 0 : _t8.message,
16754
+ code: _t8 === null || _t8 === void 0 ? void 0 : _t8.code,
16755
+ stack: _t8 === null || _t8 === void 0 ? void 0 : _t8.stack
16756
+ }));
16757
+ case 13:
16708
16758
  return _context6.a(2);
16709
16759
  }
16710
- }, _marked6, null, [[0, 9]]);
16760
+ }, _marked6, null, [[1, 12]]);
16711
16761
  }
16712
16762
  function getChannelMentions(action) {
16713
16763
  var payload, channelId, _SceytChatClient3, mentionsQueryBuilder, mentionsQuery, mentions, _t9;
@@ -35248,7 +35298,7 @@ var OGMetadata = function OGMetadata(_ref) {
35248
35298
  metadataGetSuccessCallback === null || metadataGetSuccessCallback === void 0 ? void 0 : metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, false, false, metadata);
35249
35299
  }
35250
35300
  }
35251
- }, [metadataLoaded, oGMetadata, attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata, showOGMetadata, showImage, metadataGetSuccessCallback]);
35301
+ }, [metadataLoaded, oGMetadata, attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata, showOGMetadata, showImage]);
35252
35302
  var elements = React.useMemo(function () {
35253
35303
  var _resolvedOrder$image, _metadata$og17, _metadata$og17$image, _metadata$og17$image$, _resolvedOrder$title, _metadata$og18, _metadata$og18$title, _resolvedOrder$descri, _metadata$og19, _metadata$og19$descri, _resolvedOrder$link;
35254
35304
  return [showImage ? {
package/index.modern.js CHANGED
@@ -16064,7 +16064,7 @@ function createChannel(action) {
16064
16064
  }, _marked$2, null, [[0, 17]]);
16065
16065
  }
16066
16066
  function getChannels(action) {
16067
- var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys, _mappedChannels2, channelMessageMap, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, allChannelsData, allChannelList, _t2, _t3, _t4;
16067
+ var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys, _mappedChannels2, channelMessageMap, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, _connectionStatus, allChannelsData, allChannelList, _t2, _t3, _t4;
16068
16068
  return _regenerator().w(function (_context2) {
16069
16069
  while (1) switch (_context2.p = _context2.n) {
16070
16070
  case 0:
@@ -16222,7 +16222,7 @@ function getChannels(action) {
16222
16222
  hiddenList = store.getState().ChannelReducer.hideChannelList;
16223
16223
  log.info('[getChannels] hiddenList state:', hiddenList);
16224
16224
  if (hiddenList) {
16225
- _context2.n = 27;
16225
+ _context2.n = 28;
16226
16226
  break;
16227
16227
  }
16228
16228
  log.info('[getChannels] starting all channels query (hiddenList is false)');
@@ -16247,18 +16247,26 @@ function getChannels(action) {
16247
16247
  i = 0;
16248
16248
  case 19:
16249
16249
  if (!(i <= 4)) {
16250
- _context2.n = 26;
16250
+ _context2.n = 27;
16251
16251
  break;
16252
16252
  }
16253
16253
  if (!hasNext) {
16254
- _context2.n = 24;
16254
+ _context2.n = 25;
16255
16255
  break;
16256
16256
  }
16257
16257
  _context2.p = 20;
16258
+ _connectionStatus = store.getState().UserReducer.connectionStatus;
16259
+ if (!(_connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
16260
+ _context2.n = 21;
16261
+ break;
16262
+ }
16263
+ log.warn('[getChannels] connection not ready, aborting. Status:', _connectionStatus);
16264
+ return _context2.a(3, 27);
16265
+ case 21:
16258
16266
  log.info('[getChannels] loading all channels page:', i + 1);
16259
- _context2.n = 21;
16267
+ _context2.n = 22;
16260
16268
  return call(allChannelsQuery.loadNextPage);
16261
- case 21:
16269
+ case 22:
16262
16270
  allChannelsData = _context2.v;
16263
16271
  hasNext = allChannelsData.hasNext;
16264
16272
  allChannelList = allChannelsData.channels;
@@ -16269,33 +16277,34 @@ function getChannels(action) {
16269
16277
  addChannelsToAllChannels(allChannelList);
16270
16278
  totalAllChannelsAdded += (allChannelList === null || allChannelList === void 0 ? void 0 : allChannelList.length) || 0;
16271
16279
  log.info('[getChannels] total all channels added so far:', totalAllChannelsAdded);
16272
- _context2.n = 23;
16280
+ _context2.n = 24;
16273
16281
  break;
16274
- case 22:
16275
- _context2.p = 22;
16282
+ case 23:
16283
+ _context2.p = 23;
16276
16284
  _t3 = _context2.v;
16277
16285
  log.error(_t3, 'Error on get all channels page:', i + 1);
16278
- case 23:
16279
- _context2.n = 25;
16280
- break;
16286
+ return _context2.a(3, 27);
16281
16287
  case 24:
16282
- log.info('[getChannels] no more pages available, stopping at iteration:', i);
16288
+ _context2.n = 26;
16289
+ break;
16283
16290
  case 25:
16291
+ log.info('[getChannels] no more pages available, stopping at iteration:', i);
16292
+ case 26:
16284
16293
  i++;
16285
16294
  _context2.n = 19;
16286
16295
  break;
16287
- case 26:
16296
+ case 27:
16288
16297
  log.info('[getChannels] all channels query completed, total channels added:', totalAllChannelsAdded);
16289
- _context2.n = 28;
16298
+ _context2.n = 29;
16290
16299
  break;
16291
- case 27:
16292
- log.info('[getChannels] skipping all channels query (hiddenList is true)');
16293
16300
  case 28:
16301
+ log.info('[getChannels] skipping all channels query (hiddenList is true)');
16302
+ case 29:
16294
16303
  log.info('[getChannels] completed successfully. Final mapped channels count:', ((_mappedChannels4 = mappedChannels) === null || _mappedChannels4 === void 0 ? void 0 : _mappedChannels4.length) || 0);
16295
- _context2.n = 30;
16304
+ _context2.n = 31;
16296
16305
  break;
16297
- case 29:
16298
- _context2.p = 29;
16306
+ case 30:
16307
+ _context2.p = 30;
16299
16308
  _t4 = _context2.v;
16300
16309
  log.error('[getChannels] error occurred:', JSON.stringify(_t4), 'Error on get channels');
16301
16310
  log.error('[getChannels] error details:', {
@@ -16303,10 +16312,10 @@ function getChannels(action) {
16303
16312
  code: _t4.code,
16304
16313
  stack: _t4.stack
16305
16314
  });
16306
- case 30:
16315
+ case 31:
16307
16316
  return _context2.a(2);
16308
16317
  }
16309
- }, _marked2$1, null, [[20, 22], [1, 29]]);
16318
+ }, _marked2$1, null, [[20, 23], [1, 30]]);
16310
16319
  }
16311
16320
  function searchChannels(action) {
16312
16321
  var payload, params, contactsMap, SceytChatClient, getFromContacts, searchBy, _params$filter2, _types2, channelQueryBuilder, channelTypesFilter, types, allChannels, publicChannels, chatsGroups, contactsList, contactsWithChannelsMap, lowerCaseSearchBy, handleChannels, channelsMap, _iterator, _step, channel, channelQuery, channelsData, _iterator2, _step2, _channel, channelsToAdd, _t5;
@@ -16629,39 +16638,66 @@ function searchChannelsForForward(action) {
16629
16638
  }, _marked5, null, [[0, 7]]);
16630
16639
  }
16631
16640
  function channelsLoadMore(action) {
16632
- var payload, limit, channelQuery, channelsData, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, channelMessageMap, _t8;
16641
+ var _mappedChannels5, _mappedChannels7, _mappedChannels8, payload, limit, channelQuery, channelsData, channelList, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys2, _mappedChannels6, channelMessageMap, _t8;
16633
16642
  return _regenerator().w(function (_context6) {
16634
16643
  while (1) switch (_context6.p = _context6.n) {
16635
16644
  case 0:
16636
- _context6.p = 0;
16645
+ log.info('[channelsLoadMore] start load more channels');
16646
+ _context6.p = 1;
16637
16647
  payload = action.payload;
16638
16648
  limit = payload.limit;
16649
+ log.info('[channelsLoadMore] input payload:', JSON.stringify({
16650
+ limit: limit
16651
+ }));
16639
16652
  channelQuery = query.channelQuery;
16653
+ log.info('[channelsLoadMore] channelQuery exists:', !!channelQuery);
16654
+ if (channelQuery) {
16655
+ _context6.n = 2;
16656
+ break;
16657
+ }
16658
+ log.error('[channelsLoadMore] channelQuery is null or undefined, cannot load more');
16659
+ return _context6.a(2);
16660
+ case 2:
16640
16661
  if (limit) {
16662
+ log.info('[channelsLoadMore] setting query limit to:', limit);
16641
16663
  channelQuery.limit = limit;
16664
+ } else {
16665
+ log.info('[channelsLoadMore] no limit provided, using existing query limit');
16642
16666
  }
16643
- _context6.n = 1;
16667
+ _context6.n = 3;
16644
16668
  return put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
16645
- case 1:
16646
- _context6.n = 2;
16669
+ case 3:
16670
+ log.info('[channelsLoadMore] loading next page...');
16671
+ _context6.n = 4;
16647
16672
  return call(channelQuery.loadNextPage);
16648
- case 2:
16673
+ case 4:
16649
16674
  channelsData = _context6.v;
16650
- _context6.n = 3;
16675
+ channelList = channelsData.channels;
16676
+ log.info('[channelsLoadMore] channelsData received:', JSON.stringify({
16677
+ channelsCount: (channelList === null || channelList === void 0 ? void 0 : channelList.length) || 0,
16678
+ hasNext: channelsData.hasNext
16679
+ }));
16680
+ _context6.n = 5;
16651
16681
  return put(channelHasNextAC(channelsData.hasNext));
16652
- case 3:
16653
- _context6.n = 4;
16682
+ case 5:
16683
+ log.info('[channelsLoadMore] hasNext set to:', channelsData.hasNext);
16684
+ _context6.n = 6;
16654
16685
  return call(setChannelsInMap, channelsData.channels);
16655
- case 4:
16686
+ case 6:
16656
16687
  _yield$call3 = _context6.v;
16657
16688
  mappedChannels = _yield$call3.channels;
16658
16689
  channelsForUpdateLastReactionMessage = _yield$call3.channelsForUpdateLastReactionMessage;
16659
- if (!channelsForUpdateLastReactionMessage.length) {
16660
- _context6.n = 6;
16690
+ log.info('[channelsLoadMore] setChannelsInMap result:', JSON.stringify({
16691
+ mappedChannelsCount: ((_mappedChannels5 = mappedChannels) === null || _mappedChannels5 === void 0 ? void 0 : _mappedChannels5.length) || 0,
16692
+ channelsForUpdateLastReactionMessageCount: (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length) || 0
16693
+ }));
16694
+ if (!(channelsForUpdateLastReactionMessage !== null && channelsForUpdateLastReactionMessage !== void 0 && channelsForUpdateLastReactionMessage.length)) {
16695
+ _context6.n = 8;
16661
16696
  break;
16662
16697
  }
16698
+ log.info('[channelsLoadMore] processing channels for reaction message update:', channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length);
16663
16699
  channelMessageMap = {};
16664
- _context6.n = 5;
16700
+ _context6.n = 7;
16665
16701
  return call(function () {
16666
16702
  try {
16667
16703
  return Promise.resolve(Promise.all(channelsForUpdateLastReactionMessage.map(function (channel) {
@@ -16669,9 +16705,10 @@ function channelsLoadMore(action) {
16669
16705
  return Promise.resolve(new Promise(function (resolve) {
16670
16706
  channel.getMessagesById([channel.newReactions[0].messageId]).then(function (messages) {
16671
16707
  channelMessageMap[channel.id] = messages[0];
16708
+ log.info('[channelsLoadMore] successfully fetched reaction message for channel:', channel === null || channel === void 0 ? void 0 : channel.id);
16672
16709
  resolve(true);
16673
16710
  })["catch"](function (e) {
16674
- log.error(e, 'Error on getMessagesById');
16711
+ log.error(e, 'Error on getMessagesById for channel:', channel === null || channel === void 0 ? void 0 : channel.id);
16675
16712
  resolve(true);
16676
16713
  });
16677
16714
  }));
@@ -16683,30 +16720,43 @@ function channelsLoadMore(action) {
16683
16720
  return Promise.reject(e);
16684
16721
  }
16685
16722
  });
16686
- case 5:
16723
+ case 7:
16724
+ log.info('[channelsLoadMore] reaction messages fetched:', channelMessageMap ? (_Object$keys2 = Object.keys(channelMessageMap)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length : 0);
16687
16725
  mappedChannels = mappedChannels.map(function (channel) {
16688
16726
  if (channelMessageMap[channel.id]) {
16689
16727
  channel.lastReactedMessage = channelMessageMap[channel.id];
16690
16728
  }
16691
16729
  return channel;
16692
16730
  });
16693
- case 6:
16694
- _context6.n = 7;
16695
- return put(addChannelsAC(mappedChannels));
16696
- case 7:
16697
- _context6.n = 8;
16698
- return put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
16731
+ log.info('[channelsLoadMore] mappedChannels updated with reaction messages, final count:', ((_mappedChannels6 = mappedChannels) === null || _mappedChannels6 === void 0 ? void 0 : _mappedChannels6.length) || 0);
16732
+ _context6.n = 9;
16733
+ break;
16699
16734
  case 8:
16735
+ log.info('[channelsLoadMore] no channels need reaction message update');
16736
+ case 9:
16737
+ log.info('[channelsLoadMore] adding channels to state, count:', ((_mappedChannels7 = mappedChannels) === null || _mappedChannels7 === void 0 ? void 0 : _mappedChannels7.length) || 0);
16700
16738
  _context6.n = 10;
16739
+ return put(addChannelsAC(mappedChannels));
16740
+ case 10:
16741
+ _context6.n = 11;
16742
+ return put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
16743
+ case 11:
16744
+ log.info('[channelsLoadMore] completed successfully. Total channels added:', ((_mappedChannels8 = mappedChannels) === null || _mappedChannels8 === void 0 ? void 0 : _mappedChannels8.length) || 0);
16745
+ _context6.n = 13;
16701
16746
  break;
16702
- case 9:
16703
- _context6.p = 9;
16747
+ case 12:
16748
+ _context6.p = 12;
16704
16749
  _t8 = _context6.v;
16705
- log.error(_t8, 'Error in load more channels');
16706
- case 10:
16750
+ log.error('[channelsLoadMore] error occurred:', _t8);
16751
+ log.error('[channelsLoadMore] error details:', JSON.stringify({
16752
+ message: _t8 === null || _t8 === void 0 ? void 0 : _t8.message,
16753
+ code: _t8 === null || _t8 === void 0 ? void 0 : _t8.code,
16754
+ stack: _t8 === null || _t8 === void 0 ? void 0 : _t8.stack
16755
+ }));
16756
+ case 13:
16707
16757
  return _context6.a(2);
16708
16758
  }
16709
- }, _marked6, null, [[0, 9]]);
16759
+ }, _marked6, null, [[1, 12]]);
16710
16760
  }
16711
16761
  function getChannelMentions(action) {
16712
16762
  var payload, channelId, _SceytChatClient3, mentionsQueryBuilder, mentionsQuery, mentions, _t9;
@@ -35247,7 +35297,7 @@ var OGMetadata = function OGMetadata(_ref) {
35247
35297
  metadataGetSuccessCallback === null || metadataGetSuccessCallback === void 0 ? void 0 : metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, false, false, metadata);
35248
35298
  }
35249
35299
  }
35250
- }, [metadataLoaded, oGMetadata, attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata, showOGMetadata, showImage, metadataGetSuccessCallback]);
35300
+ }, [metadataLoaded, oGMetadata, attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata, showOGMetadata, showImage]);
35251
35301
  var elements = useMemo(function () {
35252
35302
  var _resolvedOrder$image, _metadata$og17, _metadata$og17$image, _metadata$og17$image$, _resolvedOrder$title, _metadata$og18, _metadata$og18$title, _resolvedOrder$descri, _metadata$og19, _metadata$og19$descri, _resolvedOrder$link;
35253
35303
  return [showImage ? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sceyt-chat-react-uikit",
3
- "version": "1.7.7-beta.6",
3
+ "version": "1.7.7-beta.7",
4
4
  "description": "Interactive React UI Components for Sceyt Chat.",
5
5
  "author": "Sceyt",
6
6
  "license": "MIT",