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

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.modern.js CHANGED
@@ -9033,6 +9033,7 @@ var showChannelDetails = false;
9033
9033
  var channelTypesFilter = [];
9034
9034
  var memberCount = 10;
9035
9035
  var disableFrowardMentionsCount = false;
9036
+ var onUpdateChannel = function onUpdateChannel() {};
9036
9037
  var useInviteLink = false;
9037
9038
  var inviteLinkOptions = null;
9038
9039
  function setBaseUrlForInviteMembers(url) {
@@ -9147,6 +9148,12 @@ function setDisableFrowardMentionsCount(disable) {
9147
9148
  function getDisableFrowardMentionsCount() {
9148
9149
  return disableFrowardMentionsCount;
9149
9150
  }
9151
+ function setOnUpdateChannel(callback) {
9152
+ onUpdateChannel = callback;
9153
+ }
9154
+ function getOnUpdateChannel() {
9155
+ return onUpdateChannel;
9156
+ }
9150
9157
  var handleNewMessages;
9151
9158
  function setHandleNewMessages(callback) {
9152
9159
  handleNewMessages = callback;
@@ -14520,7 +14527,7 @@ function watchForEvents() {
14520
14527
  };
14521
14528
  });
14522
14529
  _loop = /*#__PURE__*/_regenerator().m(function _callee() {
14523
- 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, activeChannelMessages, _iterator, _step, messageId, isPendingMessage, 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, _pollDetailsData$chan, _pollDetailsData$chan2, _channel1, pollDetails, _messageId, pollDetailsData, _activeChannelId0, addedVotes, deletedVotes, objs, _iterator2, _step2, vote, _iterator3, _step3, _vote, _i, _objs, obj, _store$getState$Messa, key, hasNext, _i2, _objs2, _obj, _pollDetailsData$chan3, _channel10, _pollDetails, _messageId2, _pollDetailsData, _activeChannelId1, _deletedVotes, _objs3, _iterator4, _step4, _vote2, _i3, _objs4, _obj2, _i4, _objs5, _obj3, _pollDetailsData2$cha, _channel11, _pollDetails2, _messageId3, _activeChannelId10, _pollDetailsData2, retractedVotes, _objs6, _iterator5, _step5, _vote4, _i5, _objs7, _obj4, _iterator6, _step6, _vote3, _channel12, _messageId4, _activeChannelId11, _obj5, _channel13, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId12, _channelUpdateParams, _channel14, _updatedChannel, _channel15, _activeChannelId13, channelExist, _channel16, _channel17, _channel18, _channel19, _channel20, _channel21, _channel22, _groupName5, _channel23, _groupName6, _channel24, members, _activeChannelId14, i, _channel25, _channel26, _channelId2, from, name, status, _t, _t2;
14530
+ 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, onUpdateChannel, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _channel5, fields, _activeChannelId4, _groupName3, _channel6, 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, _channel7, _activeChannelId6, updateLastMessage, markersMap, activeChannelMessages, _iterator, _step, messageId, isPendingMessage, lastMessage, _channelId, _channel8, _channel9, deletedMessage, _activeChannelId7, _channelExists7, _channel0, _message, _activeChannelId8, _channelExists8, _channel1, 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, _pollDetailsData$chan, _pollDetailsData$chan2, _channel10, pollDetails, _messageId, pollDetailsData, _activeChannelId0, addedVotes, deletedVotes, objs, _iterator2, _step2, vote, _iterator3, _step3, _vote, _i, _objs, obj, _store$getState$Messa, key, hasNext, _i2, _objs2, _obj, _pollDetailsData$chan3, _channel11, _pollDetails, _messageId2, _pollDetailsData, _activeChannelId1, _deletedVotes, _objs3, _iterator4, _step4, _vote2, _i3, _objs4, _obj2, _i4, _objs5, _obj3, _pollDetailsData2$cha, _channel12, _pollDetails2, _messageId3, _activeChannelId10, _pollDetailsData2, retractedVotes, _objs6, _iterator5, _step5, _vote4, _i5, _objs7, _obj4, _iterator6, _step6, _vote3, _channel13, _messageId4, _activeChannelId11, _obj5, _channel14, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId12, _channelUpdateParams, _channel15, _updatedChannel, _channel16, _activeChannelId13, channelExist, _channel17, _channel18, _channel19, _channel20, _channel21, _channel22, _channel23, _groupName5, _channel24, _groupName6, _channel25, members, _activeChannelId14, i, _channel26, _channel27, _channelId2, from, name, status, _t, _t2;
14524
14531
  return _regenerator().w(function (_context) {
14525
14532
  while (1) switch (_context.p = _context.n) {
14526
14533
  case 0:
@@ -14787,10 +14794,33 @@ function watchForEvents() {
14787
14794
  });
14788
14795
  return _context.a(3, 183);
14789
14796
  case 46:
14797
+ onUpdateChannel = getOnUpdateChannel();
14790
14798
  log.info('channel UPDATE_CHANNEL ... ');
14791
14799
  updatedChannel = args.updatedChannel;
14792
14800
  _channelExists5 = checkChannelExists(updatedChannel.id);
14793
14801
  subject = updatedChannel.subject, avatarUrl = updatedChannel.avatarUrl, muted = updatedChannel.muted, mutedTill = updatedChannel.mutedTill, metadata = updatedChannel.metadata;
14802
+ _channel5 = getChannelFromMap(updatedChannel.id);
14803
+ fields = [];
14804
+ if (_channel5) {
14805
+ if (_channel5.subject !== subject) {
14806
+ fields.push('subject');
14807
+ }
14808
+ if (_channel5.avatarUrl !== avatarUrl) {
14809
+ fields.push('avatarUrl');
14810
+ }
14811
+ if (_channel5.muted !== muted) {
14812
+ fields.push('muted');
14813
+ }
14814
+ if (_channel5.mutedTill !== mutedTill) {
14815
+ fields.push('mutedTill');
14816
+ }
14817
+ if (_channel5.metadata !== isJSON(metadata) ? JSON.parse(metadata) : metadata) {
14818
+ fields.push('metadata');
14819
+ }
14820
+ }
14821
+ if (onUpdateChannel) {
14822
+ onUpdateChannel(updatedChannel, fields);
14823
+ }
14794
14824
  if (!_channelExists5) {
14795
14825
  _context.n = 49;
14796
14826
  break;
@@ -14834,18 +14864,18 @@ function watchForEvents() {
14834
14864
  });
14835
14865
  return _context.a(3, 183);
14836
14866
  case 51:
14837
- _channel5 = args.channel, message = args.message;
14838
- log.info('channel MESSAGE ... id : ', message.id, ', channel.id: ', _channel5.id);
14839
- messageToHandle = handleNewMessages ? handleNewMessages(message, _channel5) : message;
14867
+ _channel6 = args.channel, message = args.message;
14868
+ log.info('channel MESSAGE ... id : ', message.id, ', channel.id: ', _channel6.id);
14869
+ messageToHandle = handleNewMessages ? handleNewMessages(message, _channel6) : message;
14840
14870
  _channelFilterTypes = getChannelTypesFilter();
14841
- if (!(messageToHandle && _channel5 && (_channelFilterTypes !== null && _channelFilterTypes !== void 0 && _channelFilterTypes.length ? _channelFilterTypes.includes(_channel5.type) : true))) {
14871
+ if (!(messageToHandle && _channel6 && (_channelFilterTypes !== null && _channelFilterTypes !== void 0 && _channelFilterTypes.length ? _channelFilterTypes.includes(_channel6.type) : true))) {
14842
14872
  _context.n = 65;
14843
14873
  break;
14844
14874
  }
14845
- _channel5.metadata = isJSON(_channel5.metadata) ? JSON.parse(_channel5.metadata) : _channel5.metadata;
14875
+ _channel6.metadata = isJSON(_channel6.metadata) ? JSON.parse(_channel6.metadata) : _channel6.metadata;
14846
14876
  _activeChannelId5 = getActiveChannelId();
14847
- _channelExists6 = checkChannelExists(_channel5.id);
14848
- channelForAdd = JSON.parse(JSON.stringify(_channel5));
14877
+ _channelExists6 = checkChannelExists(_channel6.id);
14878
+ channelForAdd = JSON.parse(JSON.stringify(_channel6));
14849
14879
  _context.n = 52;
14850
14880
  return put(addChannelAC(channelForAdd));
14851
14881
  case 52:
@@ -14853,7 +14883,7 @@ function watchForEvents() {
14853
14883
  _context.n = 53;
14854
14884
  break;
14855
14885
  }
14856
- setChannelInMap(_channel5);
14886
+ setChannelInMap(_channel6);
14857
14887
  _context.n = 54;
14858
14888
  break;
14859
14889
  case 53:
@@ -14864,7 +14894,7 @@ function watchForEvents() {
14864
14894
  _context.n = 54;
14865
14895
  return put(updateChannelLastMessageAC(message, channelForAdd));
14866
14896
  case 54:
14867
- if (!(_channel5.id === _activeChannelId5)) {
14897
+ if (!(_channel6.id === _activeChannelId5)) {
14868
14898
  _context.n = 56;
14869
14899
  break;
14870
14900
  }
@@ -14884,9 +14914,9 @@ function watchForEvents() {
14884
14914
  _context.n = 56;
14885
14915
  return put(scrollToNewMessageAC(true, false, true));
14886
14916
  case 56:
14887
- addMessageToMap(_channel5.id, message);
14917
+ addMessageToMap(_channel6.id, message);
14888
14918
  _context.n = 57;
14889
- return put(updateChannelDataAC(_channel5.id, {
14919
+ return put(updateChannelDataAC(_channel6.id, {
14890
14920
  messageCount: channelForAdd.messageCount,
14891
14921
  unread: channelForAdd.unread,
14892
14922
  newMessageCount: channelForAdd.newMessageCount,
@@ -14902,9 +14932,9 @@ function watchForEvents() {
14902
14932
  lastReactedMessage: null
14903
14933
  }));
14904
14934
  case 57:
14905
- _groupName4 = getChannelGroupName(_channel5);
14935
+ _groupName4 = getChannelGroupName(_channel6);
14906
14936
  _context.n = 58;
14907
- return put(updateSearchedChannelDataAC(_channel5.id, {
14937
+ return put(updateSearchedChannelDataAC(_channel6.id, {
14908
14938
  messageCount: channelForAdd.messageCount,
14909
14939
  unread: channelForAdd.unread,
14910
14940
  newMessageCount: channelForAdd.newMessageCount,
@@ -14921,7 +14951,7 @@ function watchForEvents() {
14921
14951
  }, _groupName4));
14922
14952
  case 58:
14923
14953
  showNotifications = getShowNotifications();
14924
- if (!(showNotifications && !message.silent && message.user.id !== SceytChatClient.user.id && !_channel5.muted)) {
14954
+ if (!(showNotifications && !message.silent && message.user.id !== SceytChatClient.user.id && !_channel6.muted)) {
14925
14955
  _context.n = 61;
14926
14956
  break;
14927
14957
  }
@@ -14933,7 +14963,7 @@ function watchForEvents() {
14933
14963
  return select(browserTabIsActiveSelector);
14934
14964
  case 59:
14935
14965
  tabIsActive = _context.v;
14936
- if (!(document.visibilityState !== 'visible' || !tabIsActive || _channel5.id !== _activeChannelId5)) {
14966
+ if (!(document.visibilityState !== 'visible' || !tabIsActive || _channel6.id !== _activeChannelId5)) {
14937
14967
  _context.n = 61;
14938
14968
  break;
14939
14969
  }
@@ -14956,7 +14986,7 @@ function watchForEvents() {
14956
14986
  accentColor: accentColor,
14957
14987
  textSecondary: textSecondary
14958
14988
  });
14959
- setNotification(messageBody, message.user, _channel5, undefined, message.attachments && message.attachments.length ? message.attachments.find(function (att) {
14989
+ setNotification(messageBody, message.user, _channel6, undefined, message.attachments && message.attachments.length ? message.attachments.find(function (att) {
14960
14990
  return att.type !== attachmentTypes.link;
14961
14991
  }) : undefined);
14962
14992
  case 61:
@@ -14971,9 +15001,9 @@ function watchForEvents() {
14971
15001
  break;
14972
15002
  case 63:
14973
15003
  _context.n = 64;
14974
- return put(markMessagesAsDeliveredAC(_channel5.id, [message.id]));
15004
+ return put(markMessagesAsDeliveredAC(_channel6.id, [message.id]));
14975
15005
  case 64:
14976
- updateChannelOnAllChannels(_channel5.id, {
15006
+ updateChannelOnAllChannels(_channel6.id, {
14977
15007
  messageCount: channelForAdd.messageCount,
14978
15008
  unread: channelForAdd.unread,
14979
15009
  newMessageCount: channelForAdd.newMessageCount,
@@ -14985,10 +15015,10 @@ function watchForEvents() {
14985
15015
  lastMessage: channelForAdd.lastMessage,
14986
15016
  messages: channelForAdd.messages,
14987
15017
  newReactions: channelForAdd.newReactions,
14988
- lastReactedMessage: _channel5.lastReactedMessage,
14989
- userMessageReactions: _channel5.userMessageReactions
15018
+ lastReactedMessage: _channel6.lastReactedMessage,
15019
+ userMessageReactions: _channel6.userMessageReactions
14990
15020
  });
14991
- updateChannelLastMessageOnAllChannels(_channel5.id, _channel5.lastMessage);
15021
+ updateChannelLastMessageOnAllChannels(_channel6.id, _channel6.lastMessage);
14992
15022
  case 65:
14993
15023
  return _context.a(3, 183);
14994
15024
  case 66:
@@ -14996,9 +15026,9 @@ function watchForEvents() {
14996
15026
  _context.n = 67;
14997
15027
  return call(getChannelFromMap, channelId);
14998
15028
  case 67:
14999
- _channel6 = _context.v;
15000
- log.info('channel MESSAGE_MARKERS_RECEIVED ... channel: ', _channel6, 'markers list: ', markerList);
15001
- if (!_channel6) {
15029
+ _channel7 = _context.v;
15030
+ log.info('channel MESSAGE_MARKERS_RECEIVED ... channel: ', _channel7, 'markers list: ', markerList);
15031
+ if (!_channel7) {
15002
15032
  _context.n = 78;
15003
15033
  break;
15004
15034
  }
@@ -15034,8 +15064,8 @@ function watchForEvents() {
15034
15064
  }
15035
15065
  case 72:
15036
15066
  markersMap[messageId] = true;
15037
- if (_channel6) {
15038
- if (_channel6.lastMessage && messageId === _channel6.lastMessage.id) {
15067
+ if (_channel7) {
15068
+ if (_channel7.lastMessage && messageId === _channel7.lastMessage.id) {
15039
15069
  updateLastMessage = true;
15040
15070
  }
15041
15071
  }
@@ -15051,10 +15081,10 @@ function watchForEvents() {
15051
15081
  _context.n = 75;
15052
15082
  break;
15053
15083
  }
15054
- lastMessage = _extends({}, _channel6.lastMessage, updateMessageDeliveryStatusAndMarkers(_channel6.lastMessage, markerList.name));
15055
- updateChannelLastMessageOnAllChannels(_channel6.id, lastMessage);
15084
+ lastMessage = _extends({}, _channel7.lastMessage, updateMessageDeliveryStatusAndMarkers(_channel7.lastMessage, markerList.name));
15085
+ updateChannelLastMessageOnAllChannels(_channel7.id, lastMessage);
15056
15086
  _context.n = 75;
15057
- return put(updateChannelLastMessageStatusAC(lastMessage, _channel6));
15087
+ return put(updateChannelLastMessageStatusAC(lastMessage, _channel7));
15058
15088
  case 75:
15059
15089
  if (!(_activeChannelId6 === channelId)) {
15060
15090
  _context.n = 77;
@@ -15065,7 +15095,7 @@ function watchForEvents() {
15065
15095
  case 76:
15066
15096
  updateMarkersOnAllMessages(markersMap, markerList.name);
15067
15097
  case 77:
15068
- updateMessageStatusOnMap(_channel6.id, {
15098
+ updateMessageStatusOnMap(_channel7.id, {
15069
15099
  name: markerList.name,
15070
15100
  markersMap: markersMap
15071
15101
  });
@@ -15077,21 +15107,21 @@ function watchForEvents() {
15077
15107
  case 79:
15078
15108
  _channelId = args.channelId;
15079
15109
  log.info('channel DELETE ... ');
15080
- _channel7 = getChannelFromMap(_channelId);
15110
+ _channel8 = getChannelFromMap(_channelId);
15081
15111
  _context.n = 80;
15082
- return put(setChannelToRemoveAC(_channel7));
15112
+ return put(setChannelToRemoveAC(_channel8));
15083
15113
  case 80:
15084
15114
  deleteChannelFromAllChannels(_channelId);
15085
15115
  return _context.a(3, 183);
15086
15116
  case 81:
15087
- _channel8 = args.channel, deletedMessage = args.deletedMessage;
15117
+ _channel9 = args.channel, deletedMessage = args.deletedMessage;
15088
15118
  _context.n = 82;
15089
15119
  return call(getActiveChannelId);
15090
15120
  case 82:
15091
15121
  _activeChannelId7 = _context.v;
15092
15122
  log.info('channel DELETE_MESSAGE ... ');
15093
- _channelExists7 = checkChannelExists(_channel8.id);
15094
- if (!(_channel8.id === _activeChannelId7)) {
15123
+ _channelExists7 = checkChannelExists(_channel9.id);
15124
+ if (!(_channel9.id === _activeChannelId7)) {
15095
15125
  _context.n = 83;
15096
15126
  break;
15097
15127
  }
@@ -15099,7 +15129,7 @@ function watchForEvents() {
15099
15129
  _context.n = 83;
15100
15130
  return put(updateMessageAC(deletedMessage.id, deletedMessage));
15101
15131
  case 83:
15102
- updateMessageOnMap(_channel8.id, {
15132
+ updateMessageOnMap(_channel9.id, {
15103
15133
  messageId: deletedMessage.id,
15104
15134
  params: deletedMessage
15105
15135
  });
@@ -15108,33 +15138,33 @@ function watchForEvents() {
15108
15138
  break;
15109
15139
  }
15110
15140
  _context.n = 84;
15111
- return put(updateChannelDataAC(_channel8.id, {
15112
- newMessageCount: _channel8.newMessageCount,
15113
- muted: _channel8.muted,
15114
- mutedTill: _channel8.mutedTill
15141
+ return put(updateChannelDataAC(_channel9.id, {
15142
+ newMessageCount: _channel9.newMessageCount,
15143
+ muted: _channel9.muted,
15144
+ mutedTill: _channel9.mutedTill
15115
15145
  }));
15116
15146
  case 84:
15117
- if (!(_channel8.lastMessage.id === deletedMessage.id)) {
15147
+ if (!(_channel9.lastMessage.id === deletedMessage.id)) {
15118
15148
  _context.n = 85;
15119
15149
  break;
15120
15150
  }
15121
15151
  _context.n = 85;
15122
- return put(updateChannelLastMessageAC(deletedMessage, _channel8));
15152
+ return put(updateChannelLastMessageAC(deletedMessage, _channel9));
15123
15153
  case 85:
15124
- updateChannelOnAllChannels(_channel8.id, {
15125
- newMessageCount: _channel8.newMessageCount,
15126
- muted: _channel8.muted,
15127
- mutedTill: _channel8.mutedTill
15154
+ updateChannelOnAllChannels(_channel9.id, {
15155
+ newMessageCount: _channel9.newMessageCount,
15156
+ muted: _channel9.muted,
15157
+ mutedTill: _channel9.mutedTill
15128
15158
  }, deletedMessage);
15129
15159
  return _context.a(3, 183);
15130
15160
  case 86:
15131
- _channel9 = args.channel, _message = args.message;
15161
+ _channel0 = args.channel, _message = args.message;
15132
15162
  _context.n = 87;
15133
15163
  return call(getActiveChannelId);
15134
15164
  case 87:
15135
15165
  _activeChannelId8 = _context.v;
15136
- _channelExists8 = checkChannelExists(_channel9.id);
15137
- if (!(_channel9.id === _activeChannelId8)) {
15166
+ _channelExists8 = checkChannelExists(_channel0.id);
15167
+ if (!(_channel0.id === _activeChannelId8)) {
15138
15168
  _context.n = 89;
15139
15169
  break;
15140
15170
  }
@@ -15161,29 +15191,29 @@ function watchForEvents() {
15161
15191
  _context.n = 90;
15162
15192
  break;
15163
15193
  }
15164
- if (!(_channel9.lastMessage.id === _message.id)) {
15194
+ if (!(_channel0.lastMessage.id === _message.id)) {
15165
15195
  _context.n = 90;
15166
15196
  break;
15167
15197
  }
15168
15198
  _context.n = 90;
15169
- return put(updateChannelLastMessageAC(_message, _channel9));
15199
+ return put(updateChannelLastMessageAC(_message, _channel0));
15170
15200
  case 90:
15171
- if (checkChannelExistsOnMessagesMap(_channel9.id)) {
15172
- updateMessageOnMap(_channel9.id, {
15201
+ if (checkChannelExistsOnMessagesMap(_channel0.id)) {
15202
+ updateMessageOnMap(_channel0.id, {
15173
15203
  messageId: _message.id,
15174
15204
  params: _message
15175
15205
  });
15176
15206
  }
15177
- updateChannelOnAllChannels(_channel9.id, {}, _message);
15207
+ updateChannelOnAllChannels(_channel0.id, {}, _message);
15178
15208
  return _context.a(3, 183);
15179
15209
  case 91:
15180
- _channel0 = args.channel, user = args.user, _message2 = args.message, reaction = args.reaction;
15210
+ _channel1 = args.channel, user = args.user, _message2 = args.message, reaction = args.reaction;
15181
15211
  isSelf = user.id === SceytChatClient.user.id;
15182
15212
  _context.n = 92;
15183
15213
  return call(getActiveChannelId);
15184
15214
  case 92:
15185
15215
  _activeChannelId9 = _context.v;
15186
- if (!(_channel0.id === _activeChannelId9)) {
15216
+ if (!(_channel1.id === _activeChannelId9)) {
15187
15217
  _context.n = 94;
15188
15218
  break;
15189
15219
  }
@@ -15200,7 +15230,7 @@ function watchForEvents() {
15200
15230
  _context.n = 96;
15201
15231
  break;
15202
15232
  }
15203
- if (!(document.visibilityState !== 'visible' || _channel0.id !== _activeChannelId9)) {
15233
+ if (!(document.visibilityState !== 'visible' || _channel1.id !== _activeChannelId9)) {
15204
15234
  _context.n = 96;
15205
15235
  break;
15206
15236
  }
@@ -15223,38 +15253,38 @@ function watchForEvents() {
15223
15253
  accentColor: _accentColor,
15224
15254
  textSecondary: _textSecondary
15225
15255
  });
15226
- setNotification(_messageBody, reaction.user, _channel0, reaction.key, _message2.attachments && _message2.attachments.length ? _message2.attachments.find(function (att) {
15256
+ setNotification(_messageBody, reaction.user, _channel1, reaction.key, _message2.attachments && _message2.attachments.length ? _message2.attachments.find(function (att) {
15227
15257
  return att.type !== attachmentTypes.link;
15228
15258
  }) : undefined);
15229
15259
  case 96:
15230
- if (!(_channel0.newReactions && _channel0.newReactions.length)) {
15260
+ if (!(_channel1.newReactions && _channel1.newReactions.length)) {
15231
15261
  _context.n = 97;
15232
15262
  break;
15233
15263
  }
15234
15264
  channelUpdateParams = {
15235
- userMessageReactions: _channel0.newReactions,
15265
+ userMessageReactions: _channel1.newReactions,
15236
15266
  lastReactedMessage: _message2,
15237
- newReactions: _channel0.newReactions,
15238
- muted: _channel0.muted,
15239
- mutedTill: _channel0.mutedTill
15267
+ newReactions: _channel1.newReactions,
15268
+ muted: _channel1.muted,
15269
+ mutedTill: _channel1.mutedTill
15240
15270
  };
15241
15271
  _context.n = 97;
15242
- return put(updateChannelDataAC(_channel0.id, channelUpdateParams));
15272
+ return put(updateChannelDataAC(_channel1.id, channelUpdateParams));
15243
15273
  case 97:
15244
- updateChannelOnAllChannels(_channel0.id, {
15245
- userMessageReactions: _channel0.newReactions,
15274
+ updateChannelOnAllChannels(_channel1.id, {
15275
+ userMessageReactions: _channel1.newReactions,
15246
15276
  lastReactedMessage: _message2,
15247
- newReactions: _channel0.newReactions,
15248
- muted: _channel0.muted,
15249
- mutedTill: _channel0.mutedTill
15277
+ newReactions: _channel1.newReactions,
15278
+ muted: _channel1.muted,
15279
+ mutedTill: _channel1.mutedTill
15250
15280
  });
15251
15281
  case 98:
15252
- if (checkChannelExistsOnMessagesMap(_channel0.id)) {
15253
- addReactionToMessageOnMap(_channel0.id, _message2, reaction, true);
15282
+ if (checkChannelExistsOnMessagesMap(_channel1.id)) {
15283
+ addReactionToMessageOnMap(_channel1.id, _message2, reaction, true);
15254
15284
  }
15255
15285
  return _context.a(3, 183);
15256
15286
  case 99:
15257
- _channel1 = args.channel, pollDetails = args.pollDetails, _messageId = args.messageId;
15287
+ _channel10 = args.channel, pollDetails = args.pollDetails, _messageId = args.messageId;
15258
15288
  pollDetailsData = pollDetails;
15259
15289
  _context.n = 100;
15260
15290
  return call(getActiveChannelId);
@@ -15316,7 +15346,7 @@ function watchForEvents() {
15316
15346
  break;
15317
15347
  }
15318
15348
  _obj = _objs2[_i2];
15319
- updateMessageOnMap(_channel1.id, {
15349
+ updateMessageOnMap(_channel10.id, {
15320
15350
  messageId: _messageId,
15321
15351
  params: {}
15322
15352
  }, {
@@ -15324,7 +15354,7 @@ function watchForEvents() {
15324
15354
  vote: _obj.vote,
15325
15355
  incrementVotesPerOptionCount: _obj.incrementVotesPerOptionCount
15326
15356
  });
15327
- if (!(_channel1.id === _activeChannelId0)) {
15357
+ if (!(_channel10.id === _activeChannelId0)) {
15328
15358
  _context.n = 107;
15329
15359
  break;
15330
15360
  }
@@ -15338,7 +15368,7 @@ function watchForEvents() {
15338
15368
  case 108:
15339
15369
  return _context.a(3, 183);
15340
15370
  case 109:
15341
- _channel10 = args.channel, _pollDetails = args.pollDetails, _messageId2 = args.messageId;
15371
+ _channel11 = args.channel, _pollDetails = args.pollDetails, _messageId2 = args.messageId;
15342
15372
  _pollDetailsData = _pollDetails;
15343
15373
  _context.n = 110;
15344
15374
  return call(getActiveChannelId);
@@ -15379,11 +15409,11 @@ function watchForEvents() {
15379
15409
  break;
15380
15410
  }
15381
15411
  _obj3 = _objs5[_i4];
15382
- updateMessageOnMap(_channel10.id, {
15412
+ updateMessageOnMap(_channel11.id, {
15383
15413
  messageId: _messageId2,
15384
15414
  params: {}
15385
15415
  }, _obj3);
15386
- if (!(_channel10.id === _activeChannelId1)) {
15416
+ if (!(_channel11.id === _activeChannelId1)) {
15387
15417
  _context.n = 115;
15388
15418
  break;
15389
15419
  }
@@ -15397,7 +15427,7 @@ function watchForEvents() {
15397
15427
  case 116:
15398
15428
  return _context.a(3, 183);
15399
15429
  case 117:
15400
- _channel11 = args.channel, _pollDetails2 = args.pollDetails, _messageId3 = args.messageId;
15430
+ _channel12 = args.channel, _pollDetails2 = args.pollDetails, _messageId3 = args.messageId;
15401
15431
  _context.n = 118;
15402
15432
  return call(getActiveChannelId);
15403
15433
  case 118:
@@ -15420,7 +15450,7 @@ function watchForEvents() {
15420
15450
  break;
15421
15451
  }
15422
15452
  _obj4 = _objs7[_i5];
15423
- updateMessageOnMap(_channel11.id, {
15453
+ updateMessageOnMap(_channel12.id, {
15424
15454
  messageId: _messageId3,
15425
15455
  params: {}
15426
15456
  }, _obj4);
@@ -15441,7 +15471,7 @@ function watchForEvents() {
15441
15471
  _context.n = 120;
15442
15472
  break;
15443
15473
  case 122:
15444
- if (!(_channel11.id === _activeChannelId10)) {
15474
+ if (!(_channel12.id === _activeChannelId10)) {
15445
15475
  _context.n = 123;
15446
15476
  break;
15447
15477
  }
@@ -15455,7 +15485,7 @@ function watchForEvents() {
15455
15485
  case 124:
15456
15486
  return _context.a(3, 183);
15457
15487
  case 125:
15458
- _channel12 = args.channel, _messageId4 = args.messageId;
15488
+ _channel13 = args.channel, _messageId4 = args.messageId;
15459
15489
  _context.n = 126;
15460
15490
  return call(getActiveChannelId);
15461
15491
  case 126:
@@ -15464,11 +15494,11 @@ function watchForEvents() {
15464
15494
  type: 'close',
15465
15495
  incrementVotesPerOptionCount: 0
15466
15496
  };
15467
- updateMessageOnMap(_channel12.id, {
15497
+ updateMessageOnMap(_channel13.id, {
15468
15498
  messageId: _messageId4,
15469
15499
  params: {}
15470
15500
  }, _obj5);
15471
- if (!(_channel12.id === _activeChannelId11)) {
15501
+ if (!(_channel13.id === _activeChannelId11)) {
15472
15502
  _context.n = 128;
15473
15503
  break;
15474
15504
  }
@@ -15480,15 +15510,15 @@ function watchForEvents() {
15480
15510
  case 128:
15481
15511
  return _context.a(3, 183);
15482
15512
  case 129:
15483
- _channel13 = args.channel, _user = args.user, _message3 = args.message, _reaction = args.reaction;
15484
- log.info('channel REACTION_DELETED ... ', _channel13);
15485
- channelFromMap = getChannelFromMap(_channel13.id);
15513
+ _channel14 = args.channel, _user = args.user, _message3 = args.message, _reaction = args.reaction;
15514
+ log.info('channel REACTION_DELETED ... ', _channel14);
15515
+ channelFromMap = getChannelFromMap(_channel14.id);
15486
15516
  _isSelf = _user.id === SceytChatClient.user.id;
15487
15517
  _context.n = 130;
15488
15518
  return call(getActiveChannelId);
15489
15519
  case 130:
15490
15520
  _activeChannelId12 = _context.v;
15491
- if (!(_channel13.id === _activeChannelId12)) {
15521
+ if (!(_channel14.id === _activeChannelId12)) {
15492
15522
  _context.n = 132;
15493
15523
  break;
15494
15524
  }
@@ -15497,54 +15527,54 @@ function watchForEvents() {
15497
15527
  case 131:
15498
15528
  removeReactionOnAllMessages(_message3, _reaction, true);
15499
15529
  case 132:
15500
- _channelUpdateParams = JSON.parse(JSON.stringify(_channel13));
15530
+ _channelUpdateParams = JSON.parse(JSON.stringify(_channel14));
15501
15531
  if (channelFromMap && channelFromMap.lastReactedMessage && channelFromMap.lastReactedMessage.id === _message3.id) {
15502
15532
  _channelUpdateParams.lastReactedMessage = null;
15503
15533
  }
15504
15534
  _context.n = 133;
15505
- return put(updateChannelDataAC(_channel13.id, _channelUpdateParams));
15535
+ return put(updateChannelDataAC(_channel14.id, _channelUpdateParams));
15506
15536
  case 133:
15507
- updateChannelOnAllChannels(_channel13.id, _channelUpdateParams);
15508
- if (checkChannelExistsOnMessagesMap(_channel13.id)) {
15509
- removeReactionToMessageOnMap(_channel13.id, _message3, _reaction, true);
15537
+ updateChannelOnAllChannels(_channel14.id, _channelUpdateParams);
15538
+ if (checkChannelExistsOnMessagesMap(_channel14.id)) {
15539
+ removeReactionToMessageOnMap(_channel14.id, _message3, _reaction, true);
15510
15540
  }
15511
15541
  return _context.a(3, 183);
15512
15542
  case 134:
15513
- _channel14 = args.channel;
15514
- if (!_channel14) {
15543
+ _channel15 = args.channel;
15544
+ if (!_channel15) {
15515
15545
  _context.n = 136;
15516
15546
  break;
15517
15547
  }
15518
- _updatedChannel = JSON.parse(JSON.stringify(_channel14));
15548
+ _updatedChannel = JSON.parse(JSON.stringify(_channel15));
15519
15549
  _context.n = 135;
15520
- return put(updateChannelDataAC(_channel14.id, {
15521
- lastMessage: _channel14.lastMessage,
15522
- newMessageCount: _channel14.newMessageCount,
15523
- newMentionCount: _channel14.newMentionCount,
15524
- unread: _channel14.unread,
15525
- newReactedMessageCount: _channel14.newReactedMessageCount,
15526
- newReactions: _channel14.newReactions,
15527
- lastReactedMessage: _channel14.lastReactedMessage,
15528
- lastReceivedMsgId: _channel14.lastReceivedMsgId,
15529
- lastDisplayedMessageId: _channel14.lastDisplayedMessageId,
15530
- messageRetentionPeriod: _channel14.messageRetentionPeriod
15550
+ return put(updateChannelDataAC(_channel15.id, {
15551
+ lastMessage: _channel15.lastMessage,
15552
+ newMessageCount: _channel15.newMessageCount,
15553
+ newMentionCount: _channel15.newMentionCount,
15554
+ unread: _channel15.unread,
15555
+ newReactedMessageCount: _channel15.newReactedMessageCount,
15556
+ newReactions: _channel15.newReactions,
15557
+ lastReactedMessage: _channel15.lastReactedMessage,
15558
+ lastReceivedMsgId: _channel15.lastReceivedMsgId,
15559
+ lastDisplayedMessageId: _channel15.lastDisplayedMessageId,
15560
+ messageRetentionPeriod: _channel15.messageRetentionPeriod
15531
15561
  }));
15532
15562
  case 135:
15533
- updateChannelOnAllChannels(_channel14.id, _updatedChannel);
15563
+ updateChannelOnAllChannels(_channel15.id, _updatedChannel);
15534
15564
  case 136:
15535
15565
  return _context.a(3, 183);
15536
15566
  case 137:
15537
- _channel15 = args.channel;
15538
- log.info('CLEAR_HISTORY: ', _channel15);
15567
+ _channel16 = args.channel;
15568
+ log.info('CLEAR_HISTORY: ', _channel16);
15539
15569
  _context.n = 138;
15540
15570
  return call(getActiveChannelId);
15541
15571
  case 138:
15542
15572
  _activeChannelId13 = _context.v;
15543
15573
  _context.n = 139;
15544
- return call(checkChannelExists, _channel15.id);
15574
+ return call(checkChannelExists, _channel16.id);
15545
15575
  case 139:
15546
15576
  channelExist = _context.v;
15547
- if (!(_channel15.id === _activeChannelId13)) {
15577
+ if (!(_channel16.id === _activeChannelId13)) {
15548
15578
  _context.n = 141;
15549
15579
  break;
15550
15580
  }
@@ -15553,141 +15583,141 @@ function watchForEvents() {
15553
15583
  case 140:
15554
15584
  removeAllMessages();
15555
15585
  case 141:
15556
- removeMessagesFromMap(_channel15.id);
15586
+ removeMessagesFromMap(_channel16.id);
15557
15587
  if (!channelExist) {
15558
15588
  _context.n = 142;
15559
15589
  break;
15560
15590
  }
15561
15591
  _context.n = 142;
15562
- return put(updateChannelDataAC(_channel15.id, {
15592
+ return put(updateChannelDataAC(_channel16.id, {
15563
15593
  lastMessage: null,
15564
15594
  newMessageCount: 0,
15565
15595
  newMentionCount: 0,
15566
- muted: _channel15.muted,
15567
- mutedTill: _channel15.mutedTill
15596
+ muted: _channel16.muted,
15597
+ mutedTill: _channel16.mutedTill
15568
15598
  }));
15569
15599
  case 142:
15570
- updateChannelOnAllChannels(_channel15.id, {
15600
+ updateChannelOnAllChannels(_channel16.id, {
15571
15601
  lastMessage: null,
15572
15602
  newMessageCount: 0,
15573
15603
  newMentionCount: 0,
15574
- muted: _channel15.muted,
15575
- mutedTill: _channel15.mutedTill
15604
+ muted: _channel16.muted,
15605
+ mutedTill: _channel16.mutedTill
15576
15606
  });
15577
15607
  return _context.a(3, 183);
15578
15608
  case 143:
15579
- _channel16 = args.channel;
15609
+ _channel17 = args.channel;
15580
15610
  log.info('channel MUTE ... ');
15581
15611
  _context.n = 144;
15582
- return put(updateChannelDataAC(_channel16.id, {
15583
- muted: _channel16.muted,
15584
- mutedTill: _channel16.mutedTill
15612
+ return put(updateChannelDataAC(_channel17.id, {
15613
+ muted: _channel17.muted,
15614
+ mutedTill: _channel17.mutedTill
15585
15615
  }));
15586
15616
  case 144:
15587
- updateChannelOnAllChannels(_channel16.id, {
15588
- muted: _channel16.muted,
15589
- mutedTill: _channel16.mutedTill
15617
+ updateChannelOnAllChannels(_channel17.id, {
15618
+ muted: _channel17.muted,
15619
+ mutedTill: _channel17.mutedTill
15590
15620
  });
15591
15621
  return _context.a(3, 183);
15592
15622
  case 145:
15593
- _channel17 = args.channel;
15623
+ _channel18 = args.channel;
15594
15624
  log.info('channel UNMUTE ... ');
15595
15625
  _context.n = 146;
15596
- return put(updateChannelDataAC(_channel17.id, {
15597
- muted: _channel17.muted,
15598
- mutedTill: _channel17.mutedTill
15626
+ return put(updateChannelDataAC(_channel18.id, {
15627
+ muted: _channel18.muted,
15628
+ mutedTill: _channel18.mutedTill
15599
15629
  }));
15600
15630
  case 146:
15601
- updateChannelOnAllChannels(_channel17.id, {
15602
- muted: _channel17.muted,
15603
- mutedTill: _channel17.mutedTill
15631
+ updateChannelOnAllChannels(_channel18.id, {
15632
+ muted: _channel18.muted,
15633
+ mutedTill: _channel18.mutedTill
15604
15634
  });
15605
15635
  return _context.a(3, 183);
15606
15636
  case 147:
15607
- _channel18 = args.channel;
15637
+ _channel19 = args.channel;
15608
15638
  log.info('channel PINED ... ');
15609
15639
  _context.n = 148;
15610
- return put(updateChannelDataAC(_channel18.id, {
15611
- pinnedAt: _channel18.pinnedAt
15640
+ return put(updateChannelDataAC(_channel19.id, {
15641
+ pinnedAt: _channel19.pinnedAt
15612
15642
  }, true));
15613
15643
  case 148:
15614
- updateChannelOnAllChannels(_channel18.id, {
15615
- pinnedAt: _channel18.pinnedAt
15644
+ updateChannelOnAllChannels(_channel19.id, {
15645
+ pinnedAt: _channel19.pinnedAt
15616
15646
  });
15617
15647
  return _context.a(3, 183);
15618
15648
  case 149:
15619
- _channel19 = args.channel;
15649
+ _channel20 = args.channel;
15620
15650
  log.info('channel UNPINED ... ');
15621
15651
  _context.n = 150;
15622
- return put(updateChannelDataAC(_channel19.id, {
15623
- pinnedAt: _channel19.pinnedAt
15652
+ return put(updateChannelDataAC(_channel20.id, {
15653
+ pinnedAt: _channel20.pinnedAt
15624
15654
  }, false, true));
15625
15655
  case 150:
15626
- updateChannelOnAllChannels(_channel19.id, {
15627
- pinnedAt: _channel19.pinnedAt
15656
+ updateChannelOnAllChannels(_channel20.id, {
15657
+ pinnedAt: _channel20.pinnedAt
15628
15658
  });
15629
15659
  return _context.a(3, 183);
15630
15660
  case 151:
15631
- _channel20 = args.channel;
15661
+ _channel21 = args.channel;
15632
15662
  log.info('channel HIDE ... ');
15633
15663
  _context.n = 152;
15634
- return put(setChannelToHideAC(_channel20));
15664
+ return put(setChannelToHideAC(_channel21));
15635
15665
  case 152:
15636
15666
  return _context.a(3, 183);
15637
15667
  case 153:
15638
- _channel21 = args.channel;
15668
+ _channel22 = args.channel;
15639
15669
  log.info('channel UNHIDE ... ');
15640
15670
  _context.n = 154;
15641
- return put(setChannelToUnHideAC(_channel21));
15671
+ return put(setChannelToUnHideAC(_channel22));
15642
15672
  case 154:
15643
15673
  return _context.a(3, 183);
15644
15674
  case 155:
15645
- _channel22 = args.channel;
15675
+ _channel23 = args.channel;
15646
15676
  _context.n = 156;
15647
- return put(updateChannelDataAC(_channel22.id, {
15648
- unread: _channel22.unread,
15649
- muted: _channel22.muted,
15650
- mutedTill: _channel22.mutedTill
15677
+ return put(updateChannelDataAC(_channel23.id, {
15678
+ unread: _channel23.unread,
15679
+ muted: _channel23.muted,
15680
+ mutedTill: _channel23.mutedTill
15651
15681
  }));
15652
15682
  case 156:
15653
- _groupName5 = getChannelGroupName(_channel22);
15683
+ _groupName5 = getChannelGroupName(_channel23);
15654
15684
  _context.n = 157;
15655
- return put(updateSearchedChannelDataAC(_channel22.id, {
15656
- unread: _channel22.unread
15685
+ return put(updateSearchedChannelDataAC(_channel23.id, {
15686
+ unread: _channel23.unread
15657
15687
  }, _groupName5));
15658
15688
  case 157:
15659
- updateChannelOnAllChannels(_channel22.id, {
15660
- unread: _channel22.unread
15689
+ updateChannelOnAllChannels(_channel23.id, {
15690
+ unread: _channel23.unread
15661
15691
  });
15662
15692
  return _context.a(3, 183);
15663
15693
  case 158:
15664
- _channel23 = args.channel;
15694
+ _channel24 = args.channel;
15665
15695
  _context.n = 159;
15666
- return put(updateChannelDataAC(_channel23.id, {
15667
- unread: _channel23.unread,
15668
- muted: _channel23.muted,
15669
- mutedTill: _channel23.mutedTill
15696
+ return put(updateChannelDataAC(_channel24.id, {
15697
+ unread: _channel24.unread,
15698
+ muted: _channel24.muted,
15699
+ mutedTill: _channel24.mutedTill
15670
15700
  }));
15671
15701
  case 159:
15672
- _groupName6 = getChannelGroupName(_channel23);
15702
+ _groupName6 = getChannelGroupName(_channel24);
15673
15703
  _context.n = 160;
15674
- return put(updateSearchedChannelDataAC(_channel23.id, {
15675
- unread: _channel23.unread
15704
+ return put(updateSearchedChannelDataAC(_channel24.id, {
15705
+ unread: _channel24.unread
15676
15706
  }, _groupName6));
15677
15707
  case 160:
15678
- updateChannelOnAllChannels(_channel23.id, {
15679
- unread: _channel23.unread
15708
+ updateChannelOnAllChannels(_channel24.id, {
15709
+ unread: _channel24.unread
15680
15710
  });
15681
15711
  return _context.a(3, 183);
15682
15712
  case 161:
15683
- _channel24 = args.channel, members = args.members;
15684
- log.info('channel CHANGE_ROLE channel ... ', _channel24);
15713
+ _channel25 = args.channel, members = args.members;
15714
+ log.info('channel CHANGE_ROLE channel ... ', _channel25);
15685
15715
  log.info('channel CHANGE_ROLE member ... ', members);
15686
15716
  _context.n = 162;
15687
15717
  return call(getActiveChannelId);
15688
15718
  case 162:
15689
15719
  _activeChannelId14 = _context.v;
15690
- if (!(_channel24.id === _activeChannelId14)) {
15720
+ if (!(_channel25.id === _activeChannelId14)) {
15691
15721
  _context.n = 163;
15692
15722
  break;
15693
15723
  }
@@ -15705,16 +15735,16 @@ function watchForEvents() {
15705
15735
  break;
15706
15736
  }
15707
15737
  _context.n = 165;
15708
- return put(updateChannelDataAC(_channel24.id, {
15738
+ return put(updateChannelDataAC(_channel25.id, {
15709
15739
  userRole: members[i].role,
15710
- muted: _channel24.muted,
15711
- mutedTill: _channel24.mutedTill
15740
+ muted: _channel25.muted,
15741
+ mutedTill: _channel25.mutedTill
15712
15742
  }));
15713
15743
  case 165:
15714
- updateChannelOnAllChannels(_channel24.id, {
15744
+ updateChannelOnAllChannels(_channel25.id, {
15715
15745
  userRole: members[i].role,
15716
- muted: _channel24.muted,
15717
- mutedTill: _channel24.mutedTill
15746
+ muted: _channel25.muted,
15747
+ mutedTill: _channel25.mutedTill
15718
15748
  });
15719
15749
  case 166:
15720
15750
  i++;
@@ -15723,12 +15753,12 @@ function watchForEvents() {
15723
15753
  case 167:
15724
15754
  return _context.a(3, 183);
15725
15755
  case 168:
15726
- _channel25 = args.channel;
15727
- log.info('channel frozen channel ... ', _channel25);
15756
+ _channel26 = args.channel;
15757
+ log.info('channel frozen channel ... ', _channel26);
15728
15758
  return _context.a(3, 183);
15729
15759
  case 169:
15730
- _channel26 = args.channel;
15731
- log.info('channel unfrozen channel ... ', _channel26);
15760
+ _channel27 = args.channel;
15761
+ log.info('channel unfrozen channel ... ', _channel27);
15732
15762
  return _context.a(3, 183);
15733
15763
  case 170:
15734
15764
  _channelId2 = args.channelId, from = args.from, name = args.name;
@@ -16064,7 +16094,7 @@ function createChannel(action) {
16064
16094
  }, _marked$2, null, [[0, 17]]);
16065
16095
  }
16066
16096
  function getChannels(action) {
16067
- var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys, _mappedChannels2, channelMessageMap, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, allChannelsData, allChannelList, _t2, _t3, _t4;
16097
+ var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys, _mappedChannels2, channelMessageMap, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, _connectionStatus, allChannelsData, allChannelList, _t2, _t3, _t4;
16068
16098
  return _regenerator().w(function (_context2) {
16069
16099
  while (1) switch (_context2.p = _context2.n) {
16070
16100
  case 0:
@@ -16222,7 +16252,7 @@ function getChannels(action) {
16222
16252
  hiddenList = store.getState().ChannelReducer.hideChannelList;
16223
16253
  log.info('[getChannels] hiddenList state:', hiddenList);
16224
16254
  if (hiddenList) {
16225
- _context2.n = 27;
16255
+ _context2.n = 28;
16226
16256
  break;
16227
16257
  }
16228
16258
  log.info('[getChannels] starting all channels query (hiddenList is false)');
@@ -16247,18 +16277,26 @@ function getChannels(action) {
16247
16277
  i = 0;
16248
16278
  case 19:
16249
16279
  if (!(i <= 4)) {
16250
- _context2.n = 26;
16280
+ _context2.n = 27;
16251
16281
  break;
16252
16282
  }
16253
16283
  if (!hasNext) {
16254
- _context2.n = 24;
16284
+ _context2.n = 25;
16255
16285
  break;
16256
16286
  }
16257
16287
  _context2.p = 20;
16288
+ _connectionStatus = store.getState().UserReducer.connectionStatus;
16289
+ if (!(_connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
16290
+ _context2.n = 21;
16291
+ break;
16292
+ }
16293
+ log.warn('[getChannels] connection not ready, aborting. Status:', _connectionStatus);
16294
+ return _context2.a(3, 27);
16295
+ case 21:
16258
16296
  log.info('[getChannels] loading all channels page:', i + 1);
16259
- _context2.n = 21;
16297
+ _context2.n = 22;
16260
16298
  return call(allChannelsQuery.loadNextPage);
16261
- case 21:
16299
+ case 22:
16262
16300
  allChannelsData = _context2.v;
16263
16301
  hasNext = allChannelsData.hasNext;
16264
16302
  allChannelList = allChannelsData.channels;
@@ -16269,33 +16307,34 @@ function getChannels(action) {
16269
16307
  addChannelsToAllChannels(allChannelList);
16270
16308
  totalAllChannelsAdded += (allChannelList === null || allChannelList === void 0 ? void 0 : allChannelList.length) || 0;
16271
16309
  log.info('[getChannels] total all channels added so far:', totalAllChannelsAdded);
16272
- _context2.n = 23;
16310
+ _context2.n = 24;
16273
16311
  break;
16274
- case 22:
16275
- _context2.p = 22;
16312
+ case 23:
16313
+ _context2.p = 23;
16276
16314
  _t3 = _context2.v;
16277
16315
  log.error(_t3, 'Error on get all channels page:', i + 1);
16278
- case 23:
16279
- _context2.n = 25;
16280
- break;
16316
+ return _context2.a(3, 27);
16281
16317
  case 24:
16282
- log.info('[getChannels] no more pages available, stopping at iteration:', i);
16318
+ _context2.n = 26;
16319
+ break;
16283
16320
  case 25:
16321
+ log.info('[getChannels] no more pages available, stopping at iteration:', i);
16322
+ case 26:
16284
16323
  i++;
16285
16324
  _context2.n = 19;
16286
16325
  break;
16287
- case 26:
16326
+ case 27:
16288
16327
  log.info('[getChannels] all channels query completed, total channels added:', totalAllChannelsAdded);
16289
- _context2.n = 28;
16328
+ _context2.n = 29;
16290
16329
  break;
16291
- case 27:
16292
- log.info('[getChannels] skipping all channels query (hiddenList is true)');
16293
16330
  case 28:
16331
+ log.info('[getChannels] skipping all channels query (hiddenList is true)');
16332
+ case 29:
16294
16333
  log.info('[getChannels] completed successfully. Final mapped channels count:', ((_mappedChannels4 = mappedChannels) === null || _mappedChannels4 === void 0 ? void 0 : _mappedChannels4.length) || 0);
16295
- _context2.n = 30;
16334
+ _context2.n = 31;
16296
16335
  break;
16297
- case 29:
16298
- _context2.p = 29;
16336
+ case 30:
16337
+ _context2.p = 30;
16299
16338
  _t4 = _context2.v;
16300
16339
  log.error('[getChannels] error occurred:', JSON.stringify(_t4), 'Error on get channels');
16301
16340
  log.error('[getChannels] error details:', {
@@ -16303,10 +16342,10 @@ function getChannels(action) {
16303
16342
  code: _t4.code,
16304
16343
  stack: _t4.stack
16305
16344
  });
16306
- case 30:
16345
+ case 31:
16307
16346
  return _context2.a(2);
16308
16347
  }
16309
- }, _marked2$1, null, [[20, 22], [1, 29]]);
16348
+ }, _marked2$1, null, [[20, 23], [1, 30]]);
16310
16349
  }
16311
16350
  function searchChannels(action) {
16312
16351
  var payload, params, contactsMap, SceytChatClient, getFromContacts, searchBy, _params$filter2, _types2, channelQueryBuilder, channelTypesFilter, types, allChannels, publicChannels, chatsGroups, contactsList, contactsWithChannelsMap, lowerCaseSearchBy, handleChannels, channelsMap, _iterator, _step, channel, channelQuery, channelsData, _iterator2, _step2, _channel, channelsToAdd, _t5;
@@ -16629,39 +16668,66 @@ function searchChannelsForForward(action) {
16629
16668
  }, _marked5, null, [[0, 7]]);
16630
16669
  }
16631
16670
  function channelsLoadMore(action) {
16632
- var payload, limit, channelQuery, channelsData, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, channelMessageMap, _t8;
16671
+ var _mappedChannels5, _mappedChannels7, _mappedChannels8, payload, limit, channelQuery, channelsData, channelList, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys2, _mappedChannels6, channelMessageMap, _t8;
16633
16672
  return _regenerator().w(function (_context6) {
16634
16673
  while (1) switch (_context6.p = _context6.n) {
16635
16674
  case 0:
16636
- _context6.p = 0;
16675
+ log.info('[channelsLoadMore] start load more channels');
16676
+ _context6.p = 1;
16637
16677
  payload = action.payload;
16638
16678
  limit = payload.limit;
16679
+ log.info('[channelsLoadMore] input payload:', JSON.stringify({
16680
+ limit: limit
16681
+ }));
16639
16682
  channelQuery = query.channelQuery;
16683
+ log.info('[channelsLoadMore] channelQuery exists:', !!channelQuery);
16684
+ if (channelQuery) {
16685
+ _context6.n = 2;
16686
+ break;
16687
+ }
16688
+ log.error('[channelsLoadMore] channelQuery is null or undefined, cannot load more');
16689
+ return _context6.a(2);
16690
+ case 2:
16640
16691
  if (limit) {
16692
+ log.info('[channelsLoadMore] setting query limit to:', limit);
16641
16693
  channelQuery.limit = limit;
16694
+ } else {
16695
+ log.info('[channelsLoadMore] no limit provided, using existing query limit');
16642
16696
  }
16643
- _context6.n = 1;
16697
+ _context6.n = 3;
16644
16698
  return put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
16645
- case 1:
16646
- _context6.n = 2;
16699
+ case 3:
16700
+ log.info('[channelsLoadMore] loading next page...');
16701
+ _context6.n = 4;
16647
16702
  return call(channelQuery.loadNextPage);
16648
- case 2:
16703
+ case 4:
16649
16704
  channelsData = _context6.v;
16650
- _context6.n = 3;
16705
+ channelList = channelsData.channels;
16706
+ log.info('[channelsLoadMore] channelsData received:', JSON.stringify({
16707
+ channelsCount: (channelList === null || channelList === void 0 ? void 0 : channelList.length) || 0,
16708
+ hasNext: channelsData.hasNext
16709
+ }));
16710
+ _context6.n = 5;
16651
16711
  return put(channelHasNextAC(channelsData.hasNext));
16652
- case 3:
16653
- _context6.n = 4;
16712
+ case 5:
16713
+ log.info('[channelsLoadMore] hasNext set to:', channelsData.hasNext);
16714
+ _context6.n = 6;
16654
16715
  return call(setChannelsInMap, channelsData.channels);
16655
- case 4:
16716
+ case 6:
16656
16717
  _yield$call3 = _context6.v;
16657
16718
  mappedChannels = _yield$call3.channels;
16658
16719
  channelsForUpdateLastReactionMessage = _yield$call3.channelsForUpdateLastReactionMessage;
16659
- if (!channelsForUpdateLastReactionMessage.length) {
16660
- _context6.n = 6;
16720
+ log.info('[channelsLoadMore] setChannelsInMap result:', JSON.stringify({
16721
+ mappedChannelsCount: ((_mappedChannels5 = mappedChannels) === null || _mappedChannels5 === void 0 ? void 0 : _mappedChannels5.length) || 0,
16722
+ channelsForUpdateLastReactionMessageCount: (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length) || 0
16723
+ }));
16724
+ if (!(channelsForUpdateLastReactionMessage !== null && channelsForUpdateLastReactionMessage !== void 0 && channelsForUpdateLastReactionMessage.length)) {
16725
+ _context6.n = 8;
16661
16726
  break;
16662
16727
  }
16728
+ log.info('[channelsLoadMore] processing channels for reaction message update:', channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length);
16663
16729
  channelMessageMap = {};
16664
- _context6.n = 5;
16730
+ _context6.n = 7;
16665
16731
  return call(function () {
16666
16732
  try {
16667
16733
  return Promise.resolve(Promise.all(channelsForUpdateLastReactionMessage.map(function (channel) {
@@ -16669,9 +16735,10 @@ function channelsLoadMore(action) {
16669
16735
  return Promise.resolve(new Promise(function (resolve) {
16670
16736
  channel.getMessagesById([channel.newReactions[0].messageId]).then(function (messages) {
16671
16737
  channelMessageMap[channel.id] = messages[0];
16738
+ log.info('[channelsLoadMore] successfully fetched reaction message for channel:', channel === null || channel === void 0 ? void 0 : channel.id);
16672
16739
  resolve(true);
16673
16740
  })["catch"](function (e) {
16674
- log.error(e, 'Error on getMessagesById');
16741
+ log.error(e, 'Error on getMessagesById for channel:', channel === null || channel === void 0 ? void 0 : channel.id);
16675
16742
  resolve(true);
16676
16743
  });
16677
16744
  }));
@@ -16683,30 +16750,43 @@ function channelsLoadMore(action) {
16683
16750
  return Promise.reject(e);
16684
16751
  }
16685
16752
  });
16686
- case 5:
16753
+ case 7:
16754
+ log.info('[channelsLoadMore] reaction messages fetched:', channelMessageMap ? (_Object$keys2 = Object.keys(channelMessageMap)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length : 0);
16687
16755
  mappedChannels = mappedChannels.map(function (channel) {
16688
16756
  if (channelMessageMap[channel.id]) {
16689
16757
  channel.lastReactedMessage = channelMessageMap[channel.id];
16690
16758
  }
16691
16759
  return channel;
16692
16760
  });
16693
- case 6:
16694
- _context6.n = 7;
16695
- return put(addChannelsAC(mappedChannels));
16696
- case 7:
16697
- _context6.n = 8;
16698
- return put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
16761
+ log.info('[channelsLoadMore] mappedChannels updated with reaction messages, final count:', ((_mappedChannels6 = mappedChannels) === null || _mappedChannels6 === void 0 ? void 0 : _mappedChannels6.length) || 0);
16762
+ _context6.n = 9;
16763
+ break;
16699
16764
  case 8:
16765
+ log.info('[channelsLoadMore] no channels need reaction message update');
16766
+ case 9:
16767
+ log.info('[channelsLoadMore] adding channels to state, count:', ((_mappedChannels7 = mappedChannels) === null || _mappedChannels7 === void 0 ? void 0 : _mappedChannels7.length) || 0);
16700
16768
  _context6.n = 10;
16769
+ return put(addChannelsAC(mappedChannels));
16770
+ case 10:
16771
+ _context6.n = 11;
16772
+ return put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
16773
+ case 11:
16774
+ log.info('[channelsLoadMore] completed successfully. Total channels added:', ((_mappedChannels8 = mappedChannels) === null || _mappedChannels8 === void 0 ? void 0 : _mappedChannels8.length) || 0);
16775
+ _context6.n = 13;
16701
16776
  break;
16702
- case 9:
16703
- _context6.p = 9;
16777
+ case 12:
16778
+ _context6.p = 12;
16704
16779
  _t8 = _context6.v;
16705
- log.error(_t8, 'Error in load more channels');
16706
- case 10:
16780
+ log.error('[channelsLoadMore] error occurred:', _t8);
16781
+ log.error('[channelsLoadMore] error details:', JSON.stringify({
16782
+ message: _t8 === null || _t8 === void 0 ? void 0 : _t8.message,
16783
+ code: _t8 === null || _t8 === void 0 ? void 0 : _t8.code,
16784
+ stack: _t8 === null || _t8 === void 0 ? void 0 : _t8.stack
16785
+ }));
16786
+ case 13:
16707
16787
  return _context6.a(2);
16708
16788
  }
16709
- }, _marked6, null, [[0, 9]]);
16789
+ }, _marked6, null, [[1, 12]]);
16710
16790
  }
16711
16791
  function getChannelMentions(action) {
16712
16792
  var payload, channelId, _SceytChatClient3, mentionsQueryBuilder, mentionsQuery, mentions, _t9;
@@ -17418,7 +17498,7 @@ function blockChannel(action) {
17418
17498
  }, _marked20, null, [[0, 5]]);
17419
17499
  }
17420
17500
  function updateChannel(action) {
17421
- var payload, channelId, config, _SceytChatClient6, channel, paramsToUpdate, fileToUpload, _yield$call5, subject, avatarUrl, metadata, _t22;
17501
+ var payload, channelId, config, _SceytChatClient6, channel, paramsToUpdate, fileToUpload, _yield$call5, subject, avatarUrl, metadata, onUpdateChannel, _channel3, _channel4, _channel5, fields, updatedChannel, _t22;
17422
17502
  return _regenerator().w(function (_context21) {
17423
17503
  while (1) switch (_context21.p = _context21.n) {
17424
17504
  case 0:
@@ -17482,16 +17562,37 @@ function updateChannel(action) {
17482
17562
  avatarUrl: avatarUrl,
17483
17563
  metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
17484
17564
  });
17485
- _context21.n = 7;
17486
- break;
17565
+ onUpdateChannel = getOnUpdateChannel();
17566
+ if (!onUpdateChannel) {
17567
+ _context21.n = 7;
17568
+ break;
17569
+ }
17570
+ fields = [];
17571
+ if (((_channel3 = channel) === null || _channel3 === void 0 ? void 0 : _channel3.subject) !== subject) {
17572
+ fields.push('subject');
17573
+ }
17574
+ if (((_channel4 = channel) === null || _channel4 === void 0 ? void 0 : _channel4.avatarUrl) !== avatarUrl) {
17575
+ fields.push('avatarUrl');
17576
+ }
17577
+ if (JSON.stringify((_channel5 = channel) === null || _channel5 === void 0 ? void 0 : _channel5.metadata) !== metadata) {
17578
+ fields.push('metadata');
17579
+ }
17580
+ _context21.n = 6;
17581
+ return call(getChannelFromMap, channelId);
17487
17582
  case 6:
17488
- _context21.p = 6;
17583
+ updatedChannel = _context21.v;
17584
+ onUpdateChannel(updatedChannel, fields);
17585
+ case 7:
17586
+ _context21.n = 9;
17587
+ break;
17588
+ case 8:
17589
+ _context21.p = 8;
17489
17590
  _t22 = _context21.v;
17490
17591
  log.error('ERROR in update channel', _t22.message);
17491
- case 7:
17592
+ case 9:
17492
17593
  return _context21.a(2);
17493
17594
  }
17494
- }, _marked21, null, [[0, 6]]);
17595
+ }, _marked21, null, [[0, 8]]);
17495
17596
  }
17496
17597
  function checkUsersStatus() {
17497
17598
  var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData, _t23;
@@ -23318,7 +23419,8 @@ var SceytChat = function SceytChat(_ref) {
23318
23419
  disableFrowardMentionsCount = _ref$disableFrowardMe === void 0 ? false : _ref$disableFrowardMe,
23319
23420
  chatMinWidth = _ref.chatMinWidth,
23320
23421
  _ref$embeddedJoinGrou = _ref.embeddedJoinGroupPopup,
23321
- embeddedJoinGroupPopup = _ref$embeddedJoinGrou === void 0 ? false : _ref$embeddedJoinGrou;
23422
+ embeddedJoinGroupPopup = _ref$embeddedJoinGrou === void 0 ? false : _ref$embeddedJoinGrou,
23423
+ onUpdateChannel = _ref.onUpdateChannel;
23322
23424
  var useInviteLink = getUseInviteLink();
23323
23425
  var _useColor = useColors(),
23324
23426
  backgroundColor = _useColor[THEME_COLORS.BACKGROUND],
@@ -23561,6 +23663,11 @@ var SceytChat = function SceytChat(_ref) {
23561
23663
  onJoin: handleJoinChannel,
23562
23664
  channel: joinableChannel
23563
23665
  })) : null;
23666
+ useEffect(function () {
23667
+ if (onUpdateChannel) {
23668
+ setOnUpdateChannel(onUpdateChannel);
23669
+ }
23670
+ }, [onUpdateChannel]);
23564
23671
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, SceytChatClient ? (/*#__PURE__*/React__default.createElement(ChatContainer, {
23565
23672
  onDrop: handleDropFile,
23566
23673
  onDragOver: handleDragOver,
@@ -23623,7 +23730,8 @@ var SceytChatContainer = function SceytChatContainer(_ref) {
23623
23730
  ResetLinkConfirmModal: {}
23624
23731
  } : _ref$inviteLinkOption,
23625
23732
  _ref$embeddedJoinGrou = _ref.embeddedJoinGroupPopup,
23626
- embeddedJoinGroupPopup = _ref$embeddedJoinGrou === void 0 ? false : _ref$embeddedJoinGrou;
23733
+ embeddedJoinGroupPopup = _ref$embeddedJoinGrou === void 0 ? false : _ref$embeddedJoinGrou,
23734
+ onUpdateChannel = _ref.onUpdateChannel;
23627
23735
  useEffect(function () {
23628
23736
  log.setLevel(logLevel);
23629
23737
  if (baseUrlForInviteMembers) {
@@ -23660,7 +23768,8 @@ var SceytChatContainer = function SceytChatContainer(_ref) {
23660
23768
  memberCount: memberCount,
23661
23769
  disableFrowardMentionsCount: disableFrowardMentionsCount,
23662
23770
  chatMinWidth: chatMinWidth,
23663
- embeddedJoinGroupPopup: embeddedJoinGroupPopup
23771
+ embeddedJoinGroupPopup: embeddedJoinGroupPopup,
23772
+ onUpdateChannel: onUpdateChannel
23664
23773
  }));
23665
23774
  };
23666
23775
 
@@ -32558,7 +32667,7 @@ var AudioPlayer = function AudioPlayer(_ref) {
32558
32667
  wavesurfer.current.seekTo(0);
32559
32668
  var audioDuration = wavesurfer.current.getDuration();
32560
32669
  setDuration(audioDuration);
32561
- setCurrentTime(formatAudioVideoTime(0));
32670
+ setCurrentTime(formatAudioVideoTime(audioDuration));
32562
32671
  setCurrentTimeSeconds(0);
32563
32672
  if (playingAudioId === file.id) {
32564
32673
  dispatch(setPlayingAudioIdAC(null));
@@ -35247,7 +35356,7 @@ var OGMetadata = function OGMetadata(_ref) {
35247
35356
  metadataGetSuccessCallback === null || metadataGetSuccessCallback === void 0 ? void 0 : metadataGetSuccessCallback(attachment === null || attachment === void 0 ? void 0 : attachment.url, false, false, metadata);
35248
35357
  }
35249
35358
  }
35250
- }, [metadataLoaded, oGMetadata, attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata, showOGMetadata, showImage, metadataGetSuccessCallback]);
35359
+ }, [metadataLoaded, oGMetadata, attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata, showOGMetadata, showImage]);
35251
35360
  var elements = useMemo(function () {
35252
35361
  var _resolvedOrder$image, _metadata$og17, _metadata$og17$image, _metadata$og17$image$, _resolvedOrder$title, _metadata$og18, _metadata$og18$title, _resolvedOrder$descri, _metadata$og19, _metadata$og19$descri, _resolvedOrder$link;
35253
35362
  return [showImage ? {