sceyt-chat-react-uikit 1.6.8-beta.2 → 1.6.8-beta.4

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 +490 -380
  2. package/index.modern.js +491 -381
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -7413,6 +7413,9 @@ var ChannelReducer = (function (state, _temp) {
7413
7413
  } else {
7414
7414
  newState.channels = newState.channels.map(function (channel) {
7415
7415
  if (channel.id === _channelId) {
7416
+ if (newState.activeChannel && Object.prototype.hasOwnProperty.call(newState.activeChannel, 'id') && channel.id === newState.activeChannel.id) {
7417
+ newState.activeChannel = _extends({}, newState.activeChannel, config);
7418
+ }
7416
7419
  return _extends({}, channel, config);
7417
7420
  }
7418
7421
  return channel;
@@ -7432,9 +7435,10 @@ var ChannelReducer = (function (state, _temp) {
7432
7435
  var updateData = payload.updateData,
7433
7436
  groupName = payload.groupName,
7434
7437
  _channelId2 = payload.channelId;
7435
- if (newState.searchedChannels[groupName] && newState.searchedChannels[groupName].length) {
7438
+ var groupKey = groupName;
7439
+ if (newState.searchedChannels[groupKey] && newState.searchedChannels[groupKey].length) {
7436
7440
  var _extends2;
7437
- newState.searchedChannels = _extends({}, newState.searchedChannels, (_extends2 = {}, _extends2[groupName] = [].concat(newState.searchedChannels[groupName]).map(function (channel) {
7441
+ newState.searchedChannels = _extends({}, newState.searchedChannels, (_extends2 = {}, _extends2[groupName] = [].concat(newState.searchedChannels[groupKey]).map(function (channel) {
7438
7442
  if (channel.id === _channelId2) {
7439
7443
  return _extends({}, channel, updateData);
7440
7444
  }
@@ -10456,11 +10460,12 @@ function updateMembersPresenceAC(usersMap) {
10456
10460
  }
10457
10461
  };
10458
10462
  }
10459
- function loadMoreMembersAC(limit) {
10463
+ function loadMoreMembersAC(limit, channelId) {
10460
10464
  return {
10461
10465
  type: LOAD_MORE_MEMBERS,
10462
10466
  payload: {
10463
- limit: limit
10467
+ limit: limit,
10468
+ channelId: channelId
10464
10469
  }
10465
10470
  };
10466
10471
  }
@@ -11228,12 +11233,12 @@ var UploadingIcon = styled__default.span(_templateObject35 || (_templateObject35
11228
11233
  });
11229
11234
  var TextInOneLine = styled__default.span(_templateObject36 || (_templateObject36 = _taggedTemplateLiteralLoose(["\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n"])));
11230
11235
  var CancelResumeWrapper = styled__default.span(_templateObject37 || (_templateObject37 = _taggedTemplateLiteralLoose(["\n position: absolute;\n width: 20px;\n height: 20px;\n z-index: 3;\n\n > svg {\n width: 20px;\n height: 20px;\n }\n"])));
11231
- var UploadPercent = styled__default.span(_templateObject38 || (_templateObject38 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n color: #fff;\n width: ", ";\n height: ", ";\n //background-color: rgba(0,0,0,0.4);\n background-color: ", ";\n border-radius: ", ";\n}\n ", "\n"])), function (props) {
11236
+ var UploadPercent = styled__default.span(_templateObject38 || (_templateObject38 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n color: #fff;\n width: ", ";\n height: ", ";\n background-color: ", ";\n border-radius: ", ";\n}\n ", "\n"])), function (props) {
11232
11237
  return props.fileAttachment || props.isRepliedMessage || props.isDetailsView ? '40px' : '56px';
11233
11238
  }, function (props) {
11234
11239
  return props.fileAttachment || props.isRepliedMessage || props.isDetailsView ? '40px' : '56px';
11235
11240
  }, function (props) {
11236
- return props.backgroundColor;
11241
+ return props.backgroundColor + "40";
11237
11242
  }, function (props) {
11238
11243
  return props.borderRadius ? props.borderRadius : props.fileAttachment ? '8px' : props.isRepliedMessage ? '4px' : ' 50%';
11239
11244
  }, function (props) {
@@ -11482,7 +11487,68 @@ var MessageTextFormat = function MessageTextFormat(_ref2) {
11482
11487
  }
11483
11488
  };
11484
11489
 
11485
- var _marked = /*#__PURE__*/_regeneratorRuntime().mark(watchForEvents);
11490
+ var _marked = /*#__PURE__*/_regeneratorRuntime().mark(updateActiveChannelMembersAdd),
11491
+ _marked2 = /*#__PURE__*/_regeneratorRuntime().mark(updateActiveChannelMembersRemove);
11492
+ function updateActiveChannelMembersAdd(addedMembers) {
11493
+ var state, activeChannel, updatedMembers;
11494
+ return _regeneratorRuntime().wrap(function updateActiveChannelMembersAdd$(_context) {
11495
+ while (1) switch (_context.prev = _context.next) {
11496
+ case 0:
11497
+ _context.next = 2;
11498
+ return effects.select();
11499
+ case 2:
11500
+ state = _context.sent;
11501
+ activeChannel = state.ChannelReducer.activeChannel;
11502
+ if (!(activeChannel && activeChannel.id)) {
11503
+ _context.next = 8;
11504
+ break;
11505
+ }
11506
+ updatedMembers = [].concat(activeChannel.members || [], addedMembers);
11507
+ updatedMembers = Array.from(new Set(updatedMembers));
11508
+ return _context.abrupt("return", {
11509
+ members: updatedMembers
11510
+ });
11511
+ case 8:
11512
+ return _context.abrupt("return", {});
11513
+ case 9:
11514
+ case "end":
11515
+ return _context.stop();
11516
+ }
11517
+ }, _marked);
11518
+ }
11519
+ function updateActiveChannelMembersRemove(removedMembers) {
11520
+ var state, activeChannel, updatedMembers;
11521
+ return _regeneratorRuntime().wrap(function updateActiveChannelMembersRemove$(_context2) {
11522
+ while (1) switch (_context2.prev = _context2.next) {
11523
+ case 0:
11524
+ _context2.next = 2;
11525
+ return effects.select();
11526
+ case 2:
11527
+ state = _context2.sent;
11528
+ activeChannel = state.ChannelReducer.activeChannel;
11529
+ if (!(activeChannel && activeChannel.id)) {
11530
+ _context2.next = 8;
11531
+ break;
11532
+ }
11533
+ updatedMembers = (activeChannel.members || []).filter(function (member) {
11534
+ return !removedMembers.find(function (removed) {
11535
+ return removed.id === member.id;
11536
+ });
11537
+ });
11538
+ updatedMembers = Array.from(new Set(updatedMembers));
11539
+ return _context2.abrupt("return", {
11540
+ members: updatedMembers
11541
+ });
11542
+ case 8:
11543
+ return _context2.abrupt("return", {});
11544
+ case 9:
11545
+ case "end":
11546
+ return _context2.stop();
11547
+ }
11548
+ }, _marked2);
11549
+ }
11550
+
11551
+ var _marked$1 = /*#__PURE__*/_regeneratorRuntime().mark(watchForEvents);
11486
11552
  function watchForEvents() {
11487
11553
  var SceytChatClient, channelListener, connectionListener, usersTimeout, chan, _loop;
11488
11554
  return _regeneratorRuntime().wrap(function watchForEvents$(_context2) {
@@ -11841,7 +11907,7 @@ function watchForEvents() {
11841
11907
  };
11842
11908
  });
11843
11909
  _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
11844
- var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _channel1, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId0, _channelUpdateParams, _channel10, _updatedChannel, _channel11, _activeChannelId1, channelExist, _channel12, _channel13, _channel14, _channel15, _channel16, _channel17, _channel18, _groupName5, _channel19, _groupName6, _channel20, members, _activeChannelId10, i, _channel21, _channel22, _channelId2, from, name, status;
11910
+ var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _channel1, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId0, _channelUpdateParams, _channel10, _updatedChannel, _channel11, _activeChannelId1, channelExist, _channel12, _channel13, _channel14, _channel15, _channel16, _channel17, _channel18, _groupName5, _channel19, _groupName6, _channel20, members, _activeChannelId10, i, _channel21, _channel22, _channelId2, from, name, status;
11845
11911
  return _regeneratorRuntime().wrap(function _callee$(_context) {
11846
11912
  while (1) switch (_context.prev = _context.next) {
11847
11913
  case 0:
@@ -11852,7 +11918,7 @@ function watchForEvents() {
11852
11918
  type = _yield$take.type;
11853
11919
  args = _yield$take.args;
11854
11920
  _context.t0 = type;
11855
- _context.next = _context.t0 === CHANNEL_EVENT_TYPES.CREATE ? 8 : _context.t0 === CHANNEL_EVENT_TYPES.JOIN ? 25 : _context.t0 === CHANNEL_EVENT_TYPES.LEAVE ? 34 : _context.t0 === CHANNEL_EVENT_TYPES.BLOCK ? 58 : _context.t0 === CHANNEL_EVENT_TYPES.UNBLOCK ? 65 : _context.t0 === CHANNEL_EVENT_TYPES.KICK_MEMBERS ? 67 : _context.t0 === CHANNEL_EVENT_TYPES.ADD_MEMBERS ? 96 : _context.t0 === CHANNEL_EVENT_TYPES.UPDATE_CHANNEL ? 119 : _context.t0 === CHANNEL_EVENT_TYPES.MESSAGE ? 136 : _context.t0 === CHANNEL_EVENT_TYPES.MESSAGE_MARKERS_RECEIVED ? 203 : _context.t0 === CHANNEL_EVENT_TYPES.DELETE ? 226 : _context.t0 === CHANNEL_EVENT_TYPES.DELETE_MESSAGE ? 233 : _context.t0 === CHANNEL_EVENT_TYPES.EDIT_MESSAGE ? 250 : _context.t0 === CHANNEL_EVENT_TYPES.REACTION_ADDED ? 265 : _context.t0 === CHANNEL_EVENT_TYPES.REACTION_DELETED ? 293 : _context.t0 === CHANNEL_EVENT_TYPES.UNREAD_MESSAGES_INFO ? 309 : _context.t0 === CHANNEL_EVENT_TYPES.CLEAR_HISTORY ? 316 : _context.t0 === CHANNEL_EVENT_TYPES.MUTE ? 334 : _context.t0 === CHANNEL_EVENT_TYPES.UNMUTE ? 340 : _context.t0 === CHANNEL_EVENT_TYPES.PINED ? 346 : _context.t0 === CHANNEL_EVENT_TYPES.UNPINED ? 352 : _context.t0 === CHANNEL_EVENT_TYPES.HIDE ? 358 : _context.t0 === CHANNEL_EVENT_TYPES.UNHIDE ? 363 : _context.t0 === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_UNREAD ? 368 : _context.t0 === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_READ ? 376 : _context.t0 === CHANNEL_EVENT_TYPES.CHANGE_ROLE ? 384 : _context.t0 === CHANNEL_EVENT_TYPES.FROZEN ? 403 : _context.t0 === CHANNEL_EVENT_TYPES.UNFROZEN ? 406 : _context.t0 === CHANNEL_EVENT_TYPES.CHANNEL_EVENT ? 409 : _context.t0 === CONNECTION_EVENT_TYPES.CONNECTION_STATUS_CHANGED ? 440 : 448;
11921
+ _context.next = _context.t0 === CHANNEL_EVENT_TYPES.CREATE ? 8 : _context.t0 === CHANNEL_EVENT_TYPES.JOIN ? 25 : _context.t0 === CHANNEL_EVENT_TYPES.LEAVE ? 34 : _context.t0 === CHANNEL_EVENT_TYPES.BLOCK ? 62 : _context.t0 === CHANNEL_EVENT_TYPES.UNBLOCK ? 69 : _context.t0 === CHANNEL_EVENT_TYPES.KICK_MEMBERS ? 71 : _context.t0 === CHANNEL_EVENT_TYPES.ADD_MEMBERS ? 104 : _context.t0 === CHANNEL_EVENT_TYPES.UPDATE_CHANNEL ? 131 : _context.t0 === CHANNEL_EVENT_TYPES.MESSAGE ? 149 : _context.t0 === CHANNEL_EVENT_TYPES.MESSAGE_MARKERS_RECEIVED ? 216 : _context.t0 === CHANNEL_EVENT_TYPES.DELETE ? 239 : _context.t0 === CHANNEL_EVENT_TYPES.DELETE_MESSAGE ? 246 : _context.t0 === CHANNEL_EVENT_TYPES.EDIT_MESSAGE ? 263 : _context.t0 === CHANNEL_EVENT_TYPES.REACTION_ADDED ? 278 : _context.t0 === CHANNEL_EVENT_TYPES.REACTION_DELETED ? 306 : _context.t0 === CHANNEL_EVENT_TYPES.UNREAD_MESSAGES_INFO ? 322 : _context.t0 === CHANNEL_EVENT_TYPES.CLEAR_HISTORY ? 329 : _context.t0 === CHANNEL_EVENT_TYPES.MUTE ? 347 : _context.t0 === CHANNEL_EVENT_TYPES.UNMUTE ? 353 : _context.t0 === CHANNEL_EVENT_TYPES.PINED ? 359 : _context.t0 === CHANNEL_EVENT_TYPES.UNPINED ? 365 : _context.t0 === CHANNEL_EVENT_TYPES.HIDE ? 371 : _context.t0 === CHANNEL_EVENT_TYPES.UNHIDE ? 376 : _context.t0 === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_UNREAD ? 381 : _context.t0 === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_READ ? 389 : _context.t0 === CHANNEL_EVENT_TYPES.CHANGE_ROLE ? 397 : _context.t0 === CHANNEL_EVENT_TYPES.FROZEN ? 416 : _context.t0 === CHANNEL_EVENT_TYPES.UNFROZEN ? 419 : _context.t0 === CHANNEL_EVENT_TYPES.CHANNEL_EVENT ? 422 : _context.t0 === CONNECTION_EVENT_TYPES.CONNECTION_STATUS_CHANGED ? 453 : 461;
11856
11922
  break;
11857
11923
  case 8:
11858
11924
  createdChannel = args.createdChannel;
@@ -11886,7 +11952,7 @@ function watchForEvents() {
11886
11952
  addChannelToAllChannels(createdChannel);
11887
11953
  }
11888
11954
  case 24:
11889
- return _context.abrupt("break", 449);
11955
+ return _context.abrupt("break", 462);
11890
11956
  case 25:
11891
11957
  channel = args.channel;
11892
11958
  log.info('channel JOIN ... . ', channel);
@@ -11897,7 +11963,7 @@ function watchForEvents() {
11897
11963
  if (!_chan2) {
11898
11964
  addChannelToAllChannels(channel);
11899
11965
  }
11900
- return _context.abrupt("break", 449);
11966
+ return _context.abrupt("break", 462);
11901
11967
  case 34:
11902
11968
  _channel = args.channel, member = args.member;
11903
11969
  log.info('channel LEAVE ... ', _channel, member);
@@ -11915,208 +11981,227 @@ function watchForEvents() {
11915
11981
  case 43:
11916
11982
  removeChannelFromMap(_channel.id);
11917
11983
  deleteChannelFromAllChannels(_channel.id);
11918
- _context.next = 57;
11984
+ _context.next = 61;
11919
11985
  break;
11920
11986
  case 47:
11921
11987
  groupName = getChannelGroupName(_channel);
11922
11988
  if (!_channelExists) {
11923
- _context.next = 54;
11989
+ _context.next = 58;
11924
11990
  break;
11925
11991
  }
11992
+ updateChannelData = {};
11926
11993
  if (!(_activeChannelId === _channel.id)) {
11927
- _context.next = 52;
11994
+ _context.next = 56;
11928
11995
  break;
11929
11996
  }
11930
- _context.next = 52;
11997
+ _context.next = 53;
11931
11998
  return effects.put(removeMemberFromListAC([member]));
11932
- case 52:
11933
- _context.next = 54;
11934
- return effects.put(updateChannelDataAC(_channel.id, {
11999
+ case 53:
12000
+ _context.next = 55;
12001
+ return effects.call(updateActiveChannelMembersRemove, [member]) || {};
12002
+ case 55:
12003
+ updateChannelData = _context.sent;
12004
+ case 56:
12005
+ _context.next = 58;
12006
+ return effects.put(updateChannelDataAC(_channel.id, _extends({
11935
12007
  memberCount: _channel.memberCount,
11936
12008
  muted: _channel.muted,
11937
12009
  mutedTill: _channel.mutedTill
11938
- }));
11939
- case 54:
11940
- _context.next = 56;
12010
+ }, updateChannelData)));
12011
+ case 58:
12012
+ _context.next = 60;
11941
12013
  return effects.put(updateSearchedChannelDataAC(_channel.id, {
11942
12014
  memberCount: _channel.memberCount,
11943
12015
  muted: _channel.muted,
11944
12016
  mutedTill: _channel.mutedTill
11945
12017
  }, groupName));
11946
- case 56:
12018
+ case 60:
11947
12019
  updateChannelOnAllChannels(_channel.id, {
11948
12020
  memberCount: _channel.memberCount,
11949
12021
  muted: _channel.muted,
11950
12022
  mutedTill: _channel.mutedTill
11951
12023
  });
11952
- case 57:
11953
- return _context.abrupt("break", 449);
11954
- case 58:
12024
+ case 61:
12025
+ return _context.abrupt("break", 462);
12026
+ case 62:
11955
12027
  log.info('channel BLOCK ... ');
11956
12028
  _channel2 = args.channel;
11957
12029
  _channelExists2 = checkChannelExists(_channel2.id);
11958
12030
  if (!_channelExists2) {
11959
- _context.next = 64;
12031
+ _context.next = 68;
11960
12032
  break;
11961
12033
  }
11962
- _context.next = 64;
12034
+ _context.next = 68;
11963
12035
  return effects.put(removeChannelAC(_channel2.id));
11964
- case 64:
11965
- return _context.abrupt("break", 449);
11966
- case 65:
12036
+ case 68:
12037
+ return _context.abrupt("break", 462);
12038
+ case 69:
11967
12039
  log.info('channel UNBLOCK ... ');
11968
- return _context.abrupt("break", 449);
11969
- case 67:
12040
+ return _context.abrupt("break", 462);
12041
+ case 71:
11970
12042
  _channel3 = args.channel, removedMembers = args.removedMembers;
11971
12043
  log.info('channel KICK_MEMBERS ... ', removedMembers);
11972
- _context.next = 71;
12044
+ _context.next = 75;
11973
12045
  return effects.call(getActiveChannelId);
11974
- case 71:
12046
+ case 75:
11975
12047
  _activeChannelId2 = _context.sent;
11976
12048
  _channelExists3 = checkChannelExists(_channel3.id);
11977
12049
  if (!_channelExists3) {
11978
- _context.next = 94;
12050
+ _context.next = 102;
11979
12051
  break;
11980
12052
  }
11981
12053
  if (!removedMembers.find(function (mem) {
11982
12054
  return mem.id === SceytChatClient.user.id;
11983
12055
  })) {
11984
- _context.next = 86;
12056
+ _context.next = 90;
11985
12057
  break;
11986
12058
  }
11987
12059
  removeChannelFromMap(_channel3.id);
11988
- _context.next = 78;
12060
+ _context.next = 82;
11989
12061
  return effects.put(removeChannelAC(_channel3.id));
11990
- case 78:
11991
- _context.next = 80;
12062
+ case 82:
12063
+ _context.next = 84;
11992
12064
  return effects.call(getLastChannelFromMap);
11993
- case 80:
12065
+ case 84:
11994
12066
  activeChannel = _context.sent;
11995
12067
  if (!activeChannel) {
11996
- _context.next = 84;
12068
+ _context.next = 88;
11997
12069
  break;
11998
12070
  }
11999
- _context.next = 84;
12071
+ _context.next = 88;
12000
12072
  return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
12001
- case 84:
12002
- _context.next = 94;
12073
+ case 88:
12074
+ _context.next = 102;
12003
12075
  break;
12004
- case 86:
12076
+ case 90:
12077
+ _updateChannelData = {};
12005
12078
  if (!(_activeChannelId2 === _channel3.id)) {
12006
- _context.next = 89;
12079
+ _context.next = 97;
12007
12080
  break;
12008
12081
  }
12009
- _context.next = 89;
12082
+ _context.next = 94;
12010
12083
  return effects.put(removeMemberFromListAC(removedMembers));
12011
- case 89:
12084
+ case 94:
12085
+ _context.next = 96;
12086
+ return effects.call(updateActiveChannelMembersRemove, removedMembers) || {};
12087
+ case 96:
12088
+ _updateChannelData = _context.sent;
12089
+ case 97:
12012
12090
  _groupName = getChannelGroupName(_channel3);
12013
- _context.next = 92;
12091
+ _context.next = 100;
12014
12092
  return effects.put(updateSearchedChannelDataAC(_channel3.id, {
12015
12093
  memberCount: _channel3.memberCount,
12016
12094
  muted: _channel3.muted,
12017
12095
  mutedTill: _channel3.mutedTill
12018
12096
  }, _groupName));
12019
- case 92:
12020
- _context.next = 94;
12021
- return effects.put(updateChannelDataAC(_channel3.id, {
12097
+ case 100:
12098
+ _context.next = 102;
12099
+ return effects.put(updateChannelDataAC(_channel3.id, _extends({
12022
12100
  memberCount: _channel3.memberCount,
12023
12101
  muted: _channel3.muted,
12024
12102
  mutedTill: _channel3.mutedTill
12025
- }));
12026
- case 94:
12103
+ }, _updateChannelData)));
12104
+ case 102:
12027
12105
  updateChannelOnAllChannels(_channel3.id, {
12028
12106
  memberCount: _channel3.memberCount,
12029
12107
  muted: _channel3.muted,
12030
12108
  mutedTill: _channel3.mutedTill
12031
12109
  });
12032
- return _context.abrupt("break", 449);
12033
- case 96:
12110
+ return _context.abrupt("break", 462);
12111
+ case 104:
12034
12112
  _channel4 = args.channel, addedMembers = args.addedMembers;
12035
12113
  log.info('channel ADD_MEMBERS ... ', addedMembers);
12036
- _context.next = 100;
12114
+ _context.next = 108;
12037
12115
  return effects.call(getActiveChannelId);
12038
- case 100:
12116
+ case 108:
12039
12117
  _activeChannelId3 = _context.sent;
12040
12118
  _channelExists4 = checkChannelExists(_channel4.id);
12041
12119
  if (!_channelExists4) {
12042
- _context.next = 110;
12120
+ _context.next = 122;
12043
12121
  break;
12044
12122
  }
12123
+ _updateChannelData2 = {};
12045
12124
  if (!(_activeChannelId3 === _channel4.id)) {
12046
- _context.next = 106;
12125
+ _context.next = 118;
12047
12126
  break;
12048
12127
  }
12049
- _context.next = 106;
12128
+ _context.next = 115;
12050
12129
  return effects.put(addMembersToListAC(addedMembers));
12051
- case 106:
12052
- _context.next = 108;
12053
- return effects.put(updateChannelDataAC(_channel4.id, {
12130
+ case 115:
12131
+ _context.next = 117;
12132
+ return effects.call(updateActiveChannelMembersAdd, addedMembers) || {};
12133
+ case 117:
12134
+ _updateChannelData2 = _context.sent;
12135
+ case 118:
12136
+ _context.next = 120;
12137
+ return effects.put(updateChannelDataAC(_channel4.id, _extends({
12054
12138
  memberCount: _channel4.memberCount,
12055
12139
  muted: _channel4.muted,
12056
12140
  mutedTill: _channel4.mutedTill
12057
- }));
12058
- case 108:
12059
- _context.next = 114;
12141
+ }, _updateChannelData2)));
12142
+ case 120:
12143
+ _context.next = 126;
12060
12144
  break;
12061
- case 110:
12062
- _context.next = 112;
12145
+ case 122:
12146
+ _context.next = 124;
12063
12147
  return effects.call(setChannelInMap, _channel4);
12064
- case 112:
12065
- _context.next = 114;
12148
+ case 124:
12149
+ _context.next = 126;
12066
12150
  return effects.put(setAddedToChannelAC(JSON.parse(JSON.stringify(_channel4))));
12067
- case 114:
12151
+ case 126:
12068
12152
  _groupName2 = getChannelGroupName(_channel4);
12069
- _context.next = 117;
12153
+ _context.next = 129;
12070
12154
  return effects.put(updateSearchedChannelDataAC(_channel4.id, {
12071
12155
  memberCount: _channel4.memberCount,
12072
12156
  muted: _channel4.muted,
12073
12157
  mutedTill: _channel4.mutedTill
12074
12158
  }, _groupName2));
12075
- case 117:
12159
+ case 129:
12076
12160
  updateChannelOnAllChannels(_channel4.id, {
12077
12161
  memberCount: _channel4.memberCount,
12078
12162
  muted: _channel4.muted,
12079
12163
  mutedTill: _channel4.mutedTill
12080
12164
  });
12081
- return _context.abrupt("break", 449);
12082
- case 119:
12165
+ return _context.abrupt("break", 462);
12166
+ case 131:
12167
+ log.info('channel UPDATE_CHANNEL ... ');
12083
12168
  updatedChannel = args.updatedChannel;
12084
12169
  _channelExists5 = checkChannelExists(updatedChannel.id);
12085
12170
  subject = updatedChannel.subject, avatarUrl = updatedChannel.avatarUrl, muted = updatedChannel.muted, mutedTill = updatedChannel.mutedTill, metadata = updatedChannel.metadata;
12086
12171
  if (!_channelExists5) {
12087
- _context.next = 131;
12172
+ _context.next = 144;
12088
12173
  break;
12089
12174
  }
12090
- _context.next = 125;
12175
+ _context.next = 138;
12091
12176
  return effects.put(updateChannelDataAC(updatedChannel.id, {
12092
12177
  subject: subject,
12093
12178
  avatarUrl: avatarUrl,
12094
12179
  muted: muted,
12095
12180
  mutedTill: mutedTill
12096
12181
  }));
12097
- case 125:
12098
- _context.next = 127;
12182
+ case 138:
12183
+ _context.next = 140;
12099
12184
  return effects.call(getActiveChannelId);
12100
- case 127:
12185
+ case 140:
12101
12186
  _activeChannelId4 = _context.sent;
12102
12187
  if (!(_activeChannelId4 === updatedChannel.id)) {
12103
- _context.next = 131;
12188
+ _context.next = 144;
12104
12189
  break;
12105
12190
  }
12106
- _context.next = 131;
12191
+ _context.next = 144;
12107
12192
  return effects.put(setActiveChannelAC(_extends({}, updatedChannel, {
12108
12193
  metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
12109
12194
  })));
12110
- case 131:
12195
+ case 144:
12111
12196
  _groupName3 = getChannelGroupName(updatedChannel);
12112
- _context.next = 134;
12197
+ _context.next = 147;
12113
12198
  return effects.put(updateSearchedChannelDataAC(updatedChannel.id, {
12114
12199
  subject: subject,
12115
12200
  avatarUrl: avatarUrl,
12116
12201
  muted: muted,
12117
12202
  mutedTill: mutedTill
12118
12203
  }, _groupName3));
12119
- case 134:
12204
+ case 147:
12120
12205
  updateChannelOnAllChannels(updatedChannel.id, {
12121
12206
  subject: subject,
12122
12207
  avatarUrl: avatarUrl,
@@ -12124,102 +12209,102 @@ function watchForEvents() {
12124
12209
  mutedTill: mutedTill,
12125
12210
  metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
12126
12211
  });
12127
- return _context.abrupt("break", 449);
12128
- case 136:
12212
+ return _context.abrupt("break", 462);
12213
+ case 149:
12129
12214
  _channel5 = args.channel, message = args.message;
12130
12215
  log.info('channel MESSAGE ... id : ', message.id, ' message: ', message, ' channel.id: ', _channel5.id);
12131
12216
  messageToHandle = handleNewMessages ? handleNewMessages(message, _channel5) : message;
12132
12217
  _channelFilterTypes = getChannelTypesFilter();
12133
12218
  if (!(messageToHandle && _channel5 && (_channelFilterTypes !== null && _channelFilterTypes !== void 0 && _channelFilterTypes.length ? _channelFilterTypes.includes(_channel5.type) : true))) {
12134
- _context.next = 202;
12219
+ _context.next = 215;
12135
12220
  break;
12136
12221
  }
12137
12222
  _channel5.metadata = isJSON(_channel5.metadata) ? JSON.parse(_channel5.metadata) : _channel5.metadata;
12138
- _context.next = 144;
12223
+ _context.next = 157;
12139
12224
  return effects.call(getActiveChannelId);
12140
- case 144:
12225
+ case 157:
12141
12226
  _activeChannelId5 = _context.sent;
12142
12227
  _channelExists6 = checkChannelExists(_channel5.id);
12143
12228
  channelForAdd = JSON.parse(JSON.stringify(_channel5));
12144
- _context.next = 149;
12229
+ _context.next = 162;
12145
12230
  return effects.put(addChannelAC(channelForAdd));
12146
- case 149:
12231
+ case 162:
12147
12232
  if (_channelExists6) {
12148
- _context.next = 154;
12233
+ _context.next = 167;
12149
12234
  break;
12150
12235
  }
12151
- _context.next = 152;
12236
+ _context.next = 165;
12152
12237
  return effects.call(setChannelInMap, _channel5);
12153
- case 152:
12154
- _context.next = 157;
12238
+ case 165:
12239
+ _context.next = 170;
12155
12240
  break;
12156
- case 154:
12241
+ case 167:
12157
12242
  if (message.repliedInThread) {
12158
- _context.next = 157;
12243
+ _context.next = 170;
12159
12244
  break;
12160
12245
  }
12161
- _context.next = 157;
12246
+ _context.next = 170;
12162
12247
  return effects.put(updateChannelLastMessageAC(message, channelForAdd));
12163
- case 157:
12248
+ case 170:
12164
12249
  if (!(_channel5.id === _activeChannelId5)) {
12165
- _context.next = 169;
12250
+ _context.next = 182;
12166
12251
  break;
12167
12252
  }
12168
12253
  if (getHasNextCached()) {
12169
- _context.next = 161;
12254
+ _context.next = 174;
12170
12255
  break;
12171
12256
  }
12172
- _context.next = 161;
12257
+ _context.next = 174;
12173
12258
  return effects.put(addMessageAC(message));
12174
- case 161:
12259
+ case 174:
12175
12260
  addAllMessages([message], MESSAGE_LOAD_DIRECTION.NEXT);
12176
- _context.next = 165;
12261
+ _context.next = 178;
12177
12262
  return effects.select(messagesHasNextSelector);
12178
- case 165:
12263
+ case 178:
12179
12264
  hasNextMessage = _context.sent;
12180
12265
  if (!(!getHasNextCached() && !hasNextMessage)) {
12181
- _context.next = 169;
12266
+ _context.next = 182;
12182
12267
  break;
12183
12268
  }
12184
- _context.next = 169;
12269
+ _context.next = 182;
12185
12270
  return effects.put(scrollToNewMessageAC(true, false, true));
12186
- case 169:
12271
+ case 182:
12187
12272
  if (getMessagesFromMap(_channel5.id) && getMessagesFromMap(_channel5.id).length) {
12188
12273
  addMessageToMap(_channel5.id, message);
12189
12274
  }
12190
- _context.next = 172;
12191
- return effects.put(updateChannelDataAC(_channel5.id, _extends({}, channelForAdd, {
12275
+ _context.next = 185;
12276
+ return effects.put(updateChannelDataAC(_channel5.id, {
12192
12277
  userMessageReactions: [],
12193
12278
  lastReactedMessage: null
12194
- })));
12195
- case 172:
12279
+ }));
12280
+ case 185:
12196
12281
  _groupName4 = getChannelGroupName(_channel5);
12197
- _context.next = 175;
12198
- return effects.put(updateSearchedChannelDataAC(_channel5.id, _extends({}, channelForAdd, {
12282
+ _context.next = 188;
12283
+ return effects.put(updateSearchedChannelDataAC(_channel5.id, {
12199
12284
  userMessageReactions: [],
12200
12285
  lastReactedMessage: null
12201
- }), _groupName4));
12202
- case 175:
12286
+ }, _groupName4));
12287
+ case 188:
12203
12288
  showNotifications = getShowNotifications();
12204
12289
  if (!(showNotifications && !message.silent && message.user.id !== SceytChatClient.user.id && !_channel5.muted)) {
12205
- _context.next = 192;
12290
+ _context.next = 205;
12206
12291
  break;
12207
12292
  }
12208
12293
  if (!(Notification.permission === 'granted')) {
12209
- _context.next = 192;
12294
+ _context.next = 205;
12210
12295
  break;
12211
12296
  }
12212
- _context.next = 180;
12297
+ _context.next = 193;
12213
12298
  return effects.select(browserTabIsActiveSelector);
12214
- case 180:
12299
+ case 193:
12215
12300
  tabIsActive = _context.sent;
12216
12301
  if (!(document.visibilityState !== 'visible' || !tabIsActive || _channel5.id !== _activeChannelId5)) {
12217
- _context.next = 192;
12302
+ _context.next = 205;
12218
12303
  break;
12219
12304
  }
12220
- _context.next = 184;
12305
+ _context.next = 197;
12221
12306
  return effects.select(contactsMapSelector);
12222
- case 184:
12307
+ case 197:
12223
12308
  contactsMap = _context.sent;
12224
12309
  _getFromContacts = getShowOnlyContactUsers();
12225
12310
  state = store.getState();
@@ -12239,42 +12324,42 @@ function watchForEvents() {
12239
12324
  setNotification(messageBody, message.user, _channel5, undefined, message.attachments && message.attachments.length ? message.attachments.find(function (att) {
12240
12325
  return att.type !== attachmentTypes.link;
12241
12326
  }) : undefined);
12242
- case 192:
12327
+ case 205:
12243
12328
  log.info('send delivered for message . .. . ', message);
12244
12329
  if (!(message.repliedInThread && message.parentMessage.id)) {
12245
- _context.next = 198;
12330
+ _context.next = 211;
12246
12331
  break;
12247
12332
  }
12248
- _context.next = 196;
12333
+ _context.next = 209;
12249
12334
  return effects.put(markMessagesAsDeliveredAC(message.parentMessage.id, [message.id]));
12250
- case 196:
12251
- _context.next = 200;
12335
+ case 209:
12336
+ _context.next = 213;
12252
12337
  break;
12253
- case 198:
12254
- _context.next = 200;
12338
+ case 211:
12339
+ _context.next = 213;
12255
12340
  return effects.put(markMessagesAsDeliveredAC(_channel5.id, [message.id]));
12256
- case 200:
12257
- updateChannelOnAllChannels(_channel5.id, _extends({}, channelForAdd, {
12341
+ case 213:
12342
+ updateChannelOnAllChannels(_channel5.id, {
12258
12343
  userMessageReactions: [],
12259
12344
  lastReactedMessage: null
12260
- }));
12345
+ });
12261
12346
  updateChannelLastMessageOnAllChannels(_channel5.id, _channel5.lastMessage);
12262
- case 202:
12263
- return _context.abrupt("break", 449);
12264
- case 203:
12347
+ case 215:
12348
+ return _context.abrupt("break", 462);
12349
+ case 216:
12265
12350
  channelId = args.channelId, markerList = args.markerList;
12266
- _context.next = 206;
12351
+ _context.next = 219;
12267
12352
  return effects.call(getChannelFromMap, channelId);
12268
- case 206:
12353
+ case 219:
12269
12354
  _channel6 = _context.sent;
12270
12355
  log.info('channel MESSAGE_MARKERS_RECEIVED ... channel: ', _channel6, 'markers list: ', markerList);
12271
12356
  if (!_channel6) {
12272
- _context.next = 225;
12357
+ _context.next = 238;
12273
12358
  break;
12274
12359
  }
12275
- _context.next = 211;
12360
+ _context.next = 224;
12276
12361
  return effects.call(getActiveChannelId);
12277
- case 211:
12362
+ case 224:
12278
12363
  _activeChannelId6 = _context.sent;
12279
12364
  updateLastMessage = false;
12280
12365
  markersMap = {};
@@ -12292,91 +12377,91 @@ function watchForEvents() {
12292
12377
  });
12293
12378
  });
12294
12379
  if (!updateLastMessage) {
12295
- _context.next = 220;
12380
+ _context.next = 233;
12296
12381
  break;
12297
12382
  }
12298
12383
  lastMessage = _extends({}, _channel6.lastMessage, {
12299
12384
  deliveryStatus: markerList.name
12300
12385
  });
12301
12386
  updateChannelLastMessageOnAllChannels(_channel6.id, lastMessage);
12302
- _context.next = 220;
12387
+ _context.next = 233;
12303
12388
  return effects.put(updateChannelLastMessageStatusAC(lastMessage, JSON.parse(JSON.stringify(_channel6))));
12304
- case 220:
12389
+ case 233:
12305
12390
  if (!(_activeChannelId6 === channelId)) {
12306
- _context.next = 224;
12391
+ _context.next = 237;
12307
12392
  break;
12308
12393
  }
12309
- _context.next = 223;
12394
+ _context.next = 236;
12310
12395
  return effects.put(updateMessagesStatusAC(markerList.name, markersMap));
12311
- case 223:
12396
+ case 236:
12312
12397
  updateMarkersOnAllMessages(markersMap, markerList.name);
12313
- case 224:
12398
+ case 237:
12314
12399
  updateMessageStatusOnMap(_channel6.id, {
12315
12400
  name: markerList.name,
12316
12401
  markersMap: markersMap
12317
12402
  });
12318
- case 225:
12319
- return _context.abrupt("break", 449);
12320
- case 226:
12403
+ case 238:
12404
+ return _context.abrupt("break", 462);
12405
+ case 239:
12321
12406
  _channelId = args.channelId;
12322
12407
  log.info('channel DELETE ... ');
12323
12408
  _channel7 = getChannelFromMap(_channelId);
12324
- _context.next = 231;
12409
+ _context.next = 244;
12325
12410
  return effects.put(setChannelToRemoveAC(_channel7));
12326
- case 231:
12411
+ case 244:
12327
12412
  deleteChannelFromAllChannels(_channelId);
12328
- return _context.abrupt("break", 449);
12329
- case 233:
12413
+ return _context.abrupt("break", 462);
12414
+ case 246:
12330
12415
  _channel8 = args.channel, deletedMessage = args.deletedMessage;
12331
12416
  _activeChannelId7 = getActiveChannelId();
12332
12417
  log.info('channel DELETE_MESSAGE ... ');
12333
12418
  _channelExists7 = checkChannelExists(_channel8.id);
12334
12419
  if (!(_channel8.id === _activeChannelId7)) {
12335
- _context.next = 241;
12420
+ _context.next = 254;
12336
12421
  break;
12337
12422
  }
12338
12423
  updateMessageOnAllMessages(deletedMessage.id, deletedMessage);
12339
- _context.next = 241;
12424
+ _context.next = 254;
12340
12425
  return effects.put(updateMessageAC(deletedMessage.id, deletedMessage));
12341
- case 241:
12426
+ case 254:
12342
12427
  updateMessageOnMap(_channel8.id, {
12343
12428
  messageId: deletedMessage.id,
12344
12429
  params: deletedMessage
12345
12430
  });
12346
12431
  if (!_channelExists7) {
12347
- _context.next = 248;
12432
+ _context.next = 261;
12348
12433
  break;
12349
12434
  }
12350
- _context.next = 245;
12435
+ _context.next = 258;
12351
12436
  return effects.put(updateChannelDataAC(_channel8.id, {
12352
12437
  newMessageCount: _channel8.newMessageCount,
12353
12438
  muted: _channel8.muted,
12354
12439
  mutedTill: _channel8.mutedTill
12355
12440
  }));
12356
- case 245:
12441
+ case 258:
12357
12442
  if (!(_channel8.lastMessage.id === deletedMessage.id)) {
12358
- _context.next = 248;
12443
+ _context.next = 261;
12359
12444
  break;
12360
12445
  }
12361
- _context.next = 248;
12446
+ _context.next = 261;
12362
12447
  return effects.put(updateChannelLastMessageAC(deletedMessage, _channel8));
12363
- case 248:
12448
+ case 261:
12364
12449
  updateChannelOnAllChannels(_channel8.id, {
12365
12450
  newMessageCount: _channel8.newMessageCount,
12366
12451
  muted: _channel8.muted,
12367
12452
  mutedTill: _channel8.mutedTill
12368
12453
  }, deletedMessage);
12369
- return _context.abrupt("break", 449);
12370
- case 250:
12454
+ return _context.abrupt("break", 462);
12455
+ case 263:
12371
12456
  _channel9 = args.channel, _message = args.message;
12372
12457
  log.info('channel EDIT_MESSAGE ... ', _message);
12373
12458
  _activeChannelId8 = getActiveChannelId();
12374
12459
  _channelExists8 = checkChannelExists(_channel9.id);
12375
12460
  if (!(_channel9.id === _activeChannelId8)) {
12376
- _context.next = 258;
12461
+ _context.next = 271;
12377
12462
  break;
12378
12463
  }
12379
- _context.next = 257;
12464
+ _context.next = 270;
12380
12465
  return effects.put(updateMessageAC(_message.id, {
12381
12466
  body: _message.body,
12382
12467
  state: _message.state,
@@ -12385,7 +12470,7 @@ function watchForEvents() {
12385
12470
  mentionedUsers: _message.mentionedUsers,
12386
12471
  updatedAt: _message.updatedAt
12387
12472
  }));
12388
- case 257:
12473
+ case 270:
12389
12474
  updateMessageOnAllMessages(_message.id, {
12390
12475
  body: _message.body,
12391
12476
  state: _message.state,
@@ -12394,18 +12479,18 @@ function watchForEvents() {
12394
12479
  mentionedUsers: _message.mentionedUsers,
12395
12480
  updatedAt: _message.updatedAt
12396
12481
  });
12397
- case 258:
12482
+ case 271:
12398
12483
  if (!_channelExists8) {
12399
- _context.next = 262;
12484
+ _context.next = 275;
12400
12485
  break;
12401
12486
  }
12402
12487
  if (!(_channel9.lastMessage.id === _message.id)) {
12403
- _context.next = 262;
12488
+ _context.next = 275;
12404
12489
  break;
12405
12490
  }
12406
- _context.next = 262;
12491
+ _context.next = 275;
12407
12492
  return effects.put(updateChannelLastMessageAC(_message, _channel9));
12408
- case 262:
12493
+ case 275:
12409
12494
  if (checkChannelExistsOnMessagesMap(_channel9.id)) {
12410
12495
  updateMessageOnMap(_channel9.id, {
12411
12496
  messageId: _message.id,
@@ -12413,36 +12498,36 @@ function watchForEvents() {
12413
12498
  });
12414
12499
  }
12415
12500
  updateChannelOnAllChannels(_channel9.id, {}, _message);
12416
- return _context.abrupt("break", 449);
12417
- case 265:
12501
+ return _context.abrupt("break", 462);
12502
+ case 278:
12418
12503
  _channel0 = args.channel, user = args.user, _message2 = args.message, reaction = args.reaction;
12419
12504
  log.info('channel REACTION_ADDED ... ', args);
12420
12505
  isSelf = user.id === SceytChatClient.user.id;
12421
12506
  _activeChannelId9 = getActiveChannelId();
12422
12507
  if (!(_channel0.id === _activeChannelId9)) {
12423
- _context.next = 273;
12508
+ _context.next = 286;
12424
12509
  break;
12425
12510
  }
12426
- _context.next = 272;
12511
+ _context.next = 285;
12427
12512
  return effects.put(addReactionToMessageAC(_message2, reaction, isSelf));
12428
- case 272:
12513
+ case 285:
12429
12514
  addReactionOnAllMessages(_message2, reaction, true);
12430
- case 273:
12515
+ case 286:
12431
12516
  if (!(_message2.user.id === SceytChatClient.user.id)) {
12432
- _context.next = 291;
12517
+ _context.next = 304;
12433
12518
  break;
12434
12519
  }
12435
12520
  if (!(!isSelf && Notification.permission === 'granted')) {
12436
- _context.next = 286;
12521
+ _context.next = 299;
12437
12522
  break;
12438
12523
  }
12439
12524
  if (!(document.visibilityState !== 'visible' || _channel0.id !== _activeChannelId9)) {
12440
- _context.next = 286;
12525
+ _context.next = 299;
12441
12526
  break;
12442
12527
  }
12443
- _context.next = 278;
12528
+ _context.next = 291;
12444
12529
  return effects.select(contactsMapSelector);
12445
- case 278:
12530
+ case 291:
12446
12531
  _contactsMap = _context.sent;
12447
12532
  _getFromContacts2 = getShowOnlyContactUsers();
12448
12533
  _state = store.getState();
@@ -12462,9 +12547,9 @@ function watchForEvents() {
12462
12547
  setNotification(_messageBody, reaction.user, _channel0, reaction.key, _message2.attachments && _message2.attachments.length ? _message2.attachments.find(function (att) {
12463
12548
  return att.type !== attachmentTypes.link;
12464
12549
  }) : undefined);
12465
- case 286:
12550
+ case 299:
12466
12551
  if (!(_channel0.newReactions && _channel0.newReactions.length)) {
12467
- _context.next = 290;
12552
+ _context.next = 303;
12468
12553
  break;
12469
12554
  }
12470
12555
  channelUpdateParams = {
@@ -12474,9 +12559,9 @@ function watchForEvents() {
12474
12559
  muted: _channel0.muted,
12475
12560
  mutedTill: _channel0.mutedTill
12476
12561
  };
12477
- _context.next = 290;
12562
+ _context.next = 303;
12478
12563
  return effects.put(updateChannelDataAC(_channel0.id, channelUpdateParams));
12479
- case 290:
12564
+ case 303:
12480
12565
  updateChannelOnAllChannels(_channel0.id, {
12481
12566
  userMessageReactions: _channel0.newReactions,
12482
12567
  lastReactedMessage: _message2,
@@ -12484,77 +12569,77 @@ function watchForEvents() {
12484
12569
  muted: _channel0.muted,
12485
12570
  mutedTill: _channel0.mutedTill
12486
12571
  });
12487
- case 291:
12572
+ case 304:
12488
12573
  if (checkChannelExistsOnMessagesMap(_channel0.id)) {
12489
12574
  addReactionToMessageOnMap(_channel0.id, _message2, reaction, true);
12490
12575
  }
12491
- return _context.abrupt("break", 449);
12492
- case 293:
12576
+ return _context.abrupt("break", 462);
12577
+ case 306:
12493
12578
  _channel1 = args.channel, _user = args.user, _message3 = args.message, _reaction = args.reaction;
12494
12579
  log.info('channel REACTION_DELETED ... ', _channel1);
12495
12580
  channelFromMap = getChannelFromMap(_channel1.id);
12496
12581
  _isSelf = _user.id === SceytChatClient.user.id;
12497
12582
  _activeChannelId0 = getActiveChannelId();
12498
12583
  if (!(_channel1.id === _activeChannelId0)) {
12499
- _context.next = 302;
12584
+ _context.next = 315;
12500
12585
  break;
12501
12586
  }
12502
- _context.next = 301;
12587
+ _context.next = 314;
12503
12588
  return effects.put(deleteReactionFromMessageAC(_message3, _reaction, _isSelf));
12504
- case 301:
12589
+ case 314:
12505
12590
  removeReactionOnAllMessages(_message3, _reaction, true);
12506
- case 302:
12591
+ case 315:
12507
12592
  _channelUpdateParams = JSON.parse(JSON.stringify(_channel1));
12508
12593
  if (channelFromMap && channelFromMap.lastReactedMessage && channelFromMap.lastReactedMessage.id === _message3.id) {
12509
12594
  _channelUpdateParams.lastReactedMessage = null;
12510
12595
  }
12511
- _context.next = 306;
12596
+ _context.next = 319;
12512
12597
  return effects.put(updateChannelDataAC(_channel1.id, _channelUpdateParams));
12513
- case 306:
12598
+ case 319:
12514
12599
  updateChannelOnAllChannels(_channel1.id, _channelUpdateParams);
12515
12600
  if (checkChannelExistsOnMessagesMap(_channel1.id)) {
12516
12601
  removeReactionToMessageOnMap(_channel1.id, _message3, _reaction, true);
12517
12602
  }
12518
- return _context.abrupt("break", 449);
12519
- case 309:
12603
+ return _context.abrupt("break", 462);
12604
+ case 322:
12520
12605
  _channel10 = args.channel;
12521
12606
  if (!_channel10) {
12522
- _context.next = 315;
12607
+ _context.next = 328;
12523
12608
  break;
12524
12609
  }
12525
12610
  _updatedChannel = JSON.parse(JSON.stringify(_channel10));
12526
- _context.next = 314;
12611
+ _context.next = 327;
12527
12612
  return effects.put(updateChannelDataAC(_channel10.id, _updatedChannel));
12528
- case 314:
12613
+ case 327:
12529
12614
  updateChannelOnAllChannels(_channel10.id, _updatedChannel);
12530
- case 315:
12531
- return _context.abrupt("break", 449);
12532
- case 316:
12615
+ case 328:
12616
+ return _context.abrupt("break", 462);
12617
+ case 329:
12533
12618
  _channel11 = args.channel;
12534
12619
  log.info('CLEAR_HISTORY: ', _channel11);
12535
- _context.next = 320;
12620
+ _context.next = 333;
12536
12621
  return effects.call(getActiveChannelId);
12537
- case 320:
12622
+ case 333:
12538
12623
  _activeChannelId1 = _context.sent;
12539
- _context.next = 323;
12624
+ _context.next = 336;
12540
12625
  return effects.call(checkChannelExists, _channel11.id);
12541
- case 323:
12626
+ case 336:
12542
12627
  channelExist = _context.sent;
12543
12628
  if (!(_channel11.id === _activeChannelId1)) {
12544
- _context.next = 328;
12629
+ _context.next = 341;
12545
12630
  break;
12546
12631
  }
12547
- _context.next = 327;
12632
+ _context.next = 340;
12548
12633
  return effects.put(clearMessagesAC());
12549
- case 327:
12634
+ case 340:
12550
12635
  removeAllMessages();
12551
- case 328:
12636
+ case 341:
12552
12637
  removeMessagesFromMap(_channel11.id);
12553
12638
  if (!channelExist) {
12554
- _context.next = 332;
12639
+ _context.next = 345;
12555
12640
  break;
12556
12641
  }
12557
- _context.next = 332;
12642
+ _context.next = 345;
12558
12643
  return effects.put(updateChannelDataAC(_channel11.id, {
12559
12644
  lastMessage: null,
12560
12645
  newMessageCount: 0,
@@ -12562,7 +12647,7 @@ function watchForEvents() {
12562
12647
  muted: _channel11.muted,
12563
12648
  mutedTill: _channel11.mutedTill
12564
12649
  }));
12565
- case 332:
12650
+ case 345:
12566
12651
  updateChannelOnAllChannels(_channel11.id, {
12567
12652
  lastMessage: null,
12568
12653
  newMessageCount: 0,
@@ -12570,173 +12655,173 @@ function watchForEvents() {
12570
12655
  muted: _channel11.muted,
12571
12656
  mutedTill: _channel11.mutedTill
12572
12657
  });
12573
- return _context.abrupt("break", 449);
12574
- case 334:
12658
+ return _context.abrupt("break", 462);
12659
+ case 347:
12575
12660
  _channel12 = args.channel;
12576
12661
  log.info('channel MUTE ... ');
12577
- _context.next = 338;
12662
+ _context.next = 351;
12578
12663
  return effects.put(updateChannelDataAC(_channel12.id, {
12579
12664
  muted: _channel12.muted,
12580
12665
  mutedTill: _channel12.mutedTill
12581
12666
  }));
12582
- case 338:
12667
+ case 351:
12583
12668
  updateChannelOnAllChannels(_channel12.id, {
12584
12669
  muted: _channel12.muted,
12585
12670
  mutedTill: _channel12.mutedTill
12586
12671
  });
12587
- return _context.abrupt("break", 449);
12588
- case 340:
12672
+ return _context.abrupt("break", 462);
12673
+ case 353:
12589
12674
  _channel13 = args.channel;
12590
12675
  log.info('channel UNMUTE ... ');
12591
- _context.next = 344;
12676
+ _context.next = 357;
12592
12677
  return effects.put(updateChannelDataAC(_channel13.id, {
12593
12678
  muted: _channel13.muted,
12594
12679
  mutedTill: _channel13.mutedTill
12595
12680
  }));
12596
- case 344:
12681
+ case 357:
12597
12682
  updateChannelOnAllChannels(_channel13.id, {
12598
12683
  muted: _channel13.muted,
12599
12684
  mutedTill: _channel13.mutedTill
12600
12685
  });
12601
- return _context.abrupt("break", 449);
12602
- case 346:
12686
+ return _context.abrupt("break", 462);
12687
+ case 359:
12603
12688
  _channel14 = args.channel;
12604
12689
  log.info('channel PINED ... ');
12605
- _context.next = 350;
12690
+ _context.next = 363;
12606
12691
  return effects.put(updateChannelDataAC(_channel14.id, {
12607
12692
  pinnedAt: _channel14.pinnedAt
12608
12693
  }, true));
12609
- case 350:
12694
+ case 363:
12610
12695
  updateChannelOnAllChannels(_channel14.id, {
12611
12696
  pinnedAt: _channel14.pinnedAt
12612
12697
  });
12613
- return _context.abrupt("break", 449);
12614
- case 352:
12698
+ return _context.abrupt("break", 462);
12699
+ case 365:
12615
12700
  _channel15 = args.channel;
12616
12701
  log.info('channel UNPINED ... ');
12617
- _context.next = 356;
12702
+ _context.next = 369;
12618
12703
  return effects.put(updateChannelDataAC(_channel15.id, {
12619
12704
  pinnedAt: _channel15.pinnedAt
12620
12705
  }, false, true));
12621
- case 356:
12706
+ case 369:
12622
12707
  updateChannelOnAllChannels(_channel15.id, {
12623
12708
  pinnedAt: _channel15.pinnedAt
12624
12709
  });
12625
- return _context.abrupt("break", 449);
12626
- case 358:
12710
+ return _context.abrupt("break", 462);
12711
+ case 371:
12627
12712
  _channel16 = args.channel;
12628
12713
  log.info('channel HIDE ... ');
12629
- _context.next = 362;
12714
+ _context.next = 375;
12630
12715
  return effects.put(setChannelToHideAC(_channel16));
12631
- case 362:
12632
- return _context.abrupt("break", 449);
12633
- case 363:
12716
+ case 375:
12717
+ return _context.abrupt("break", 462);
12718
+ case 376:
12634
12719
  _channel17 = args.channel;
12635
12720
  log.info('channel UNHIDE ... ');
12636
- _context.next = 367;
12721
+ _context.next = 380;
12637
12722
  return effects.put(setChannelToUnHideAC(_channel17));
12638
- case 367:
12639
- return _context.abrupt("break", 449);
12640
- case 368:
12723
+ case 380:
12724
+ return _context.abrupt("break", 462);
12725
+ case 381:
12641
12726
  _channel18 = args.channel;
12642
- _context.next = 371;
12727
+ _context.next = 384;
12643
12728
  return effects.put(updateChannelDataAC(_channel18.id, {
12644
12729
  unread: _channel18.unread,
12645
12730
  muted: _channel18.muted,
12646
12731
  mutedTill: _channel18.mutedTill
12647
12732
  }));
12648
- case 371:
12733
+ case 384:
12649
12734
  _groupName5 = getChannelGroupName(_channel18);
12650
- _context.next = 374;
12735
+ _context.next = 387;
12651
12736
  return effects.put(updateSearchedChannelDataAC(_channel18.id, {
12652
12737
  unread: _channel18.unread
12653
12738
  }, _groupName5));
12654
- case 374:
12739
+ case 387:
12655
12740
  updateChannelOnAllChannels(_channel18.id, {
12656
12741
  unread: _channel18.unread
12657
12742
  });
12658
- return _context.abrupt("break", 449);
12659
- case 376:
12743
+ return _context.abrupt("break", 462);
12744
+ case 389:
12660
12745
  _channel19 = args.channel;
12661
- _context.next = 379;
12746
+ _context.next = 392;
12662
12747
  return effects.put(updateChannelDataAC(_channel19.id, {
12663
12748
  unread: _channel19.unread,
12664
12749
  muted: _channel19.muted,
12665
12750
  mutedTill: _channel19.mutedTill
12666
12751
  }));
12667
- case 379:
12752
+ case 392:
12668
12753
  _groupName6 = getChannelGroupName(_channel19);
12669
- _context.next = 382;
12754
+ _context.next = 395;
12670
12755
  return effects.put(updateSearchedChannelDataAC(_channel19.id, {
12671
12756
  unread: _channel19.unread
12672
12757
  }, _groupName6));
12673
- case 382:
12758
+ case 395:
12674
12759
  updateChannelOnAllChannels(_channel19.id, {
12675
12760
  unread: _channel19.unread
12676
12761
  });
12677
- return _context.abrupt("break", 449);
12678
- case 384:
12762
+ return _context.abrupt("break", 462);
12763
+ case 397:
12679
12764
  _channel20 = args.channel, members = args.members;
12680
12765
  log.info('channel CHANGE_ROLE channel ... ', _channel20);
12681
12766
  log.info('channel CHANGE_ROLE member ... ', members);
12682
- _context.next = 389;
12767
+ _context.next = 402;
12683
12768
  return effects.call(getActiveChannelId);
12684
- case 389:
12769
+ case 402:
12685
12770
  _activeChannelId10 = _context.sent;
12686
12771
  if (!(_channel20.id === _activeChannelId10)) {
12687
- _context.next = 393;
12772
+ _context.next = 406;
12688
12773
  break;
12689
12774
  }
12690
- _context.next = 393;
12775
+ _context.next = 406;
12691
12776
  return effects.put(updateMembersAC(members));
12692
- case 393:
12777
+ case 406:
12693
12778
  i = 0;
12694
- case 394:
12779
+ case 407:
12695
12780
  if (!(i < members.length)) {
12696
- _context.next = 402;
12781
+ _context.next = 415;
12697
12782
  break;
12698
12783
  }
12699
12784
  if (!(members[i].id === SceytChatClient.user.id)) {
12700
- _context.next = 399;
12785
+ _context.next = 412;
12701
12786
  break;
12702
12787
  }
12703
- _context.next = 398;
12788
+ _context.next = 411;
12704
12789
  return effects.put(updateChannelDataAC(_channel20.id, {
12705
12790
  userRole: members[i].role,
12706
12791
  muted: _channel20.muted,
12707
12792
  mutedTill: _channel20.mutedTill
12708
12793
  }));
12709
- case 398:
12794
+ case 411:
12710
12795
  updateChannelOnAllChannels(_channel20.id, {
12711
12796
  userRole: members[i].role,
12712
12797
  muted: _channel20.muted,
12713
12798
  mutedTill: _channel20.mutedTill
12714
12799
  });
12715
- case 399:
12800
+ case 412:
12716
12801
  i++;
12717
- _context.next = 394;
12802
+ _context.next = 407;
12718
12803
  break;
12719
- case 402:
12720
- return _context.abrupt("break", 449);
12721
- case 403:
12804
+ case 415:
12805
+ return _context.abrupt("break", 462);
12806
+ case 416:
12722
12807
  _channel21 = args.channel;
12723
12808
  log.info('channel frozen channel ... ', _channel21);
12724
- return _context.abrupt("break", 449);
12725
- case 406:
12809
+ return _context.abrupt("break", 462);
12810
+ case 419:
12726
12811
  _channel22 = args.channel;
12727
12812
  log.info('channel unfrozen channel ... ', _channel22);
12728
- return _context.abrupt("break", 449);
12729
- case 409:
12813
+ return _context.abrupt("break", 462);
12814
+ case 422:
12730
12815
  _channelId2 = args.channelId, from = args.from, name = args.name;
12731
12816
  log.info('channel event received >>>... . . . . . ', args);
12732
12817
  if (!(from.id === SceytChatClient.user.id)) {
12733
- _context.next = 413;
12818
+ _context.next = 426;
12734
12819
  break;
12735
12820
  }
12736
- return _context.abrupt("break", 449);
12737
- case 413:
12821
+ return _context.abrupt("break", 462);
12822
+ case 426:
12738
12823
  if (!(name === 'start_typing')) {
12739
- _context.next = 421;
12824
+ _context.next = 434;
12740
12825
  break;
12741
12826
  }
12742
12827
  if (!usersTimeout[_channelId2]) {
@@ -12748,27 +12833,27 @@ function watchForEvents() {
12748
12833
  usersTimeout[_channelId2][from.id] = setTimeout(function () {
12749
12834
  channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_typing');
12750
12835
  }, 5000);
12751
- _context.next = 419;
12836
+ _context.next = 432;
12752
12837
  return effects.put(switchTypingIndicatorAC(true, _channelId2, from));
12753
- case 419:
12754
- _context.next = 439;
12838
+ case 432:
12839
+ _context.next = 452;
12755
12840
  break;
12756
- case 421:
12841
+ case 434:
12757
12842
  if (!(name === 'stop_typing')) {
12758
- _context.next = 427;
12843
+ _context.next = 440;
12759
12844
  break;
12760
12845
  }
12761
12846
  if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
12762
12847
  clearTimeout(usersTimeout[_channelId2][from.id]);
12763
12848
  }
12764
- _context.next = 425;
12849
+ _context.next = 438;
12765
12850
  return effects.put(switchTypingIndicatorAC(false, _channelId2, from));
12766
- case 425:
12767
- _context.next = 439;
12851
+ case 438:
12852
+ _context.next = 452;
12768
12853
  break;
12769
- case 427:
12854
+ case 440:
12770
12855
  if (!(name === 'start_recording')) {
12771
- _context.next = 435;
12856
+ _context.next = 448;
12772
12857
  break;
12773
12858
  }
12774
12859
  if (!usersTimeout[_channelId2]) {
@@ -12780,40 +12865,40 @@ function watchForEvents() {
12780
12865
  usersTimeout[_channelId2][from.id] = setTimeout(function () {
12781
12866
  channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_recording');
12782
12867
  }, 5000);
12783
- _context.next = 433;
12868
+ _context.next = 446;
12784
12869
  return effects.put(switchRecordingIndicatorAC(true, _channelId2, from));
12785
- case 433:
12786
- _context.next = 439;
12870
+ case 446:
12871
+ _context.next = 452;
12787
12872
  break;
12788
- case 435:
12873
+ case 448:
12789
12874
  if (!(name === 'stop_recording')) {
12790
- _context.next = 439;
12875
+ _context.next = 452;
12791
12876
  break;
12792
12877
  }
12793
12878
  if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
12794
12879
  clearTimeout(usersTimeout[_channelId2][from.id]);
12795
12880
  }
12796
- _context.next = 439;
12881
+ _context.next = 452;
12797
12882
  return effects.put(switchRecordingIndicatorAC(false, _channelId2, from));
12798
- case 439:
12799
- return _context.abrupt("break", 449);
12800
- case 440:
12883
+ case 452:
12884
+ return _context.abrupt("break", 462);
12885
+ case 453:
12801
12886
  status = args.status;
12802
12887
  log.info('connection status changed . . . . . ', status);
12803
- _context.next = 444;
12888
+ _context.next = 457;
12804
12889
  return effects.put(setConnectionStatusAC(status));
12805
- case 444:
12890
+ case 457:
12806
12891
  if (!(status === CONNECTION_STATUS.CONNECTED)) {
12807
- _context.next = 447;
12892
+ _context.next = 460;
12808
12893
  break;
12809
12894
  }
12810
- _context.next = 447;
12895
+ _context.next = 460;
12811
12896
  return effects.put(getRolesAC());
12812
- case 447:
12813
- return _context.abrupt("break", 449);
12814
- case 448:
12897
+ case 460:
12898
+ return _context.abrupt("break", 462);
12899
+ case 461:
12815
12900
  log.warn('UNHANDLED EVENT FROM REDUX-SAGA EVENT-CHANNEL');
12816
- case 449:
12901
+ case 462:
12817
12902
  case "end":
12818
12903
  return _context.stop();
12819
12904
  }
@@ -12828,7 +12913,7 @@ function watchForEvents() {
12828
12913
  case "end":
12829
12914
  return _context2.stop();
12830
12915
  }
12831
- }, _marked);
12916
+ }, _marked$1);
12832
12917
  }
12833
12918
 
12834
12919
  var channelsSelector = function channelsSelector(store) {
@@ -12906,8 +12991,8 @@ var channelMessageDraftIsRemovedSelector = function channelMessageDraftIsRemoved
12906
12991
  return store.ChannelReducer.draftIsRemoved;
12907
12992
  };
12908
12993
 
12909
- var _marked$1 = /*#__PURE__*/_regeneratorRuntime().mark(createChannel),
12910
- _marked2 = /*#__PURE__*/_regeneratorRuntime().mark(getChannels),
12994
+ var _marked$2 = /*#__PURE__*/_regeneratorRuntime().mark(createChannel),
12995
+ _marked2$1 = /*#__PURE__*/_regeneratorRuntime().mark(getChannels),
12911
12996
  _marked3 = /*#__PURE__*/_regeneratorRuntime().mark(searchChannels),
12912
12997
  _marked4 = /*#__PURE__*/_regeneratorRuntime().mark(getChannelsForForward),
12913
12998
  _marked5 = /*#__PURE__*/_regeneratorRuntime().mark(searchChannelsForForward),
@@ -13112,7 +13197,7 @@ function createChannel(action) {
13112
13197
  case "end":
13113
13198
  return _context.stop();
13114
13199
  }
13115
- }, _marked$1, null, [[0, 53]]);
13200
+ }, _marked$2, null, [[0, 53]]);
13116
13201
  }
13117
13202
  function getChannels(action) {
13118
13203
  var _params$filter, _types, payload, params, SceytChatClient, channelQueryBuilder, channelTypesFilter, types, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, channelMessageMap, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, i, allChannelsData, allChannelList;
@@ -13295,7 +13380,7 @@ function getChannels(action) {
13295
13380
  case "end":
13296
13381
  return _context2.stop();
13297
13382
  }
13298
- }, _marked2, null, [[0, 89], [72, 81]]);
13383
+ }, _marked2$1, null, [[0, 89], [72, 81]]);
13299
13384
  }
13300
13385
  function searchChannels(action) {
13301
13386
  var payload, params, contactsMap, SceytChatClient, getFromContacts, searchBy, _params$filter2, _types2, channelQueryBuilder, channelTypesFilter, types, allChannels, publicChannels, chatsGroups, contactsList, contactsWithChannelsMap, lowerCaseSearchBy, channelQuery, channelsData, channelsToAdd;
@@ -14412,7 +14497,8 @@ function checkUsersStatus() {
14412
14497
  usersToUpdateMap = {};
14413
14498
  update = false;
14414
14499
  updatedUsers.forEach(function (updatedUser) {
14415
- if (updatedUser.presence && (updatedUser.presence.state !== usersMap[updatedUser.id].presence.state || updatedUser.presence.status !== usersMap[updatedUser.id].presence.status || updatedUser.presence.lastActiveAt && new Date(updatedUser.presence.lastActiveAt).getTime() !== new Date(usersMap[updatedUser.id].presence.lastActiveAt).getTime() || updatedUser.avatarUrl !== usersMap[updatedUser.id].avatarUrl || updatedUser.firstName !== usersMap[updatedUser.id].firstName || updatedUser.lastName !== usersMap[updatedUser.id].lastName)) {
14500
+ var _usersMap$updatedUser, _usersMap$updatedUser2, _usersMap$updatedUser3, _usersMap$updatedUser4, _usersMap$updatedUser5, _usersMap$updatedUser6, _usersMap$updatedUser7, _usersMap$updatedUser8, _usersMap$updatedUser9;
14501
+ if (updatedUser.presence && (updatedUser.presence.state !== ((_usersMap$updatedUser = usersMap[updatedUser.id]) === null || _usersMap$updatedUser === void 0 ? void 0 : (_usersMap$updatedUser2 = _usersMap$updatedUser.presence) === null || _usersMap$updatedUser2 === void 0 ? void 0 : _usersMap$updatedUser2.state) || updatedUser.presence.status !== ((_usersMap$updatedUser3 = usersMap[updatedUser.id]) === null || _usersMap$updatedUser3 === void 0 ? void 0 : (_usersMap$updatedUser4 = _usersMap$updatedUser3.presence) === null || _usersMap$updatedUser4 === void 0 ? void 0 : _usersMap$updatedUser4.status) || updatedUser.presence.lastActiveAt && new Date(updatedUser.presence.lastActiveAt).getTime() !== new Date(((_usersMap$updatedUser5 = usersMap[updatedUser.id]) === null || _usersMap$updatedUser5 === void 0 ? void 0 : (_usersMap$updatedUser6 = _usersMap$updatedUser5.presence) === null || _usersMap$updatedUser6 === void 0 ? void 0 : _usersMap$updatedUser6.lastActiveAt) || 0).getTime() || updatedUser.avatarUrl !== ((_usersMap$updatedUser7 = usersMap[updatedUser.id]) === null || _usersMap$updatedUser7 === void 0 ? void 0 : _usersMap$updatedUser7.avatarUrl) || updatedUser.firstName !== ((_usersMap$updatedUser8 = usersMap[updatedUser.id]) === null || _usersMap$updatedUser8 === void 0 ? void 0 : _usersMap$updatedUser8.firstName) || updatedUser.lastName !== ((_usersMap$updatedUser9 = usersMap[updatedUser.id]) === null || _usersMap$updatedUser9 === void 0 ? void 0 : _usersMap$updatedUser9.lastName))) {
14416
14502
  updateUserOnMap(updatedUser);
14417
14503
  usersToUpdateMap[updatedUser.id] = updatedUser;
14418
14504
  update = true;
@@ -15355,8 +15441,8 @@ var getFrame = function getFrame(videoSrc, time) {
15355
15441
  }
15356
15442
  };
15357
15443
 
15358
- var _marked$2 = /*#__PURE__*/_regeneratorRuntime().mark(sendMessage),
15359
- _marked2$1 = /*#__PURE__*/_regeneratorRuntime().mark(sendTextMessage),
15444
+ var _marked$3 = /*#__PURE__*/_regeneratorRuntime().mark(sendMessage),
15445
+ _marked2$2 = /*#__PURE__*/_regeneratorRuntime().mark(sendTextMessage),
15360
15446
  _marked3$1 = /*#__PURE__*/_regeneratorRuntime().mark(forwardMessage),
15361
15447
  _marked4$1 = /*#__PURE__*/_regeneratorRuntime().mark(resendMessage),
15362
15448
  _marked5$1 = /*#__PURE__*/_regeneratorRuntime().mark(deleteMessage),
@@ -15954,7 +16040,7 @@ function sendMessage(action) {
15954
16040
  case "end":
15955
16041
  return _context3.stop();
15956
16042
  }
15957
- }, _marked$2, null, [[2, 80]]);
16043
+ }, _marked$3, null, [[2, 80]]);
15958
16044
  }
15959
16045
  function sendTextMessage(action) {
15960
16046
  var payload, message, connectionState, channelId, channel, sendMessageTid, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, hasNextMessages, messagesToAdd, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam;
@@ -16152,7 +16238,7 @@ function sendTextMessage(action) {
16152
16238
  case "end":
16153
16239
  return _context4.stop();
16154
16240
  }
16155
- }, _marked2$1, null, [[8, 82]]);
16241
+ }, _marked2$2, null, [[8, 82]]);
16156
16242
  }
16157
16243
  function forwardMessage(action) {
16158
16244
  var payload, message, channelId, connectionState, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam;
@@ -17682,8 +17768,8 @@ function MessageSaga() {
17682
17768
  }, _marked15$1);
17683
17769
  }
17684
17770
 
17685
- var _marked$3 = /*#__PURE__*/_regeneratorRuntime().mark(getMembers),
17686
- _marked2$2 = /*#__PURE__*/_regeneratorRuntime().mark(loadMoreMembers),
17771
+ var _marked$4 = /*#__PURE__*/_regeneratorRuntime().mark(getMembers),
17772
+ _marked2$3 = /*#__PURE__*/_regeneratorRuntime().mark(loadMoreMembers),
17687
17773
  _marked3$2 = /*#__PURE__*/_regeneratorRuntime().mark(addMembers),
17688
17774
  _marked4$2 = /*#__PURE__*/_regeneratorRuntime().mark(kickMemberFromChannel),
17689
17775
  _marked5$2 = /*#__PURE__*/_regeneratorRuntime().mark(blockMember),
@@ -17731,47 +17817,55 @@ function getMembers(action) {
17731
17817
  case "end":
17732
17818
  return _context.stop();
17733
17819
  }
17734
- }, _marked$3, null, [[0, 22]]);
17820
+ }, _marked$4, null, [[0, 22]]);
17735
17821
  }
17736
17822
  function loadMoreMembers(action) {
17737
- var payload, limit, membersQuery, _yield$call2, members;
17823
+ var payload, limit, channelId, membersQuery, _yield$call2, members, updateChannelData;
17738
17824
  return _regeneratorRuntime().wrap(function loadMoreMembers$(_context2) {
17739
17825
  while (1) switch (_context2.prev = _context2.next) {
17740
17826
  case 0:
17741
17827
  _context2.prev = 0;
17742
17828
  payload = action.payload;
17743
17829
  limit = payload.limit;
17830
+ channelId = payload.channelId;
17744
17831
  membersQuery = query.membersQuery;
17745
17832
  if (limit && membersQuery) {
17746
17833
  membersQuery.limit = limit;
17747
17834
  }
17748
- _context2.next = 7;
17835
+ _context2.next = 8;
17749
17836
  return effects.put(setMembersLoadingStateAC(LOADING_STATE.LOADING));
17750
- case 7:
17751
- _context2.next = 9;
17837
+ case 8:
17838
+ _context2.next = 10;
17752
17839
  return effects.call(membersQuery.loadNextPage);
17753
- case 9:
17840
+ case 10:
17754
17841
  _yield$call2 = _context2.sent;
17755
17842
  members = _yield$call2.members;
17756
- _context2.next = 13;
17843
+ _context2.next = 14;
17757
17844
  return effects.put(addMembersToListAC(members));
17758
- case 13:
17759
- _context2.next = 15;
17845
+ case 14:
17846
+ _context2.next = 16;
17760
17847
  return effects.put(setMembersLoadingStateAC(LOADING_STATE.LOADED));
17761
- case 15:
17762
- _context2.next = 20;
17848
+ case 16:
17849
+ _context2.next = 18;
17850
+ return effects.call(updateActiveChannelMembersAdd, members) || {};
17851
+ case 18:
17852
+ updateChannelData = _context2.sent;
17853
+ _context2.next = 21;
17854
+ return effects.put(updateChannelDataAC(channelId, _extends({}, updateChannelData)));
17855
+ case 21:
17856
+ _context2.next = 26;
17763
17857
  break;
17764
- case 17:
17765
- _context2.prev = 17;
17858
+ case 23:
17859
+ _context2.prev = 23;
17766
17860
  _context2.t0 = _context2["catch"](0);
17767
- case 20:
17861
+ case 26:
17768
17862
  case "end":
17769
17863
  return _context2.stop();
17770
17864
  }
17771
- }, _marked2$2, null, [[0, 17]]);
17865
+ }, _marked2$3, null, [[0, 23]]);
17772
17866
  }
17773
17867
  function addMembers(action) {
17774
- var payload, members, channelId, channel, membersToAdd, addedMembers, membersIds, messageToSend;
17868
+ var payload, members, channelId, channel, membersToAdd, addedMembers, membersIds, messageToSend, updateChannelData;
17775
17869
  return _regeneratorRuntime().wrap(function addMembers$(_context3) {
17776
17870
  while (1) switch (_context3.prev = _context3.next) {
17777
17871
  case 0:
@@ -17783,7 +17877,7 @@ function addMembers(action) {
17783
17877
  case 5:
17784
17878
  channel = _context3.sent;
17785
17879
  if (!channel) {
17786
- _context3.next = 22;
17880
+ _context3.next = 25;
17787
17881
  break;
17788
17882
  }
17789
17883
  membersToAdd = members.map(function (mem) {
@@ -17821,24 +17915,28 @@ function addMembers(action) {
17821
17915
  memberCount: channel.memberCount + addedMembers.length
17822
17916
  });
17823
17917
  _context3.next = 22;
17824
- return effects.put(updateChannelDataAC(channel.id, {
17825
- memberCount: channel.memberCount + addedMembers.length
17826
- }));
17918
+ return effects.call(updateActiveChannelMembersAdd, addedMembers) || {};
17827
17919
  case 22:
17828
- _context3.next = 27;
17920
+ updateChannelData = _context3.sent;
17921
+ _context3.next = 25;
17922
+ return effects.put(updateChannelDataAC(channel.id, _extends({
17923
+ memberCount: channel.memberCount + addedMembers.length
17924
+ }, updateChannelData)));
17925
+ case 25:
17926
+ _context3.next = 30;
17829
17927
  break;
17830
- case 24:
17831
- _context3.prev = 24;
17928
+ case 27:
17929
+ _context3.prev = 27;
17832
17930
  _context3.t0 = _context3["catch"](0);
17833
17931
  log.error('error on add members... ', _context3.t0);
17834
- case 27:
17932
+ case 30:
17835
17933
  case "end":
17836
17934
  return _context3.stop();
17837
17935
  }
17838
- }, _marked3$2, null, [[0, 24]]);
17936
+ }, _marked3$2, null, [[0, 27]]);
17839
17937
  }
17840
17938
  function kickMemberFromChannel(action) {
17841
- var payload, memberId, channelId, channel, removedMembers, membersIds, messageToSend;
17939
+ var payload, memberId, channelId, channel, removedMembers, membersIds, messageToSend, updateChannelData;
17842
17940
  return _regeneratorRuntime().wrap(function kickMemberFromChannel$(_context4) {
17843
17941
  while (1) switch (_context4.prev = _context4.next) {
17844
17942
  case 0:
@@ -17880,23 +17978,27 @@ function kickMemberFromChannel(action) {
17880
17978
  memberCount: channel.memberCount - removedMembers.length
17881
17979
  });
17882
17980
  _context4.next = 20;
17883
- return effects.put(updateChannelDataAC(channel.id, {
17884
- memberCount: channel.memberCount - removedMembers.length
17885
- }));
17981
+ return effects.call(updateActiveChannelMembersRemove, removedMembers) || {};
17886
17982
  case 20:
17887
- _context4.next = 24;
17983
+ updateChannelData = _context4.sent;
17984
+ _context4.next = 23;
17985
+ return effects.put(updateChannelDataAC(channel.id, _extends({
17986
+ memberCount: channel.memberCount - removedMembers.length
17987
+ }, updateChannelData)));
17988
+ case 23:
17989
+ _context4.next = 27;
17888
17990
  break;
17889
- case 22:
17890
- _context4.prev = 22;
17991
+ case 25:
17992
+ _context4.prev = 25;
17891
17993
  _context4.t0 = _context4["catch"](0);
17892
- case 24:
17994
+ case 27:
17893
17995
  case "end":
17894
17996
  return _context4.stop();
17895
17997
  }
17896
- }, _marked4$2, null, [[0, 22]]);
17998
+ }, _marked4$2, null, [[0, 25]]);
17897
17999
  }
17898
18000
  function blockMember(action) {
17899
- var payload, memberId, channelId, channel, removedMembers;
18001
+ var payload, memberId, channelId, channel, removedMembers, updateChannelData;
17900
18002
  return _regeneratorRuntime().wrap(function blockMember$(_context5) {
17901
18003
  while (1) switch (_context5.prev = _context5.next) {
17902
18004
  case 0:
@@ -17918,20 +18020,24 @@ function blockMember(action) {
17918
18020
  memberCount: channel.memberCount - removedMembers.length
17919
18021
  });
17920
18022
  _context5.next = 14;
17921
- return effects.put(updateChannelDataAC(channel.id, {
17922
- memberCount: channel.memberCount - removedMembers.length
17923
- }));
18023
+ return effects.call(updateActiveChannelMembersRemove, removedMembers) || {};
17924
18024
  case 14:
17925
- _context5.next = 18;
18025
+ updateChannelData = _context5.sent;
18026
+ _context5.next = 17;
18027
+ return effects.put(updateChannelDataAC(channel.id, _extends({
18028
+ memberCount: channel.memberCount - removedMembers.length
18029
+ }, updateChannelData)));
18030
+ case 17:
18031
+ _context5.next = 21;
17926
18032
  break;
17927
- case 16:
17928
- _context5.prev = 16;
18033
+ case 19:
18034
+ _context5.prev = 19;
17929
18035
  _context5.t0 = _context5["catch"](0);
17930
- case 18:
18036
+ case 21:
17931
18037
  case "end":
17932
18038
  return _context5.stop();
17933
18039
  }
17934
- }, _marked5$2, null, [[0, 16]]);
18040
+ }, _marked5$2, null, [[0, 19]]);
17935
18041
  }
17936
18042
  function changeMemberRole(action) {
17937
18043
  var payload, channelId, members, channel, updatedMembers;
@@ -18053,8 +18159,8 @@ function MembersSaga() {
18053
18159
  }, _marked9$2);
18054
18160
  }
