sceyt-chat-react-uikit 1.8.7-beta.18 → 1.8.7-beta.19

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
@@ -24577,22 +24577,27 @@ function getChannels(action) {
24577
24577
  mappedChannels = _yield$call.channels;
24578
24578
  channelsForUpdateLastReactionMessage = _yield$call.channelsForUpdateLastReactionMessage;
24579
24579
  _loop = /*#__PURE__*/_regenerator().m(function _callee() {
24580
- var channelId, pendingLastMessage, mappedChannel, mapEntry;
24580
+ var _store$getState$Chann;
24581
+ var channelId, pendingLastMessage, currentReduxLastMessage, resolvedLastMessage, mappedChannel, mapEntry;
24581
24582
  return _regenerator().w(function (_context2) {
24582
24583
  while (1) switch (_context2.n) {
24583
24584
  case 0:
24584
24585
  channelId = _Object$keys[_i];
24585
24586
  pendingLastMessage = pendingLastMessages[channelId];
24587
+ currentReduxLastMessage = (_store$getState$Chann = store.getState().ChannelReducer.channels.find(function (ch) {
24588
+ return ch.id === channelId;
24589
+ })) === null || _store$getState$Chann === void 0 ? void 0 : _store$getState$Chann.lastMessage;
24590
+ resolvedLastMessage = currentReduxLastMessage !== null && currentReduxLastMessage !== void 0 && currentReduxLastMessage.id && !pendingLastMessage.id ? currentReduxLastMessage : pendingLastMessage;
24586
24591
  mappedChannel = mappedChannels.find(function (ch) {
24587
24592
  return ch.id === channelId;
24588
24593
  });
24589
24594
  if (mappedChannel) {
24590
- mappedChannel.lastMessage = pendingLastMessage;
24595
+ mappedChannel.lastMessage = resolvedLastMessage;
24591
24596
  }
24592
24597
  mapEntry = getChannelFromMap(channelId);
24593
24598
  if (mapEntry) {
24594
24599
  setChannelInMap(_extends({}, mapEntry, {
24595
- lastMessage: pendingLastMessage
24600
+ lastMessage: resolvedLastMessage
24596
24601
  }));
24597
24602
  }
24598
24603
  case 1:
package/index.modern.js CHANGED
@@ -24576,22 +24576,27 @@ function getChannels(action) {
24576
24576
  mappedChannels = _yield$call.channels;
24577
24577
  channelsForUpdateLastReactionMessage = _yield$call.channelsForUpdateLastReactionMessage;
24578
24578
  _loop = /*#__PURE__*/_regenerator().m(function _callee() {
24579
- var channelId, pendingLastMessage, mappedChannel, mapEntry;
24579
+ var _store$getState$Chann;
24580
+ var channelId, pendingLastMessage, currentReduxLastMessage, resolvedLastMessage, mappedChannel, mapEntry;
24580
24581
  return _regenerator().w(function (_context2) {
24581
24582
  while (1) switch (_context2.n) {
24582
24583
  case 0:
24583
24584
  channelId = _Object$keys[_i];
24584
24585
  pendingLastMessage = pendingLastMessages[channelId];
24586
+ currentReduxLastMessage = (_store$getState$Chann = store.getState().ChannelReducer.channels.find(function (ch) {
24587
+ return ch.id === channelId;
24588
+ })) === null || _store$getState$Chann === void 0 ? void 0 : _store$getState$Chann.lastMessage;
24589
+ resolvedLastMessage = currentReduxLastMessage !== null && currentReduxLastMessage !== void 0 && currentReduxLastMessage.id && !pendingLastMessage.id ? currentReduxLastMessage : pendingLastMessage;
24585
24590
  mappedChannel = mappedChannels.find(function (ch) {
24586
24591
  return ch.id === channelId;
24587
24592
  });
24588
24593
  if (mappedChannel) {
24589
- mappedChannel.lastMessage = pendingLastMessage;
24594
+ mappedChannel.lastMessage = resolvedLastMessage;
24590
24595
  }
24591
24596
  mapEntry = getChannelFromMap(channelId);
24592
24597
  if (mapEntry) {
24593
24598
  setChannelInMap(_extends({}, mapEntry, {
24594
- lastMessage: pendingLastMessage
24599
+ lastMessage: resolvedLastMessage
24595
24600
  }));
24596
24601
  }
24597
24602
  case 1:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sceyt-chat-react-uikit",
3
- "version": "1.8.7-beta.18",
3
+ "version": "1.8.7-beta.19",
4
4
  "description": "Interactive React UI Components for Sceyt Chat.",
5
5
  "author": "Sceyt",
6
6
  "license": "MIT",