sceyt-chat-react-uikit 1.6.9-beta.16 → 1.6.9-beta.18

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
@@ -10075,18 +10075,29 @@ function updateMessageOnMap(channelId, updatedMessage) {
10075
10075
  }
10076
10076
  }
10077
10077
  }
10078
+ var updatedMessageData = null;
10078
10079
  if (messagesMap[channelId]) {
10079
- messagesMap[channelId] = messagesMap[channelId].map(function (mes) {
10080
+ messagesMap[channelId].map(function (mes) {
10080
10081
  if (mes.tid === updatedMessage.messageId || mes.id === updatedMessage.messageId) {
10081
10082
  if (updatedMessage.params.state === MESSAGE_STATUS.DELETE) {
10082
- return _extends({}, updatedMessage.params);
10083
+ updatedMessageData = _extends({}, updatedMessage.params);
10084
+ return updatedMessageData;
10083
10085
  } else {
10084
- return _extends({}, mes, updatedMessage.params);
10086
+ var _updatedMessage$param;
10087
+ updatedMessageData = _extends({}, mes, updatedMessage.params, {
10088
+ attachments: [].concat(mes.attachments, ((_updatedMessage$param = updatedMessage.params) === null || _updatedMessage$param === void 0 ? void 0 : _updatedMessage$param.attachments) || []).filter(function (att, index, self) {
10089
+ return index === self.findIndex(function (t) {
10090
+ return t.url === att.url && t.type === att.type && t.name === att.name;
10091
+ });
10092
+ })
10093
+ });
10094
+ return updatedMessage;
10085
10095
  }
10086
10096
  }
10087
10097
  return mes;
10088
10098
  });
10089
10099
  }
10100
+ return updatedMessageData;
10090
10101
  }
10091
10102
  function addReactionToMessageOnMap(channelId, message, reaction, isSelf) {
10092
10103
  if (messagesMap[channelId]) {
@@ -10330,7 +10341,6 @@ var messageSlice = createSlice({
10330
10341
  reducers: {
10331
10342
  addMessage: function addMessage(state, action) {
10332
10343
  var message = action.payload.message;
10333
- log.info('addMessage ... ', message);
10334
10344
  state.activeChannelMessages.push(message);
10335
10345
  },
10336
10346
  deleteMessageFromList: function deleteMessageFromList(state, action) {
@@ -10448,11 +10458,48 @@ var messageSlice = createSlice({
10448
10458
  state.activeChannelMessages.push(params);
10449
10459
  }
10450
10460
  },
10451
- addReactionToMessage: function addReactionToMessage(state, action) {
10461
+ updateMessageAttachment: function updateMessageAttachment(state, action) {
10452
10462
  var _action$payload4 = action.payload,
10453
- message = _action$payload4.message,
10454
- reaction = _action$payload4.reaction,
10455
- isSelf = _action$payload4.isSelf;
10463
+ url = _action$payload4.url,
10464
+ messageId = _action$payload4.messageId,
10465
+ params = _action$payload4.params;
10466
+ state.activeChannelMessages = state.activeChannelMessages.map(function (message) {
10467
+ if (message.id === messageId) {
10468
+ for (var index = 0; index < message.attachments.length; index++) {
10469
+ var attachment = message.attachments[index];
10470
+ if (attachment.url === url) {
10471
+ message.attachments[index] = _extends({}, attachment, params);
10472
+ }
10473
+ }
10474
+ }
10475
+ if (message.attachments.length) {
10476
+ var detachedAttachments = message.attachments.map(function (att) {
10477
+ var _att$user, _att$user2;
10478
+ return _extends({}, att, {
10479
+ user: _extends({}, att.user, {
10480
+ metadata: _extends({}, ((_att$user = att.user) === null || _att$user === void 0 ? void 0 : _att$user.metadata) || {}),
10481
+ presence: _extends({}, ((_att$user2 = att.user) === null || _att$user2 === void 0 ? void 0 : _att$user2.presence) || {})
10482
+ })
10483
+ });
10484
+ });
10485
+ updateMessageOnAllMessages(messageId, {
10486
+ attachments: detachedAttachments
10487
+ });
10488
+ updateMessageOnMap(message.channelId, {
10489
+ messageId: messageId,
10490
+ params: {
10491
+ attachments: detachedAttachments
10492
+ }
10493
+ });
10494
+ }
10495
+ return message;
10496
+ });
10497
+ },
10498
+ addReactionToMessage: function addReactionToMessage(state, action) {
10499
+ var _action$payload5 = action.payload,
10500
+ message = _action$payload5.message,
10501
+ reaction = _action$payload5.reaction,
10502
+ isSelf = _action$payload5.isSelf;
10456
10503
  state.activeChannelMessages = state.activeChannelMessages.map(function (msg) {
10457
10504
  if (msg.id === message.id) {
10458
10505
  var slfReactions = [].concat(msg.userReactions);
@@ -10472,10 +10519,10 @@ var messageSlice = createSlice({
10472
10519
  });
10473
10520
  },
10474
10521
  deleteReactionFromMessage: function deleteReactionFromMessage(state, action) {
10475
- var _action$payload5 = action.payload,
10476
- reaction = _action$payload5.reaction,
10477
- message = _action$payload5.message,
10478
- isSelf = _action$payload5.isSelf;
10522
+ var _action$payload6 = action.payload,
10523
+ reaction = _action$payload6.reaction,
10524
+ message = _action$payload6.message,
10525
+ isSelf = _action$payload6.isSelf;
10479
10526
  state.activeChannelMessages = state.activeChannelMessages.map(function (msg) {
10480
10527
  if (msg.id === message.id) {
10481
10528
  var userReactions = msg.userReactions;
@@ -10524,9 +10571,9 @@ var messageSlice = createSlice({
10524
10571
  (_state$activeTabAttac = state.activeTabAttachments).push.apply(_state$activeTabAttac, action.payload.attachments);
10525
10572
  },
10526
10573
  addAttachmentsForPopup: function addAttachmentsForPopup(state, action) {
10527
- var _action$payload6 = action.payload,
10528
- attachments = _action$payload6.attachments,
10529
- direction = _action$payload6.direction;
10574
+ var _action$payload7 = action.payload,
10575
+ attachments = _action$payload7.attachments,
10576
+ direction = _action$payload7.direction;
10530
10577
  if (direction === 'prev') {
10531
10578
  var _state$attachmentsFor;
10532
10579
  (_state$attachmentsFor = state.attachmentsForPopup).push.apply(_state$attachmentsFor, attachments);
@@ -10542,11 +10589,11 @@ var messageSlice = createSlice({
10542
10589
  state.attachmentForPopupHasNext = action.payload.hasPrev;
10543
10590
  },
10544
10591
  updateUploadProgress: function updateUploadProgress(state, action) {
10545
- var _action$payload7 = action.payload,
10546
- uploaded = _action$payload7.uploaded,
10547
- total = _action$payload7.total,
10548
- attachmentId = _action$payload7.attachmentId,
10549
- progress = _action$payload7.progress;
10592
+ var _action$payload8 = action.payload,
10593
+ uploaded = _action$payload8.uploaded,
10594
+ total = _action$payload8.total,
10595
+ attachmentId = _action$payload8.attachmentId,
10596
+ progress = _action$payload8.progress;
10550
10597
  var updateData = {
10551
10598
  uploaded: uploaded,
10552
10599
  total: total,
@@ -10570,23 +10617,23 @@ var messageSlice = createSlice({
10570
10617
  state.messageForReply = action.payload.message;
10571
10618
  },
10572
10619
  uploadAttachmentCompilation: function uploadAttachmentCompilation(state, action) {
10573
- var _action$payload8 = action.payload,
10574
- attachmentUploadingState = _action$payload8.attachmentUploadingState,
10575
- attachmentId = _action$payload8.attachmentId;
10620
+ var _action$payload9 = action.payload,
10621
+ attachmentUploadingState = _action$payload9.attachmentUploadingState,
10622
+ attachmentId = _action$payload9.attachmentId;
10576
10623
  state.attachmentsUploadingState[attachmentId] = attachmentUploadingState;
10577
10624
  },
10578
10625
  setReactionsList: function setReactionsList(state, action) {
10579
- var _action$payload9 = action.payload,
10580
- reactions = _action$payload9.reactions,
10581
- hasNext = _action$payload9.hasNext;
10626
+ var _action$payload0 = action.payload,
10627
+ reactions = _action$payload0.reactions,
10628
+ hasNext = _action$payload0.hasNext;
10582
10629
  state.reactionsHasNext = hasNext;
10583
10630
  state.reactionsList = [].concat(reactions);
10584
10631
  },
10585
10632
  addReactionsToList: function addReactionsToList(state, action) {
10586
10633
  var _state$reactionsList;
10587
- var _action$payload0 = action.payload,
10588
- reactions = _action$payload0.reactions,
10589
- hasNext = _action$payload0.hasNext;
10634
+ var _action$payload1 = action.payload,
10635
+ reactions = _action$payload1.reactions,
10636
+ hasNext = _action$payload1.hasNext;
10590
10637
  state.reactionsHasNext = hasNext;
10591
10638
  (_state$reactionsList = state.reactionsList).push.apply(_state$reactionsList, reactions);
10592
10639
  },
@@ -10647,6 +10694,7 @@ var _messageSlice$actions = messageSlice.actions,
10647
10694
  addMessages = _messageSlice$actions.addMessages,
10648
10695
  updateMessagesStatus = _messageSlice$actions.updateMessagesStatus,
10649
10696
  updateMessage = _messageSlice$actions.updateMessage,
10697
+ updateMessageAttachment = _messageSlice$actions.updateMessageAttachment,
10650
10698
  addReactionToMessage = _messageSlice$actions.addReactionToMessage,
10651
10699
  deleteReactionFromMessage = _messageSlice$actions.deleteReactionFromMessage,
10652
10700
  setHasPrevMessages = _messageSlice$actions.setHasPrevMessages,
@@ -11738,6 +11786,13 @@ function setMessagesHasNextAC(hasNext) {
11738
11786
  hasNext: hasNext
11739
11787
  });
11740
11788
  }
11789
+ function setUpdateMessageAttachmentAC(url, messageId, params) {
11790
+ return updateMessageAttachment({
11791
+ url: url,
11792
+ messageId: messageId,
11793
+ params: params
11794
+ });
11795
+ }
11741
11796
  function updateMessageAC(messageId, params, addIfNotExists) {
11742
11797
  return updateMessage({
11743
11798
  messageId: messageId,
@@ -17153,12 +17208,6 @@ var addPendingMessage = function addPendingMessage(message, messageCopy, channel
17153
17208
  addMessageToMap(channel.id, messageToAdd);
17154
17209
  addAllMessages([messageToAdd], MESSAGE_LOAD_DIRECTION.NEXT);
17155
17210
  setPendingMessages(channel.id, [messageToAdd]);
17156
- var hasNextMessages = store.getState().MessageReducer.messagesHasNext;
17157
- var activeChannelMessages = store.getState().MessageReducer.activeChannelMessages;
17158
- var isLatestMessageInChannelMessages = activeChannelMessages[activeChannelMessages.length - 1].id === channel.lastMessage.id;
17159
- if (hasNextMessages || !isLatestMessageInChannelMessages) {
17160
- store.dispatch(getMessagesAC(channel, true, channel.lastMessage.id, undefined, undefined, false));
17161
- }
17162
17211
  store.dispatch(scrollToNewMessageAC(true));
17163
17212
  store.dispatch(addMessageAC(messageToAdd));
17164
17213
  return Promise.resolve();
@@ -18332,27 +18381,26 @@ function editMessage(action) {
18332
18381
  }, _marked6$1, null, [[0, 5]]);
18333
18382
  }
18334
18383
  function getMessagesQuery(action) {
18335
- var _action$payload, channel, loadWithLastMessage, messageId, limit, withDeliveredMessages, highlight, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, allMessages, havLastMessage, secondResult, sentMessages, messagesMap, filteredSentMessages, _allMessages, messageIndex, maxLengthPart, _secondResult, thirdResult, _secondResult2, _thirdResult, _secondResult3, _secondResult4, pendingMessages, _messagesMap, filteredPendingMessages, index, mes, _t9;
18384
+ var _action$payload, channel, loadWithLastMessage, messageId, limit, withDeliveredMessages, highlight, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, allMessages, havLastMessage, secondResult, sentMessages, messagesMap, filteredSentMessages, _allMessages, messageIndex, maxLengthPart, _secondResult, thirdResult, _secondResult2, _thirdResult, _secondResult3, _secondResult4, updatedMessages, pendingMessages, _messagesMap, filteredPendingMessages, index, mes, _t9;
18336
18385
  return _regenerator().w(function (_context9) {
18337
18386
  while (1) switch (_context9.p = _context9.n) {
18338
18387
  case 0:
18339
- log.info('getMessagesQuery ... ');
18340
- _context9.p = 1;
18341
- _context9.n = 2;
18388
+ _context9.p = 0;
18389
+ _context9.n = 1;
18342
18390
  return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
18343
- case 2:
18391
+ case 1:
18344
18392
  _action$payload = action.payload, channel = _action$payload.channel, loadWithLastMessage = _action$payload.loadWithLastMessage, messageId = _action$payload.messageId, limit = _action$payload.limit, withDeliveredMessages = _action$payload.withDeliveredMessages, highlight = _action$payload.highlight;
18345
18393
  if (!(channel.id && !channel.isMockChannel)) {
18346
- _context9.n = 49;
18394
+ _context9.n = 48;
18347
18395
  break;
18348
18396
  }
18349
18397
  SceytChatClient = getClient();
18350
18398
  messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channel.id);
18351
18399
  messageQueryBuilder.limit(limit || MESSAGES_MAX_LENGTH);
18352
18400
  messageQueryBuilder.reverse(true);
18353
- _context9.n = 3;
18401
+ _context9.n = 2;
18354
18402
  return effects.call(messageQueryBuilder.build);
18355
- case 3:
18403
+ case 2:
18356
18404
  messageQuery = _context9.v;
18357
18405
  query.messageQuery = messageQuery;
18358
18406
  cachedMessages = getMessagesFromMap(channel.id);
@@ -18361,33 +18409,33 @@ function getMessagesQuery(action) {
18361
18409
  hasNext: false
18362
18410
  };
18363
18411
  if (!loadWithLastMessage) {
18364
- _context9.n = 15;
18412
+ _context9.n = 13;
18365
18413
  break;
18366
18414
  }
18367
18415
  allMessages = getAllMessages();
18368
18416
  havLastMessage = allMessages && allMessages.length && channel.lastMessage && allMessages[allMessages.length - 1] && allMessages[allMessages.length - 1].id === channel.lastMessage.id;
18369
18417
  if (!(channel.newMessageCount && channel.newMessageCount > 0 || !havLastMessage)) {
18370
- _context9.n = 10;
18418
+ _context9.n = 8;
18371
18419
  break;
18372
18420
  }
18373
18421
  setHasPrevCached(false);
18374
18422
  setAllMessages([]);
18375
- _context9.n = 4;
18423
+ _context9.n = 3;
18376
18424
  return effects.call(messageQuery.loadPreviousMessageId, '0');
18377
- case 4:
18425
+ case 3:
18378
18426
  result = _context9.v;
18379
18427
  if (!(result.messages.length === 50)) {
18380
- _context9.n = 6;
18428
+ _context9.n = 5;
18381
18429
  break;
18382
18430
  }
18383
18431
  messageQuery.limit = 30;
18384
- _context9.n = 5;
18432
+ _context9.n = 4;
18385
18433
  return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
18386
- case 5:
18434
+ case 4:
18387
18435
  secondResult = _context9.v;
18388
18436
  result.messages = [].concat(secondResult.messages, result.messages);
18389
18437
  result.hasNext = secondResult.hasNext;
18390
- case 6:
18438
+ case 5:
18391
18439
  sentMessages = [];
18392
18440
  if (withDeliveredMessages) {
18393
18441
  sentMessages = getFromAllMessagesByMessageId('', '', true);
@@ -18400,43 +18448,40 @@ function getMessagesQuery(action) {
18400
18448
  return !messagesMap[msg.tid || ''];
18401
18449
  });
18402
18450
  result.messages = [].concat(result.messages, filteredSentMessages).slice(filteredSentMessages.length);
18403
- _context9.n = 7;
18451
+ _context9.n = 6;
18404
18452
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18405
- case 7:
18453
+ case 6:
18406
18454
  setMessagesToMap(channel.id, result.messages);
18407
18455
  setAllMessages(result.messages);
18408
- _context9.n = 8;
18456
+ _context9.n = 7;
18409
18457
  return effects.put(setMessagesHasPrevAC(true));
18458
+ case 7:
18459
+ _context9.n = 10;
18460
+ break;
18410
18461
  case 8:
18462
+ result.messages = getFromAllMessagesByMessageId('', '', true);
18411
18463
  _context9.n = 9;
18412
- return effects.put(markChannelAsReadAC(channel.id));
18464
+ return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18413
18465
  case 9:
18414
- _context9.n = 12;
18415
- break;
18466
+ _context9.n = 10;
18467
+ return effects.put(setMessagesHasPrevAC(true));
18416
18468
  case 10:
18417
- result.messages = getFromAllMessagesByMessageId('', '', true);
18418
18469
  _context9.n = 11;
18419
- return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18420
- case 11:
18421
- _context9.n = 12;
18422
- return effects.put(setMessagesHasPrevAC(true));
18423
- case 12:
18424
- _context9.n = 13;
18425
18470
  return effects.put(setMessagesHasNextAC(false));
18426
- case 13:
18471
+ case 11:
18427
18472
  setHasNextCached(false);
18428
18473
  if (!messageId) {
18429
- _context9.n = 14;
18474
+ _context9.n = 12;
18430
18475
  break;
18431
18476
  }
18432
- _context9.n = 14;
18477
+ _context9.n = 12;
18433
18478
  return effects.put(setScrollToMessagesAC(messageId, highlight));
18434
- case 14:
18435
- _context9.n = 46;
18479
+ case 12:
18480
+ _context9.n = 45;
18436
18481
  break;
18437
- case 15:
18482
+ case 13:
18438
18483
  if (!messageId) {
18439
- _context9.n = 27;
18484
+ _context9.n = 25;
18440
18485
  break;
18441
18486
  }
18442
18487
  _allMessages = getAllMessages();
@@ -18445,176 +18490,183 @@ function getMessagesQuery(action) {
18445
18490
  });
18446
18491
  maxLengthPart = MESSAGES_MAX_LENGTH / 2;
18447
18492
  if (!(messageIndex >= maxLengthPart)) {
18448
- _context9.n = 17;
18493
+ _context9.n = 15;
18449
18494
  break;
18450
18495
  }
18451
18496
  result.messages = _allMessages.slice(messageIndex - maxLengthPart, messageIndex + maxLengthPart);
18452
- _context9.n = 16;
18497
+ _context9.n = 14;
18453
18498
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18454
- case 16:
18499
+ case 14:
18455
18500
  setHasPrevCached(messageIndex > maxLengthPart);
18456
18501
  setHasNextCached(_allMessages.length > maxLengthPart);
18457
- _context9.n = 24;
18502
+ _context9.n = 22;
18458
18503
  break;
18459
- case 17:
18504
+ case 15:
18460
18505
  messageQuery.limit = MESSAGES_MAX_LENGTH;
18461
18506
  log.info('load by message id from server ...............', messageId);
18462
- _context9.n = 18;
18507
+ _context9.n = 16;
18463
18508
  return effects.call(messageQuery.loadNearMessageId, messageId);
18464
- case 18:
18509
+ case 16:
18465
18510
  result = _context9.v;
18466
18511
  if (!(result.messages.length === 50)) {
18467
- _context9.n = 21;
18512
+ _context9.n = 19;
18468
18513
  break;
18469
18514
  }
18470
18515
  messageQuery.limit = (MESSAGES_MAX_LENGTH - 50) / 2;
18471
- _context9.n = 19;
18516
+ _context9.n = 17;
18472
18517
  return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
18473
- case 19:
18518
+ case 17:
18474
18519
  _secondResult = _context9.v;
18475
18520
  messageQuery.reverse = false;
18476
- _context9.n = 20;
18521
+ _context9.n = 18;
18477
18522
  return effects.call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
18478
- case 20:
18523
+ case 18:
18479
18524
  thirdResult = _context9.v;
18480
18525
  result.messages = [].concat(_secondResult.messages, result.messages, thirdResult.messages);
18481
18526
  result.hasNext = _secondResult.hasNext;
18482
18527
  messageQuery.reverse = true;
18483
- case 21:
18528
+ case 19:
18484
18529
  log.info('result from server ....... ', result);
18485
- _context9.n = 22;
18530
+ _context9.n = 20;
18486
18531
  return effects.put(setMessagesHasNextAC(true));
18487
- case 22:
18488
- _context9.n = 23;
18532
+ case 20:
18533
+ _context9.n = 21;
18489
18534
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18490
- case 23:
18535
+ case 21:
18491
18536
  setAllMessages([].concat(result.messages));
18492
18537
  setHasPrevCached(false);
18493
18538
  setHasNextCached(false);
18494
- case 24:
18495
- _context9.n = 25;
18539
+ case 22:
18540
+ _context9.n = 23;
18496
18541
  return effects.put(setScrollToMessagesAC(messageId));
18497
- case 25:
18498
- _context9.n = 26;
18542
+ case 23:
18543
+ _context9.n = 24;
18499
18544
  return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
18500
- case 26:
18501
- _context9.n = 46;
18545
+ case 24:
18546
+ _context9.n = 45;
18502
18547
  break;
18503
- case 27:
18548
+ case 25:
18504
18549
  if (!(channel.newMessageCount && channel.lastDisplayedMessageId)) {
18505
- _context9.n = 40;
18550
+ _context9.n = 38;
18506
18551
  break;
18507
18552
  }
18508
18553
  setAllMessages([]);
18509
18554
  messageQuery.limit = MESSAGES_MAX_LENGTH;
18510
18555
  if (!Number(channel.lastDisplayedMessageId)) {
18511
- _context9.n = 33;
18556
+ _context9.n = 31;
18512
18557
  break;
18513
18558
  }
18514
- _context9.n = 28;
18559
+ _context9.n = 26;
18515
18560
  return effects.call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
18516
- case 28:
18561
+ case 26:
18517
18562
  result = _context9.v;
18518
18563
  if (!(result.messages.length === 50)) {
18519
- _context9.n = 32;
18564
+ _context9.n = 30;
18520
18565
  break;
18521
18566
  }
18522
18567
  messageQuery.limit = channel.newMessageCount > 25 ? (MESSAGES_MAX_LENGTH - 50) / 2 : MESSAGES_MAX_LENGTH - 50;
18523
- _context9.n = 29;
18568
+ _context9.n = 27;
18524
18569
  return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
18525
- case 29:
18570
+ case 27:
18526
18571
  _secondResult2 = _context9.v;
18527
18572
  if (!(channel.newMessageCount > 25)) {
18528
- _context9.n = 31;
18573
+ _context9.n = 29;
18529
18574
  break;
18530
18575
  }
18531
18576
  messageQuery.reverse = false;
18532
- _context9.n = 30;
18577
+ _context9.n = 28;
18533
18578
  return effects.call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
18534
- case 30:
18579
+ case 28:
18535
18580
  _thirdResult = _context9.v;
18536
18581
  result.messages = [].concat(_secondResult2.messages, result.messages, _thirdResult.messages);
18537
18582
  messageQuery.reverse = true;
18538
- _context9.n = 32;
18583
+ _context9.n = 30;
18539
18584
  break;
18540
- case 31:
18585
+ case 29:
18541
18586
  result.messages = [].concat(_secondResult2.messages, result.messages);
18542
- case 32:
18543
- _context9.n = 36;
18544
- break;
18545
- case 33:
18587
+ case 30:
18546
18588
  _context9.n = 34;
18589
+ break;
18590
+ case 31:
18591
+ _context9.n = 32;
18547
18592
  return effects.call(messageQuery.loadPrevious);
18548
- case 34:
18593
+ case 32:
18549
18594
  result = _context9.v;
18550
18595
  if (!(result.messages.length === 50)) {
18551
- _context9.n = 36;
18596
+ _context9.n = 34;
18552
18597
  break;
18553
18598
  }
18554
18599
  messageQuery.limit = MESSAGES_MAX_LENGTH - 50;
18555
- _context9.n = 35;
18600
+ _context9.n = 33;
18556
18601
  return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
18557
- case 35:
18602
+ case 33:
18558
18603
  _secondResult3 = _context9.v;
18559
18604
  result.messages = [].concat(_secondResult3.messages, result.messages);
18560
18605
  result.hasNext = _secondResult3.hasNext;
18561
- case 36:
18606
+ case 34:
18562
18607
  setMessagesToMap(channel.id, result.messages);
18563
- _context9.n = 37;
18608
+ _context9.n = 35;
18564
18609
  return effects.put(setMessagesHasPrevAC(true));
18565
- case 37:
18566
- _context9.n = 38;
18610
+ case 35:
18611
+ _context9.n = 36;
18567
18612
  return effects.put(setMessagesHasNextAC(channel.lastMessage && result.messages.length > 0 && channel.lastMessage.id !== result.messages[result.messages.length - 1].id));
18568
- case 38:
18613
+ case 36:
18569
18614
  setAllMessages([].concat(result.messages));
18570
- _context9.n = 39;
18615
+ _context9.n = 37;
18571
18616
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
18572
- case 39:
18573
- _context9.n = 46;
18617
+ case 37:
18618
+ _context9.n = 45;
18574
18619
  break;
18575
- case 40:
18620
+ case 38:
18576
18621
  setAllMessages([]);
18577
18622
  if (!(cachedMessages && cachedMessages.length)) {
18578
- _context9.n = 41;
18623
+ _context9.n = 39;
18579
18624
  break;
18580
18625
  }
18581
18626
  setAllMessages([].concat(cachedMessages));
18582
- _context9.n = 41;
18627
+ _context9.n = 39;
18583
18628
  return effects.put(setMessagesAC(JSON.parse(JSON.stringify(cachedMessages))));
18584
- case 41:
18629
+ case 39:
18585
18630
  log.info('load message from server');
18586
- _context9.n = 42;
18631
+ _context9.n = 40;
18587
18632
  return effects.call(messageQuery.loadPrevious);
18588
- case 42:
18633
+ case 40:
18589
18634
  result = _context9.v;
18590
18635
  if (!(result.messages.length === 50)) {
18591
- _context9.n = 44;
18636
+ _context9.n = 42;
18592
18637
  break;
18593
18638
  }
18594
18639
  messageQuery.limit = MESSAGES_MAX_LENGTH - 50;
18595
- _context9.n = 43;
18640
+ _context9.n = 41;
18596
18641
  return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
18597
- case 43:
18642
+ case 41:
18598
18643
  _secondResult4 = _context9.v;
18599
18644
  result.messages = [].concat(_secondResult4.messages, result.messages);
18600
18645
  result.hasNext = _secondResult4.hasNext;
18601
- case 44:
18646
+ case 42:
18647
+ updatedMessages = [];
18602
18648
  result.messages.forEach(function (msg) {
18603
- updateMessageOnMap(channel.id, {
18649
+ var updatedMessage = updateMessageOnMap(channel.id, {
18604
18650
  messageId: msg.id,
18605
18651
  params: msg
18606
18652
  });
18607
- updateMessageOnAllMessages(msg.id, msg);
18653
+ updateMessageOnAllMessages(msg.id, updatedMessage || msg);
18654
+ updatedMessages.push(updatedMessage || msg);
18608
18655
  });
18609
- _context9.n = 45;
18656
+ setMessagesToMap(channel.id, updatedMessages);
18657
+ setAllMessages([].concat(updatedMessages));
18658
+ _context9.n = 43;
18659
+ return effects.put(setMessagesAC(JSON.parse(JSON.stringify(updatedMessages))));
18660
+ case 43:
18661
+ _context9.n = 44;
18610
18662
  return effects.put(setMessagesHasPrevAC(result.hasNext));
18611
- case 45:
18612
- _context9.n = 46;
18663
+ case 44:
18664
+ _context9.n = 45;
18613
18665
  return effects.put(setMessagesHasNextAC(false));
18614
- case 46:
18666
+ case 45:
18615
18667
  pendingMessages = getPendingMessages(channel.id);
18616
18668
  if (!(pendingMessages && pendingMessages.length)) {
18617
- _context9.n = 48;
18669
+ _context9.n = 47;
18618
18670
  break;
18619
18671
  }
18620
18672
  _messagesMap = {};
@@ -18624,40 +18676,40 @@ function getMessagesQuery(action) {
18624
18676
  filteredPendingMessages = pendingMessages.filter(function (msg) {
18625
18677
  return !_messagesMap[msg.tid || ''];
18626
18678
  });
18627
- _context9.n = 47;
18679
+ _context9.n = 46;
18628
18680
  return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
18629
- case 47:
18681
+ case 46:
18630
18682
  for (index = 0; index < filteredPendingMessages.length; index++) {
18631
18683
  mes = filteredPendingMessages[index];
18632
18684
  removePendingMessageFromMap(channel === null || channel === void 0 ? void 0 : channel.id, mes.tid || mes.id);
18633
18685
  }
18634
- case 48:
18635
- _context9.n = 50;
18686
+ case 47:
18687
+ _context9.n = 49;
18636
18688
  break;
18637
- case 49:
18689
+ case 48:
18638
18690
  if (!channel.isMockChannel) {
18639
- _context9.n = 50;
18691
+ _context9.n = 49;
18640
18692
  break;
18641
18693
  }
18642
- _context9.n = 50;
18694
+ _context9.n = 49;
18643
18695
  return effects.put(setMessagesAC([]));
18644
- case 50:
18645
- _context9.n = 52;
18696
+ case 49:
18697
+ _context9.n = 51;
18646
18698
  break;
18647
- case 51:
18648
- _context9.p = 51;
18699
+ case 50:
18700
+ _context9.p = 50;
18649
18701
  _t9 = _context9.v;
18650
18702
  log.error('error in message query', _t9);
18651
- case 52:
18652
- _context9.p = 52;
18653
- _context9.n = 53;
18703
+ case 51:
18704
+ _context9.p = 51;
18705
+ _context9.n = 52;
18654
18706
  return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
18707
+ case 52:
18708
+ return _context9.f(51);
18655
18709
  case 53:
18656
- return _context9.f(52);
18657
- case 54:
18658
18710
  return _context9.a(2);
18659
18711
  }
18660
- }, _marked7$1, null, [[1, 51, 52, 54]]);
18712
+ }, _marked7$1, null, [[0, 50, 51, 53]]);
18661
18713
  }
18662
18714
  function loadMoreMessages(action) {
18663
18715
  var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _t0;
@@ -23133,7 +23185,8 @@ var ChannelList = function ChannelList(_ref) {
23133
23185
  channelAvatarSize = _ref.channelAvatarSize,
23134
23186
  channelAvatarTextSize = _ref.channelAvatarTextSize,
23135
23187
  searchChannelInputFontSize = _ref.searchChannelInputFontSize,
23136
- searchedChannelsTitleFontSize = _ref.searchedChannelsTitleFontSize;
23188
+ searchedChannelsTitleFontSize = _ref.searchedChannelsTitleFontSize,
23189
+ searchChannelsPadding = _ref.searchChannelsPadding;
23137
23190
  var _useColor = useColors(),
23138
23191
  background = _useColor[THEME_COLORS.BACKGROUND],
23139
23192
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
@@ -23370,7 +23423,8 @@ var ChannelList = function ChannelList(_ref) {
23370
23423
  }, /*#__PURE__*/React__default.createElement(ChannelListHeader, {
23371
23424
  withCustomList: !!List,
23372
23425
  maxWidth: channelListRef.current && ((_channelListRef$curre2 = channelListRef.current) === null || _channelListRef$curre2 === void 0 ? void 0 : _channelListRef$curre2.clientWidth) || 0,
23373
- borderColor: borderColor
23426
+ borderColor: borderColor,
23427
+ padding: searchChannelsPadding
23374
23428
  }, Profile, showSearch && searchChannelsPosition === 'inline' ? (/*#__PURE__*/React__default.createElement(ChannelSearch, {
23375
23429
  inline: true,
23376
23430
  borderRadius: searchInputBorderRadius,
@@ -23693,8 +23747,10 @@ var NoData = styled__default.div(_templateObject8$4 || (_templateObject8$4 = _ta
23693
23747
  return props.color;
23694
23748
  });
23695
23749
  var LoadingWrapper = styled__default.div(_templateObject9$4 || (_templateObject9$4 = _taggedTemplateLiteralLoose(["\n position: absolute;\n left: calc(50% - 20px);\n top: calc(50% - 20px);\n"])));
23696
- var ChannelListHeader = styled__default.div(_templateObject0$3 || (_templateObject0$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n max-width: ", ";\n padding: 12px;\n padding-left: 22px;\n box-sizing: border-box;\n padding-left: ", ";\n border-right: ", ";\n"])), function (props) {
23750
+ var ChannelListHeader = styled__default.div(_templateObject0$3 || (_templateObject0$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n max-width: ", ";\n padding: ", ";\n padding-left: 22px;\n box-sizing: border-box;\n padding-left: ", ";\n border-right: ", ";\n"])), function (props) {
23697
23751
  return props.maxWidth ? props.maxWidth + "px" : 'inherit';
23752
+ }, function (props) {
23753
+ return props.padding || '12px';
23698
23754
  }, function (props) {
23699
23755
  return props.withoutProfile && '52px';
23700
23756
  }, function (props) {
@@ -24720,7 +24776,7 @@ var VolumeSlide = styled__default.input(_templateObject9$6 || (_templateObject9$
24720
24776
  var Progress = styled__default.input(_templateObject0$5 || (_templateObject0$5 = _taggedTemplateLiteralLoose(["\n -webkit-appearance: none;\n margin-right: 15px;\n width: 100%;\n height: 4px;\n background: rgba(255, 255, 255, 0.6);\n border-radius: 5px;\n background-image: linear-gradient(#fff, #fff);\n //background-size: 70% 100%;\n background-repeat: no-repeat;\n cursor: pointer;\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n &::-moz-range-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n\n &::-ms-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n\n &::-webkit-slider-thumb:hover {\n background: #fff;\n }\n &::-moz-range-thumb:hover {\n background: #fff;\n }\n &::-ms-thumb:hover {\n background: #fff;\n }\n\n &::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n\n &::-moz-range-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n &::-ms-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n"])));
24721
24777
  var FullScreenWrapper = styled__default.div(_templateObject1$3 || (_templateObject1$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n margin-left: 16px;\n cursor: pointer;\n @media (max-width: 768px) {\n margin-left: 12px;\n & > svg {\n width: 18px;\n height: 18px;\n }\n }\n @media (max-width: 480px) {\n margin-left: auto;\n & > svg {\n width: 16px;\n height: 16px;\n }\n }\n"])));
24722
24778
 
24723
- var _templateObject$l, _templateObject2$i, _templateObject3$e, _templateObject4$c, _templateObject5$a, _templateObject6$8, _templateObject7$7, _templateObject8$7, _templateObject9$7, _templateObject0$6;
24779
+ var _templateObject$l, _templateObject2$i, _templateObject3$e, _templateObject4$c, _templateObject5$a, _templateObject6$8, _templateObject7$7, _templateObject8$7, _templateObject9$7, _templateObject0$6, _templateObject1$4;
24724
24780
  function ForwardMessagePopup(_ref) {
24725
24781
  var title = _ref.title,
24726
24782
  buttonText = _ref.buttonText,
@@ -24970,7 +25026,9 @@ function ForwardMessagePopup(_ref) {
24970
25026
  backgroundColor: 'transparent',
24971
25027
  checkedBackgroundColor: accentColor
24972
25028
  }));
24973
- }))))) : channels.map(function (channel) {
25029
+ }))), !searchedChannels.chats_groups.length && !searchedChannels.channels.length && (/*#__PURE__*/React__default.createElement(NoResults, {
25030
+ color: textSecondary
25031
+ }, "No channels found")))) : channels.map(function (channel) {
24974
25032
  var _channel$metadata3;
24975
25033
  var isDirectChannel = channel.type === DEFAULT_CHANNEL_TYPE.DIRECT;
24976
25034
  var isSelfChannel = isDirectChannel && ((_channel$metadata3 = channel.metadata) === null || _channel$metadata3 === void 0 ? void 0 : _channel$metadata3.s);
@@ -25054,6 +25112,9 @@ var SelectedChannelName = styled__default.span(_templateObject9$7 || (_templateO
25054
25112
  return props.color;
25055
25113
  });
25056
25114
  var StyledSubtractSvg$1 = styled__default(SvgCross)(_templateObject0$6 || (_templateObject0$6 = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin-left: 4px;\n transform: translate(2px, 0);\n"])));
25115
+ var NoResults = styled__default.div(_templateObject1$4 || (_templateObject1$4 = _taggedTemplateLiteralLoose(["\n font-size: 15px;\n line-height: 16px;\n font-weight: 500;\n text-align: center;\n margin-top: 20px;\n color: ", ";\n"])), function (props) {
25116
+ return props.color;
25117
+ });
25057
25118
 
25058
25119
  var _templateObject$m, _templateObject2$j;
25059
25120
  var CustomRadio = function CustomRadio(_ref) {
@@ -25227,7 +25288,7 @@ var DeleteOptionItem = styled__default.div(_templateObject2$k || (_templateObjec
25227
25288
  return props.color;
25228
25289
  });
25229
25290
 
25230
- var _templateObject$o, _templateObject2$l, _templateObject3$f, _templateObject4$d, _templateObject5$b, _templateObject6$9, _templateObject7$8, _templateObject8$8, _templateObject9$8, _templateObject0$7, _templateObject1$4, _templateObject10$2, _templateObject11$2, _templateObject12$2, _templateObject13$2;
25291
+ var _templateObject$o, _templateObject2$l, _templateObject3$f, _templateObject4$d, _templateObject5$b, _templateObject6$9, _templateObject7$8, _templateObject8$8, _templateObject9$8, _templateObject0$7, _templateObject1$5, _templateObject10$2, _templateObject11$2, _templateObject12$2, _templateObject13$2;
25231
25292
  var SliderPopup = function SliderPopup(_ref) {
25232
25293
  var channel = _ref.channel,
25233
25294
  setIsSliderOpen = _ref.setIsSliderOpen,
@@ -25768,7 +25829,7 @@ var FileSize = styled__default.span(_templateObject9$8 || (_templateObject9$8 =
25768
25829
  var UserName = styled__default.h4(_templateObject0$7 || (_templateObject0$7 = _taggedTemplateLiteralLoose(["\n margin: 0;\n color: ", ";\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n"])), function (props) {
25769
25830
  return props.color;
25770
25831
  });
25771
- var ActionsWrapper = styled__default.div(_templateObject1$4 || (_templateObject1$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n"])));
25832
+ var ActionsWrapper = styled__default.div(_templateObject1$5 || (_templateObject1$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n"])));
25772
25833
  var IconWrapper = styled__default.span(_templateObject10$2 || (_templateObject10$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n cursor: pointer;\n color: ", ";\n margin: ", ";\n\n & > svg {\n width: 28px;\n height: 28px;\n }\n\n ", "\n"])), function (props) {
25773
25834
  return props.color;
25774
25835
  }, function (props) {
@@ -29113,7 +29174,7 @@ var Timer$1 = styled__default.div(_templateObject6$c || (_templateObject6$c = _t
29113
29174
  return props.color;
29114
29175
  });
29115
29176
 
29116
- var _templateObject$u, _templateObject2$q, _templateObject3$k, _templateObject4$h, _templateObject5$f, _templateObject6$d, _templateObject7$b, _templateObject8$a, _templateObject9$a, _templateObject0$9, _templateObject1$5, _templateObject10$3, _templateObject11$3;
29177
+ var _templateObject$u, _templateObject2$q, _templateObject3$k, _templateObject4$h, _templateObject5$f, _templateObject6$d, _templateObject7$b, _templateObject8$a, _templateObject9$a, _templateObject0$9, _templateObject1$6, _templateObject10$3, _templateObject11$3;
29117
29178
  var Attachment = function Attachment(_ref) {
29118
29179
  var attachment = _ref.attachment,
29119
29180
  _ref$isPreview = _ref.isPreview,
@@ -29226,7 +29287,15 @@ var Attachment = function Attachment(_ref) {
29226
29287
  if (downloadIsCancelled) {
29227
29288
  setDownloadIsCancelled(false);
29228
29289
  if (customDownloader) {
29229
- customDownloader(attachment.url, false, function () {}, messageType).then(function (url) {
29290
+ customDownloader(attachment.url, false, function (progress) {
29291
+ var loadedRes = progress.loaded && progress.loaded / progress.total;
29292
+ var uploadPercent = loadedRes && loadedRes * 100;
29293
+ setSizeProgress({
29294
+ loaded: progress.loaded || 0,
29295
+ total: progress.total || 0
29296
+ });
29297
+ setProgress(uploadPercent);
29298
+ }, messageType).then(function (url) {
29230
29299
  downloadImage(url);
29231
29300
  });
29232
29301
  } else {
@@ -29354,23 +29423,35 @@ var Attachment = function Attachment(_ref) {
29354
29423
  }
29355
29424
  }, [attachmentUrl]);
29356
29425
  React.useEffect(function () {
29357
- if (connectionStatus === CONNECTION_STATUS.CONNECTED && attachment.id && !(attachment.type === attachmentTypes.file || attachment.type === attachmentTypes.link)) {
29426
+ if (!attachment.attachmentUrl && connectionStatus === CONNECTION_STATUS.CONNECTED && attachment.id && !(attachment.type === attachmentTypes.file || attachment.type === attachmentTypes.link)) {
29358
29427
  getAttachmentUrlFromCache(attachment.url).then(function (cachedUrl) {
29359
29428
  try {
29360
29429
  if (attachment.type === 'image' && !isPreview) {
29361
29430
  if (cachedUrl) {
29362
29431
  setAttachmentUrl(cachedUrl);
29432
+ dispatch(setUpdateMessageAttachmentAC(attachment.url, attachment.messageId, {
29433
+ attachmentUrl: cachedUrl
29434
+ }));
29363
29435
  setIsCached(true);
29364
29436
  } else {
29365
29437
  setIsCached(false);
29366
29438
  setDownloadingFile(true);
29367
29439
  if (customDownloader) {
29368
- customDownloader(attachment.url, false, function () {}, messageType).then(function (url) {
29440
+ customDownloader(attachment.url, false, function (progress) {
29441
+ var loadedRes = progress.loaded && progress.loaded / progress.total;
29442
+ var uploadPercent = loadedRes && loadedRes * 100;
29443
+ setSizeProgress({
29444
+ loaded: progress.loaded || 0,
29445
+ total: progress.total || 0
29446
+ });
29447
+ setProgress(uploadPercent);
29448
+ }, messageType).then(function (url) {
29369
29449
  try {
29370
29450
  downloadImage(url);
29371
29451
  return Promise.resolve(fetch(url)).then(function (response) {
29372
29452
  setAttachmentToCache(attachment.url, response);
29373
29453
  setIsCached(true);
29454
+ setDownloadingFile(false);
29374
29455
  });
29375
29456
  } catch (e) {
29376
29457
  return Promise.reject(e);
@@ -29409,7 +29490,15 @@ var Attachment = function Attachment(_ref) {
29409
29490
  log.info('error on get attachment url from cache. .. ', e);
29410
29491
  if (customDownloader) {
29411
29492
  setDownloadingFile(true);
29412
- customDownloader(attachment.url, false, function () {}, messageType).then(function (url) {
29493
+ customDownloader(attachment.url, true, function (progress) {
29494
+ var loadedRes = progress.loaded && progress.loaded / progress.total;
29495
+ var uploadPercent = loadedRes && loadedRes * 100;
29496
+ setSizeProgress({
29497
+ loaded: progress.loaded || 0,
29498
+ total: progress.total || 0
29499
+ });
29500
+ setProgress(uploadPercent);
29501
+ }, messageType).then(function (url) {
29413
29502
  try {
29414
29503
  return Promise.resolve(fetch(url)).then(function (response) {
29415
29504
  setAttachmentToCache(attachment.url, response);
@@ -29514,7 +29603,7 @@ var Attachment = function Attachment(_ref) {
29514
29603
  imageMinWidth: imageMinWidth,
29515
29604
  withPrefix: withPrefix,
29516
29605
  borderColor: borderColor
29517
- }, /*#__PURE__*/React__default.createElement(UploadPercent, {
29606
+ }, !isPreview && (isInUploadingState || downloadingFile) && sizeProgress && sizeProgress.loaded < sizeProgress.total && (/*#__PURE__*/React__default.createElement(UploadPercent, {
29518
29607
  isRepliedMessage: isRepliedMessage,
29519
29608
  isDetailsView: isDetailsView,
29520
29609
  backgroundColor: overlayBackground2
@@ -29544,7 +29633,7 @@ var Attachment = function Attachment(_ref) {
29544
29633
  }
29545
29634
  })), sizeProgress && (/*#__PURE__*/React__default.createElement(SizeProgress, {
29546
29635
  color: textOnPrimary
29547
- }, bytesToSize(sizeProgress.loaded, 1), " / ", bytesToSize(sizeProgress.total, 1)))))))) : null, isPreview && (/*#__PURE__*/React__default.createElement(RemoveChosenFile, {
29636
+ }, bytesToSize(sizeProgress.loaded, 1), " / ", bytesToSize(sizeProgress.total, 1))))))))) : null, isPreview && (/*#__PURE__*/React__default.createElement(RemoveChosenFile, {
29548
29637
  backgroundColor: background,
29549
29638
  color: iconInactive,
29550
29639
  onClick: function onClick() {
@@ -29780,7 +29869,7 @@ var AttachmentSize = styled__default.span(_templateObject0$9 || (_templateObject
29780
29869
  }, function (props) {
29781
29870
  return props.errorColor;
29782
29871
  });
29783
- var AttachmentFileInfo = styled__default.div(_templateObject1$5 || (_templateObject1$5 = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n ", "\n"])), function (props) {
29872
+ var AttachmentFileInfo = styled__default.div(_templateObject1$6 || (_templateObject1$6 = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n ", "\n"])), function (props) {
29784
29873
  return props.isPreview && "line-height: 14px;\n max-width: calc(100% - 44px);\n ";
29785
29874
  });
29786
29875
  var AttachmentImg$1 = styled__default.img(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteralLoose(["\n position: ", ";\n border-radius: ", ";\n padding: ", ";\n box-sizing: border-box;\n max-width: 100%;\n max-height: ", ";\n width: ", ";\n height: ", ";\n min-height: ", ";\n min-width: ", ";\n object-fit: cover;\n visibility: ", ";\n z-index: 2;\n"])), function (props) {
@@ -31525,7 +31614,7 @@ var FrequentlyEmojisContainer = styled__default.div(_templateObject5$i || (_temp
31525
31614
  return props.rtlDirection && '0';
31526
31615
  });
31527
31616
 
31528
- var _templateObject$C, _templateObject2$x, _templateObject3$r, _templateObject4$n, _templateObject5$j, _templateObject6$g, _templateObject7$e, _templateObject8$d, _templateObject9$b, _templateObject0$a, _templateObject1$6, _templateObject10$4, _templateObject11$4, _templateObject12$3;
31617
+ var _templateObject$C, _templateObject2$x, _templateObject3$r, _templateObject4$n, _templateObject5$j, _templateObject6$g, _templateObject7$e, _templateObject8$d, _templateObject9$b, _templateObject0$a, _templateObject1$7, _templateObject10$4, _templateObject11$4, _templateObject12$3;
31529
31618
  var Message$1 = function Message(_ref) {
31530
31619
  var message = _ref.message,
31531
31620
  channel = _ref.channel,
@@ -31854,7 +31943,6 @@ var Message$1 = function Message(_ref) {
31854
31943
  if (isVisible && message.incoming && !(message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
31855
31944
  return marker.name === MESSAGE_DELIVERY_STATUS.READ;
31856
31945
  })) && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED) {
31857
- log.info('send displayed marker for message ... ', message);
31858
31946
  dispatch(markMessagesAsReadAC(channel.id, [message.id]));
31859
31947
  }
31860
31948
  };
@@ -32303,7 +32391,7 @@ var ReactionsContainer = styled__default.div(_templateObject9$b || (_templateObj
32303
32391
  var MessageReactionsCont = styled__default.div(_templateObject0$a || (_templateObject0$a = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-flex;\n max-width: 300px;\n direction: ", ";\n cursor: pointer;\n"])), function (props) {
32304
32392
  return props.rtlDirection && 'ltr';
32305
32393
  });
32306
- var MessageStatus$1 = styled__default.span(_templateObject1$6 || (_templateObject1$6 = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n margin-left: 4px;\n text-align: right;\n height: ", ";\n & > svg {\n height: 16px;\n width: 16px;\n }\n"])), function (props) {
32394
+ var MessageStatus$1 = styled__default.span(_templateObject1$7 || (_templateObject1$7 = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n margin-left: 4px;\n text-align: right;\n height: ", ";\n & > svg {\n height: 16px;\n width: 16px;\n }\n"])), function (props) {
32307
32395
  return props.height || '14px';
32308
32396
  });
32309
32397
  var HiddenMessageTime$1 = styled__default.span(_templateObject10$4 || (_templateObject10$4 = _taggedTemplateLiteralLoose(["\n display: ", ";\n font-weight: 400;\n font-size: ", ";\n color: ", ";\n"])), function (props) {
@@ -32348,7 +32436,7 @@ var HiddenMessageProperty;
32348
32436
  HiddenMessageProperty["hideAfterSendMessage"] = "hideAfterSendMessage";
32349
32437
  })(HiddenMessageProperty || (HiddenMessageProperty = {}));
32350
32438
 
32351
- var _templateObject$D, _templateObject2$y, _templateObject3$s, _templateObject4$o, _templateObject5$k, _templateObject6$h, _templateObject7$f, _templateObject8$e, _templateObject9$c, _templateObject0$b, _templateObject1$7;
32439
+ var _templateObject$D, _templateObject2$y, _templateObject3$s, _templateObject4$o, _templateObject5$k, _templateObject6$h, _templateObject7$f, _templateObject8$e, _templateObject9$c, _templateObject0$b, _templateObject1$8;
32352
32440
  var loadFromServer = false;
32353
32441
  var loadDirection = '';
32354
32442
  var nextDisable = false;
@@ -32939,7 +33027,7 @@ var MessageList = function MessageList(_ref2) {
32939
33027
  clearVisibleMessagesMap();
32940
33028
  }
32941
33029
  if (channel) {
32942
- dispatch(getMessagesAC(channel, true, undefined, undefined, true));
33030
+ dispatch(getMessagesAC(channel, undefined, undefined, undefined, true));
32943
33031
  }
32944
33032
  if (channel.id) {
32945
33033
  if (channel.newMessageCount && channel.newMessageCount > 0) {
@@ -33398,7 +33486,7 @@ var NoMessagesContainer = styled__default.div(_templateObject9$c || (_templateOb
33398
33486
  var NoMessagesTitle = styled__default.h4(_templateObject0$b || (_templateObject0$b = _taggedTemplateLiteralLoose(["\n margin: 12px 0 8px;\n font-family: Inter, sans-serif;\n text-align: center;\n font-size: 20px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n color: ", ";\n"])), function (props) {
33399
33487
  return props.color;
33400
33488
  });
33401
- var NoMessagesText = styled__default.p(_templateObject1$7 || (_templateObject1$7 = _taggedTemplateLiteralLoose(["\n margin: 0;\n text-align: center;\n font-feature-settings:\n 'clig' off,\n 'liga' off;\n font-family: Inter, sans-serif;\n font-size: 15px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n color: ", ";\n"])), function (props) {
33489
+ var NoMessagesText = styled__default.p(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n margin: 0;\n text-align: center;\n font-feature-settings:\n 'clig' off,\n 'liga' off;\n font-family: Inter, sans-serif;\n font-size: 15px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n color: ", ";\n"])), function (props) {
33402
33490
  return props.color;
33403
33491
  });
33404
33492
 
@@ -35983,7 +36071,7 @@ var RecordingAnimation = function RecordingAnimation(_ref2) {
35983
36071
  }));
35984
36072
  };
35985
36073
 
35986
- var _templateObject$J, _templateObject2$E, _templateObject3$x, _templateObject4$s, _templateObject5$o, _templateObject6$k, _templateObject7$i, _templateObject8$g, _templateObject9$d, _templateObject0$c, _templateObject1$8, _templateObject10$5, _templateObject11$5, _templateObject12$4, _templateObject13$3, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$1, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1;
36074
+ var _templateObject$J, _templateObject2$E, _templateObject3$x, _templateObject4$s, _templateObject5$o, _templateObject6$k, _templateObject7$i, _templateObject8$g, _templateObject9$d, _templateObject0$c, _templateObject1$9, _templateObject10$5, _templateObject11$5, _templateObject12$4, _templateObject13$3, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$1, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1;
35987
36075
  function AutoFocusPlugin(_ref) {
35988
36076
  var messageForReply = _ref.messageForReply;
35989
36077
  var _useLexicalComposerCo = LexicalComposerContext.useLexicalComposerContext(),
@@ -37607,7 +37695,7 @@ var AddAttachmentIcon = styled__default.span(_templateObject0$c || (_templateObj
37607
37695
  }, function (props) {
37608
37696
  return props.hoverColor;
37609
37697
  });
37610
- var SendMessageInputContainer = styled__default.div(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n position: relative;\n min-height: ", ";\n box-sizing: border-box;\n border-radius: ", ";\n\n & .dropdown-trigger.open {\n color: #ccc;\n\n & ", " {\n & > svg {\n color: ", ";\n }\n ;\n }\n }\n}\n"])), function (props) {
37698
+ var SendMessageInputContainer = styled__default.div(_templateObject1$9 || (_templateObject1$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n position: relative;\n min-height: ", ";\n box-sizing: border-box;\n border-radius: ", ";\n\n & .dropdown-trigger.open {\n color: #ccc;\n\n & ", " {\n & > svg {\n color: ", ";\n }\n ;\n }\n }\n}\n"])), function (props) {
37611
37699
  return props.minHeight || '36px';
37612
37700
  }, function (props) {
37613
37701
  return props.messageForReply ? '0 0 4px 4px' : '4px';
@@ -37903,7 +37991,7 @@ function SvgUnpin(props) {
37903
37991
  })));
37904
37992
  }
37905
37993
 
37906
- var _templateObject$K, _templateObject2$F, _templateObject3$y, _templateObject4$t, _templateObject5$p, _templateObject6$l, _templateObject7$j, _templateObject8$h, _templateObject9$e, _templateObject0$d, _templateObject1$9, _templateObject10$6, _templateObject11$6, _templateObject12$5, _templateObject13$4, _templateObject14$3, _templateObject15$3, _templateObject16$3;
37994
+ var _templateObject$K, _templateObject2$F, _templateObject3$y, _templateObject4$t, _templateObject5$p, _templateObject6$l, _templateObject7$j, _templateObject8$h, _templateObject9$e, _templateObject0$d, _templateObject1$a, _templateObject10$6, _templateObject11$6, _templateObject12$5, _templateObject13$4, _templateObject14$3, _templateObject15$3, _templateObject16$3;
37907
37995
  var Actions = function Actions(_ref) {
37908
37996
  var _channel$metadata;
37909
37997
  var setActionsHeight = _ref.setActionsHeight,
@@ -38382,7 +38470,7 @@ var DefaultStarIcon = styled__default(SvgStar)(_templateObject7$j || (_templateO
38382
38470
  var DefaultUnpinIcon = styled__default(SvgUnpin)(_templateObject8$h || (_templateObject8$h = _taggedTemplateLiteralLoose([""])));
38383
38471
  var DefaultPinIcon = styled__default(SvgPin)(_templateObject9$e || (_templateObject9$e = _taggedTemplateLiteralLoose([""])));
38384
38472
  var DefaultMarkAsRead = styled__default(SvgMarkAsRead)(_templateObject0$d || (_templateObject0$d = _taggedTemplateLiteralLoose([""])));
38385
- var DefaultMarkAsUnRead = styled__default(SvgMarkAsUnRead)(_templateObject1$9 || (_templateObject1$9 = _taggedTemplateLiteralLoose([""])));
38473
+ var DefaultMarkAsUnRead = styled__default(SvgMarkAsUnRead)(_templateObject1$a || (_templateObject1$a = _taggedTemplateLiteralLoose([""])));
38386
38474
  var DefaultBlockIcon = styled__default(SvgBlockChannel)(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose([""])));
38387
38475
  var DefaultReportIcon = styled__default(SvgReport)(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose([""])));
38388
38476
  var DefaultClearIcon = styled__default(SvgClear)(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose([""])));
@@ -39928,7 +40016,7 @@ var EditChannel = function EditChannel(_ref) {
39928
40016
  })));
39929
40017
  };
39930
40018
 
39931
- var _templateObject$V, _templateObject2$O, _templateObject3$F, _templateObject4$z, _templateObject5$u, _templateObject6$p, _templateObject7$n, _templateObject8$l, _templateObject9$g, _templateObject0$e, _templateObject1$a, _templateObject10$7;
40019
+ var _templateObject$V, _templateObject2$O, _templateObject3$F, _templateObject4$z, _templateObject5$u, _templateObject6$p, _templateObject7$n, _templateObject8$l, _templateObject9$g, _templateObject0$e, _templateObject1$b, _templateObject10$7;
39932
40020
  var Details = function Details(_ref) {
39933
40021
  var _activeChannel$metada;
39934
40022
  var detailsTitleText = _ref.detailsTitleText,
@@ -40360,7 +40448,7 @@ var ChannelName$1 = styled__default(SectionHeader)(_templateObject0$e || (_templ
40360
40448
  }, function (props) {
40361
40449
  return props.uppercase && 'uppercase';
40362
40450
  });
40363
- var ChannelNameWrapper = styled__default.div(_templateObject1$a || (_templateObject1$a = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n"])));
40451
+ var ChannelNameWrapper = styled__default.div(_templateObject1$b || (_templateObject1$b = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n"])));
40364
40452
  var EditButton = styled__default.span(_templateObject10$7 || (_templateObject10$7 = _taggedTemplateLiteralLoose(["\n margin-left: 6px;\n cursor: pointer;\n color: #b2b6be;\n"])));
40365
40453
 
40366
40454
  var _templateObject$W;
@@ -40642,7 +40730,10 @@ var MessagesScrollToBottomButton = function MessagesScrollToBottomButton(_ref) {
40642
40730
  var showScrollToNewMessageButton = reactRedux.useSelector(showScrollToNewMessageButtonSelector);
40643
40731
  var messages = reactRedux.useSelector(activeChannelMessagesSelector) || [];
40644
40732
  var handleScrollToBottom = function handleScrollToBottom() {
40645
- dispatch(markMessagesAsReadAC(channel.id, [channel.lastMessage.id]));
40733
+ var user = getClient().user;
40734
+ if (channel.lastMessage.user.id !== user.id) {
40735
+ dispatch(markMessagesAsReadAC(channel.id, [channel.lastMessage.id]));
40736
+ }
40646
40737
  handleScrollToLastMessage(channel.lastMessage.id);
40647
40738
  };
40648
40739
  var handleScrollToLastMessage = function handleScrollToLastMessage(messageId) {