18055
18161
 
18056
- var _marked$4 = /*#__PURE__*/_regeneratorRuntime().mark(getContacts),
18057
- _marked2$3 = /*#__PURE__*/_regeneratorRuntime().mark(blockUser),
18162
+ var _marked$5 = /*#__PURE__*/_regeneratorRuntime().mark(getContacts),
18163
+ _marked2$4 = /*#__PURE__*/_regeneratorRuntime().mark(blockUser),
18058
18164
  _marked3$3 = /*#__PURE__*/_regeneratorRuntime().mark(unblockUser),
18059
18165
  _marked4$3 = /*#__PURE__*/_regeneratorRuntime().mark(updateProfile),
18060
18166
  _marked5$3 = /*#__PURE__*/_regeneratorRuntime().mark(getUsers),
@@ -18087,7 +18193,7 @@ function getContacts() {
18087
18193
  case "end":
18088
18194
  return _context.stop();
18089
18195
  }
18090
- }, _marked$4, null, [[0, 11]]);
18196
+ }, _marked$5, null, [[0, 11]]);
18091
18197
  }
18092
18198
  function blockUser(action) {
18093
18199
  var SceytChatClient, payload, userIds, blockedUsers, activeChannelId, activeChannel, isDirectChannel, directChannelUser;
@@ -18149,7 +18255,7 @@ function blockUser(action) {
18149
18255
  case "end":
18150
18256
  return _context2.stop();
18151
18257
  }
18152
- }, _marked2$3, null, [[0, 21]]);
18258
+ }, _marked2$4, null, [[0, 21]]);
18153
18259
  }
18154
18260
  function unblockUser(action) {
18155
18261
  var SceytChatClient, payload, userIds, unblockedUsers, activeChannelId, activeChannel, isDirectChannel, directChannelUser;
@@ -18407,7 +18513,7 @@ function MembersSaga$1() {
18407
18513
  }, _marked7$3);
18408
18514
  }
18409
18515
 
18410
- var _marked$5 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga);
18516
+ var _marked$6 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga);
18411
18517
  function rootSaga() {
18412
18518
  return _regeneratorRuntime().wrap(function rootSaga$(_context) {
18413
18519
  while (1) switch (_context.prev = _context.next) {
@@ -18418,7 +18524,7 @@ function rootSaga() {
18418
18524
  case "end":
18419
18525
  return _context.stop();
18420
18526
  }
18421
- }, _marked$5);
18527
+ }, _marked$6);
18422
18528
  }
18423
18529
 
18424
18530
  var sagaMiddleware = createSagaMiddleware__default();
@@ -18893,9 +18999,10 @@ function useUpdatePresence(channel, isVisible) {
18893
18999
  }
18894
19000
  React.useEffect(function () {
18895
19001
  if (userId && isVisible && directChannelUser) {
19002
+ var _usersMap$userId, _usersMap$userId$pres;
18896
19003
  if (!usersMap[userId]) {
18897
19004
  setUserToMap(directChannelUser);
18898
- } else if (usersMap[userId].presence.state !== directChannelUser.presence.state) {
19005
+ } else if (((_usersMap$userId = usersMap[userId]) === null || _usersMap$userId === void 0 ? void 0 : (_usersMap$userId$pres = _usersMap$userId.presence) === null || _usersMap$userId$pres === void 0 ? void 0 : _usersMap$userId$pres.state) !== directChannelUser.presence.state) {
18899
19006
  var _updateUserStatusOnCh;
18900
19007
  updateUserOnMap(directChannelUser);
18901
19008
  dispatch(updateUserStatusOnChannelAC((_updateUserStatusOnCh = {}, _updateUserStatusOnCh[directChannelUser.id] = directChannelUser, _updateUserStatusOnCh)));
@@ -18911,7 +19018,8 @@ function useUpdatePresence(channel, isVisible) {
18911
19018
  }
18912
19019
  }, [connectionStatus]);
18913
19020
  React.useEffect(function () {
18914
- if (directChannelUser && usersMap[directChannelUser.id] && directChannelUser.presence && (directChannelUser.presence.state !== usersMap[directChannelUser.id].state || directChannelUser.presence.lastActiveAt && new Date(directChannelUser.presence.lastActiveAt).getTime() !== new Date(usersMap[directChannelUser.id].lastActiveAt).getTime())) {
19021
+ var _usersMap$directChann, _usersMap$directChann2;
19022
+ if (directChannelUser && usersMap[directChannelUser.id] && directChannelUser.presence && (directChannelUser.presence.state !== usersMap[directChannelUser.id].state || directChannelUser.presence.lastActiveAt && new Date(directChannelUser.presence.lastActiveAt).getTime() !== new Date(((_usersMap$directChann = usersMap[directChannelUser.id]) === null || _usersMap$directChann === void 0 ? void 0 : (_usersMap$directChann2 = _usersMap$directChann.presence) === null || _usersMap$directChann2 === void 0 ? void 0 : _usersMap$directChann2.lastActiveAt) || 0).getTime())) {
18915
19023
  var _updateUserStatusOnCh2;
18916
19024
  dispatch(updateUserStatusOnChannelAC((_updateUserStatusOnCh2 = {}, _updateUserStatusOnCh2[directChannelUser.id] = directChannelUser, _updateUserStatusOnCh2)));
18917
19025
  updateUserOnMap(directChannelUser);
@@ -21671,7 +21779,7 @@ var ChannelList = function ChannelList(_ref) {
21671
21779
  if (getSelectedChannel) {
21672
21780
  getSelectedChannel(activeChannel);
21673
21781
  }
21674
- }, [activeChannel]);
21782
+ }, [activeChannel && activeChannel.members && activeChannel.members.length]);
21675
21783
  useDidUpdate(function () {
21676
21784
  if (closeSearchChannels) {
21677
21785
  getMyChannels();
@@ -27753,7 +27861,8 @@ var Attachment = function Attachment(_ref) {
27753
27861
  borderColor: borderColor
27754
27862
  }, /*#__PURE__*/React__default.createElement(UploadPercent, {
27755
27863
  isRepliedMessage: isRepliedMessage,
27756
- isDetailsView: isDetailsView
27864
+ isDetailsView: isDetailsView,
27865
+ backgroundColor: overlayBackground2
27757
27866
  }, isInUploadingState ? (/*#__PURE__*/React__default.createElement(CancelResumeWrapper, {
27758
27867
  onClick: handlePauseResumeUpload
27759
27868
  }, attachmentCompilationState[attachment.tid] === UPLOAD_STATE.UPLOADING ? (/*#__PURE__*/React__default.createElement(SvgCancel, null)) : (/*#__PURE__*/React__default.createElement(SvgUpload, null)))) : !isCached && (/*#__PURE__*/React__default.createElement(CancelResumeWrapper, {
@@ -27767,7 +27876,7 @@ var Attachment = function Attachment(_ref) {
27767
27876
  text: '',
27768
27877
  styles: {
27769
27878
  background: {
27770
- fill: overlayBackground2
27879
+ fill: overlayBackground2 + "40"
27771
27880
  },
27772
27881
  path: {
27773
27882
  stroke: textOnPrimary,
@@ -27817,7 +27926,7 @@ var Attachment = function Attachment(_ref) {
27817
27926
  text: '',
27818
27927
  styles: {
27819
27928
  background: {
27820
- fill: overlayBackground2
27929
+ fill: overlayBackground2 + "40"
27821
27930
  },
27822
27931
  path: {
27823
27932
  stroke: textOnPrimary,
@@ -27912,7 +28021,7 @@ var Attachment = function Attachment(_ref) {
27912
28021
  fileAttachment: true,
27913
28022
  borderRadius: !(attachmentThumb || attachment.attachmentUrl && isPreview) ? '50%' : undefined,
27914
28023
  isDetailsView: isDetailsView,
27915
- backgroundColor: downloadingFile ? '' : attachment.attachmentUrl || attachmentThumb ? overlayBackground2 : accentColor
28024
+ backgroundColor: overlayBackground2
27916
28025
  }, (isInUploadingState || downloadingFile) && (/*#__PURE__*/React__default.createElement(CancelResumeWrapper, {
27917
28026
  onClick: handlePauseResumeUpload
27918
28027
  }, attachmentCompilationState[attachment.tid] === UPLOAD_STATE.UPLOADING || downloadingFile ? (/*#__PURE__*/React__default.createElement(SvgCancel, null)) : isInUploadingState && /*#__PURE__*/React__default.createElement(SvgUpload, null))), (attachmentCompilationState[attachment.tid] === UPLOAD_STATE.UPLOADING || downloadingFile) && (/*#__PURE__*/React__default.createElement(ProgressWrapper$1, null, /*#__PURE__*/React__default.createElement(reactCircularProgressbar.CircularProgressbar, {
@@ -27924,7 +28033,7 @@ var Attachment = function Attachment(_ref) {
27924
28033
  text: '',
27925
28034
  styles: {
27926
28035
  background: {
27927
- fill: 'transparent'
28036
+ fill: overlayBackground2 + "40"
27928
28037
  },
27929
28038
  path: {
27930
28039
  stroke: textOnPrimary,
@@ -36436,7 +36545,7 @@ var Members = function Members(_ref) {
36436
36545
  var handleMembersListScroll = function handleMembersListScroll(event) {
36437
36546
  if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100) {
36438
36547
  if (membersLoading === LOADING_STATE.LOADED) {
36439
- dispatch(loadMoreMembersAC(15));
36548
+ dispatch(loadMoreMembersAC(15, channel.id));
36440
36549
  }
36441
36550
  }
36442
36551
  };
@@ -36823,7 +36932,8 @@ var Files = function Files(_ref) {
36823
36932
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
36824
36933
  textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
36825
36934
  backgroundHovered = _useColor[THEME_COLORS.BACKGROUND_HOVERED],
36826
- surface1 = _useColor[THEME_COLORS.SURFACE_1];
36935
+ surface1 = _useColor[THEME_COLORS.SURFACE_1],
36936
+ overlayBackground2 = _useColor[THEME_COLORS.OVERLAY_BACKGROUND_2];
36827
36937
  var dispatch = reactRedux.useDispatch();
36828
36938
  var _useState = React.useState({}),
36829
36939
  downloadingFilesMap = _useState[0],
@@ -36907,7 +37017,7 @@ var Files = function Files(_ref) {
36907
37017
  text: '',
36908
37018
  styles: {
36909
37019
  background: {
36910
- fill: 'transparent'
37020
+ fill: overlayBackground2 + "40"
36911
37021
  },
36912
37022
  path: {
36913
37023
  stroke: accentColor,
@@ -37894,7 +38004,7 @@ var Details = function Details(_ref) {
37894
38004
  if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100) {
37895
38005
  if (activeTab === channelDetailsTabs.member) {
37896
38006
  if (membersLoading === LOADING_STATE.LOADED) {
37897
- dispatch(loadMoreMembersAC(15));
38007
+ dispatch(loadMoreMembersAC(15, activeChannel.id));
37898
38008
  }
37899
38009
  } else if (messagesLoading === LOADING_STATE.LOADED && attachmentsHasNex) {
37900
38010
  dispatch(loadMoreAttachmentsAC(20));