sceyt-chat-react-uikit 1.7.9-beta.6 → 1.7.9-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +661 -556
- package/index.modern.js +661 -556
- package/package.json +1 -1
package/index.modern.js
CHANGED
|
@@ -9059,6 +9059,7 @@ var autoSelectFitsChannel = false;
|
|
|
9059
9059
|
var allChannels = [];
|
|
9060
9060
|
var channelsMap = {};
|
|
9061
9061
|
var allChannelsMap = {};
|
|
9062
|
+
var pendingDeleteChannelMap = {};
|
|
9062
9063
|
var channelTypesMemberDisplayTextMap;
|
|
9063
9064
|
var defaultRolesByChannelTypesMap;
|
|
9064
9065
|
var activeChannelId = '';
|
|
@@ -9118,8 +9119,20 @@ function setChannelsInMap(channels) {
|
|
|
9118
9119
|
function getChannelFromMap(channelId) {
|
|
9119
9120
|
return channelsMap[channelId];
|
|
9120
9121
|
}
|
|
9121
|
-
function getLastChannelFromMap() {
|
|
9122
|
-
|
|
9122
|
+
function getLastChannelFromMap(deletePending) {
|
|
9123
|
+
if (deletePending === void 0) {
|
|
9124
|
+
deletePending = false;
|
|
9125
|
+
}
|
|
9126
|
+
var channels = Object.values(channelsMap);
|
|
9127
|
+
if (deletePending) {
|
|
9128
|
+
for (var _iterator = _createForOfIteratorHelperLoose(channels), _step; !(_step = _iterator()).done;) {
|
|
9129
|
+
var channel = _step.value;
|
|
9130
|
+
if (!getPendingDeleteChannel(channel.id)) {
|
|
9131
|
+
return channel;
|
|
9132
|
+
}
|
|
9133
|
+
}
|
|
9134
|
+
}
|
|
9135
|
+
return channels[0];
|
|
9123
9136
|
}
|
|
9124
9137
|
function removeChannelFromMap(channelId) {
|
|
9125
9138
|
delete channelsMap[channelId];
|
|
@@ -9327,6 +9340,18 @@ var sortChannelByLastMessage = function sortChannelByLastMessage(channels) {
|
|
|
9327
9340
|
}
|
|
9328
9341
|
});
|
|
9329
9342
|
};
|
|
9343
|
+
var setPendingDeleteChannel = function setPendingDeleteChannel(channel) {
|
|
9344
|
+
pendingDeleteChannelMap[channel === null || channel === void 0 ? void 0 : channel.id] = channel;
|
|
9345
|
+
};
|
|
9346
|
+
var getPendingDeleteChannel = function getPendingDeleteChannel(channelId) {
|
|
9347
|
+
return pendingDeleteChannelMap[channelId];
|
|
9348
|
+
};
|
|
9349
|
+
var getPendingDeleteChannels = function getPendingDeleteChannels() {
|
|
9350
|
+
return Object.values(pendingDeleteChannelMap);
|
|
9351
|
+
};
|
|
9352
|
+
var removePendingDeleteChannel = function removePendingDeleteChannel(channelId) {
|
|
9353
|
+
delete pendingDeleteChannelMap[channelId];
|
|
9354
|
+
};
|
|
9330
9355
|
|
|
9331
9356
|
var initialState = {
|
|
9332
9357
|
channelsLoadingState: null,
|
|
@@ -16317,6 +16342,56 @@ function watchForEvents() {
|
|
|
16317
16342
|
}, _marked$1);
|
|
16318
16343
|
}
|
|
16319
16344
|
|
|
16345
|
+
var SDKErrorTypeEnum = {
|
|
16346
|
+
BadRequest: {
|
|
16347
|
+
value: 'BadRequest',
|
|
16348
|
+
isResendable: false
|
|
16349
|
+
},
|
|
16350
|
+
BadParam: {
|
|
16351
|
+
value: 'BadParam',
|
|
16352
|
+
isResendable: false
|
|
16353
|
+
},
|
|
16354
|
+
NotFound: {
|
|
16355
|
+
value: 'NotFound',
|
|
16356
|
+
isResendable: false
|
|
16357
|
+
},
|
|
16358
|
+
NotAllowed: {
|
|
16359
|
+
value: 'NotAllowed',
|
|
16360
|
+
isResendable: false
|
|
16361
|
+
},
|
|
16362
|
+
TooLargeRequest: {
|
|
16363
|
+
value: 'TooLargeRequest',
|
|
16364
|
+
isResendable: false
|
|
16365
|
+
},
|
|
16366
|
+
InternalError: {
|
|
16367
|
+
value: 'InternalError',
|
|
16368
|
+
isResendable: true
|
|
16369
|
+
},
|
|
16370
|
+
TooManyRequests: {
|
|
16371
|
+
value: 'TooManyRequests',
|
|
16372
|
+
isResendable: true
|
|
16373
|
+
},
|
|
16374
|
+
Authentication: {
|
|
16375
|
+
value: 'Authentication',
|
|
16376
|
+
isResendable: true
|
|
16377
|
+
}
|
|
16378
|
+
};
|
|
16379
|
+
var fromValue = function fromValue(value) {
|
|
16380
|
+
if (!value) return null;
|
|
16381
|
+
var entries = Object.values(SDKErrorTypeEnum);
|
|
16382
|
+
return entries.find(function (entry) {
|
|
16383
|
+
return entry.value === value;
|
|
16384
|
+
}) || null;
|
|
16385
|
+
};
|
|
16386
|
+
var isResendableError = function isResendableError(value) {
|
|
16387
|
+
var _errorType$isResendab;
|
|
16388
|
+
if (!value) {
|
|
16389
|
+
return true;
|
|
16390
|
+
}
|
|
16391
|
+
var errorType = fromValue(value);
|
|
16392
|
+
return (_errorType$isResendab = errorType === null || errorType === void 0 ? void 0 : errorType.isResendable) != null ? _errorType$isResendab : true;
|
|
16393
|
+
};
|
|
16394
|
+
|
|
16320
16395
|
var _marked$2 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
16321
16396
|
_marked2$1 = /*#__PURE__*/_regenerator().m(getChannels),
|
|
16322
16397
|
_marked3 = /*#__PURE__*/_regenerator().m(searchChannels),
|
|
@@ -16337,26 +16412,27 @@ var _marked$2 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
|
16337
16412
|
_marked16 = /*#__PURE__*/_regenerator().m(unpinChannel),
|
|
16338
16413
|
_marked17 = /*#__PURE__*/_regenerator().m(removeChannelCaches),
|
|
16339
16414
|
_marked18 = /*#__PURE__*/_regenerator().m(leaveChannel),
|
|
16340
|
-
_marked19 = /*#__PURE__*/_regenerator().m(
|
|
16341
|
-
_marked20 = /*#__PURE__*/_regenerator().m(
|
|
16342
|
-
_marked21 = /*#__PURE__*/_regenerator().m(
|
|
16343
|
-
_marked22 = /*#__PURE__*/_regenerator().m(
|
|
16344
|
-
_marked23 = /*#__PURE__*/_regenerator().m(
|
|
16345
|
-
_marked24 = /*#__PURE__*/_regenerator().m(
|
|
16346
|
-
_marked25 = /*#__PURE__*/_regenerator().m(
|
|
16347
|
-
_marked26 = /*#__PURE__*/_regenerator().m(
|
|
16348
|
-
_marked27 = /*#__PURE__*/_regenerator().m(
|
|
16349
|
-
_marked28 = /*#__PURE__*/_regenerator().m(
|
|
16350
|
-
_marked29 = /*#__PURE__*/_regenerator().m(
|
|
16351
|
-
_marked30 = /*#__PURE__*/_regenerator().m(
|
|
16352
|
-
_marked31 = /*#__PURE__*/_regenerator().m(
|
|
16353
|
-
_marked32 = /*#__PURE__*/_regenerator().m(
|
|
16354
|
-
_marked33 = /*#__PURE__*/_regenerator().m(
|
|
16355
|
-
_marked34 = /*#__PURE__*/_regenerator().m(
|
|
16356
|
-
_marked35 = /*#__PURE__*/_regenerator().m(
|
|
16357
|
-
_marked36 = /*#__PURE__*/_regenerator().m(
|
|
16358
|
-
_marked37 = /*#__PURE__*/_regenerator().m(
|
|
16359
|
-
_marked38 = /*#__PURE__*/_regenerator().m(
|
|
16415
|
+
_marked19 = /*#__PURE__*/_regenerator().m(deletePendingDeleteChannels),
|
|
16416
|
+
_marked20 = /*#__PURE__*/_regenerator().m(deleteChannel),
|
|
16417
|
+
_marked21 = /*#__PURE__*/_regenerator().m(blockChannel),
|
|
16418
|
+
_marked22 = /*#__PURE__*/_regenerator().m(updateChannel),
|
|
16419
|
+
_marked23 = /*#__PURE__*/_regenerator().m(checkUsersStatus),
|
|
16420
|
+
_marked24 = /*#__PURE__*/_regenerator().m(sendTyping),
|
|
16421
|
+
_marked25 = /*#__PURE__*/_regenerator().m(sendRecording),
|
|
16422
|
+
_marked26 = /*#__PURE__*/_regenerator().m(clearHistory),
|
|
16423
|
+
_marked27 = /*#__PURE__*/_regenerator().m(deleteAllMessages),
|
|
16424
|
+
_marked28 = /*#__PURE__*/_regenerator().m(joinChannel),
|
|
16425
|
+
_marked29 = /*#__PURE__*/_regenerator().m(watchForChannelEvents),
|
|
16426
|
+
_marked30 = /*#__PURE__*/_regenerator().m(createChannelInviteKey),
|
|
16427
|
+
_marked31 = /*#__PURE__*/_regenerator().m(getChannelInviteKeys),
|
|
16428
|
+
_marked32 = /*#__PURE__*/_regenerator().m(regenerateChannelInviteKey),
|
|
16429
|
+
_marked33 = /*#__PURE__*/_regenerator().m(updateChannelInviteKey),
|
|
16430
|
+
_marked34 = /*#__PURE__*/_regenerator().m(getChannelByInviteKey),
|
|
16431
|
+
_marked35 = /*#__PURE__*/_regenerator().m(joinChannelWithInviteKey),
|
|
16432
|
+
_marked36 = /*#__PURE__*/_regenerator().m(setMessageRetentionPeriod),
|
|
16433
|
+
_marked37 = /*#__PURE__*/_regenerator().m(getChannelsWithUser),
|
|
16434
|
+
_marked38 = /*#__PURE__*/_regenerator().m(loadMoreMutualChannels),
|
|
16435
|
+
_marked39 = /*#__PURE__*/_regenerator().m(ChannelsSaga);
|
|
16360
16436
|
function createChannel(action) {
|
|
16361
16437
|
var payload, channelData, dontCreateIfNotExists, callback, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, whoDoesNotAdded, checkChannelExist, messageToSend, _allChannels, _memberId, _t;
|
|
16362
16438
|
return _regenerator().w(function (_context) {
|
|
@@ -16564,20 +16640,23 @@ function getChannels(action) {
|
|
|
16564
16640
|
_context2.p = 1;
|
|
16565
16641
|
payload = action.payload;
|
|
16566
16642
|
params = payload.params;
|
|
16643
|
+
_context2.n = 2;
|
|
16644
|
+
return call(deletePendingDeleteChannels);
|
|
16645
|
+
case 2:
|
|
16567
16646
|
log.info(new Date().toISOString() + " [getChannels] input params: " + JSON.stringify(params));
|
|
16568
16647
|
SceytChatClient = getClient();
|
|
16569
16648
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
16570
16649
|
log.info(new Date().toISOString() + " [getChannels] connection status: " + connectionStatus);
|
|
16571
16650
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
16572
|
-
_context2.n =
|
|
16651
|
+
_context2.n = 3;
|
|
16573
16652
|
break;
|
|
16574
16653
|
}
|
|
16575
16654
|
log.warn(new Date().toISOString() + " [getChannels] connection not ready, aborting. Status: " + connectionStatus);
|
|
16576
16655
|
return _context2.a(2);
|
|
16577
|
-
case 2:
|
|
16578
|
-
_context2.n = 3;
|
|
16579
|
-
return put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
16580
16656
|
case 3:
|
|
16657
|
+
_context2.n = 4;
|
|
16658
|
+
return put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
16659
|
+
case 4:
|
|
16581
16660
|
channelQueryBuilder = new SceytChatClient.ChannelListQueryBuilder();
|
|
16582
16661
|
channelTypesFilter = getChannelTypesFilter();
|
|
16583
16662
|
log.info(new Date().toISOString() + " [getChannels] channelTypesFilter: " + JSON.stringify(channelTypesFilter));
|
|
@@ -16600,50 +16679,50 @@ function getChannels(action) {
|
|
|
16600
16679
|
limit = params.limit || 50;
|
|
16601
16680
|
log.info(new Date().toISOString() + " [getChannels] query limit: " + limit);
|
|
16602
16681
|
channelQueryBuilder.limit(limit);
|
|
16603
|
-
_context2.n =
|
|
16682
|
+
_context2.n = 5;
|
|
16604
16683
|
return call(channelQueryBuilder.build);
|
|
16605
|
-
case
|
|
16684
|
+
case 5:
|
|
16606
16685
|
channelQuery = _context2.v;
|
|
16607
16686
|
log.info(new Date().toISOString() + " [getChannels] query built successfully");
|
|
16608
|
-
_context2.n =
|
|
16687
|
+
_context2.n = 6;
|
|
16609
16688
|
return call(channelQuery.loadNextPage);
|
|
16610
|
-
case
|
|
16689
|
+
case 6:
|
|
16611
16690
|
channelsData = _context2.v;
|
|
16612
16691
|
channelList = channelsData.channels;
|
|
16613
16692
|
log.info(new Date().toISOString() + " [getChannels] channelsData received: " + JSON.stringify({
|
|
16614
16693
|
channelsCount: (channelList === null || channelList === void 0 ? void 0 : channelList.length) || 0,
|
|
16615
16694
|
hasNext: channelsData.hasNext
|
|
16616
16695
|
}));
|
|
16617
|
-
_context2.n = 6;
|
|
16618
|
-
return put(channelHasNextAC(channelsData.hasNext));
|
|
16619
|
-
case 6:
|
|
16620
16696
|
_context2.n = 7;
|
|
16621
|
-
return
|
|
16697
|
+
return put(channelHasNextAC(channelsData.hasNext));
|
|
16622
16698
|
case 7:
|
|
16699
|
+
_context2.n = 8;
|
|
16700
|
+
return call(getActiveChannelId);
|
|
16701
|
+
case 8:
|
|
16623
16702
|
channelId = _context2.v;
|
|
16624
16703
|
log.info(new Date().toISOString() + " [getChannels] active channelId: " + channelId);
|
|
16625
16704
|
if (!channelId) {
|
|
16626
|
-
_context2.n =
|
|
16705
|
+
_context2.n = 10;
|
|
16627
16706
|
break;
|
|
16628
16707
|
}
|
|
16629
|
-
_context2.n =
|
|
16708
|
+
_context2.n = 9;
|
|
16630
16709
|
return call(getChannelFromMap, channelId);
|
|
16631
|
-
case
|
|
16710
|
+
case 9:
|
|
16632
16711
|
_t2 = _context2.v;
|
|
16633
|
-
_context2.n =
|
|
16712
|
+
_context2.n = 11;
|
|
16634
16713
|
break;
|
|
16635
|
-
case 9:
|
|
16636
|
-
_t2 = null;
|
|
16637
16714
|
case 10:
|
|
16715
|
+
_t2 = null;
|
|
16716
|
+
case 11:
|
|
16638
16717
|
activeChannel = _t2;
|
|
16639
16718
|
log.info(new Date().toISOString() + " [getChannels] activeChannel from map: " + (activeChannel ? (_activeChannel = activeChannel) === null || _activeChannel === void 0 ? void 0 : _activeChannel.id : 'null'));
|
|
16640
|
-
_context2.n =
|
|
16719
|
+
_context2.n = 12;
|
|
16641
16720
|
return call(destroyChannelsMap);
|
|
16642
|
-
case
|
|
16721
|
+
case 12:
|
|
16643
16722
|
log.info(new Date().toISOString() + " [getChannels] channels map destroyed");
|
|
16644
|
-
_context2.n =
|
|
16723
|
+
_context2.n = 13;
|
|
16645
16724
|
return call(setChannelsInMap, channelList);
|
|
16646
|
-
case
|
|
16725
|
+
case 13:
|
|
16647
16726
|
_yield$call = _context2.v;
|
|
16648
16727
|
mappedChannels = _yield$call.channels;
|
|
16649
16728
|
channelsForUpdateLastReactionMessage = _yield$call.channelsForUpdateLastReactionMessage;
|
|
@@ -16653,12 +16732,12 @@ function getChannels(action) {
|
|
|
16653
16732
|
}));
|
|
16654
16733
|
log.info(new Date().toISOString() + " channelsForUpdateLastReactionMessage: " + (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length));
|
|
16655
16734
|
if (!(channelsForUpdateLastReactionMessage !== null && channelsForUpdateLastReactionMessage !== void 0 && channelsForUpdateLastReactionMessage.length)) {
|
|
16656
|
-
_context2.n =
|
|
16735
|
+
_context2.n = 15;
|
|
16657
16736
|
break;
|
|
16658
16737
|
}
|
|
16659
16738
|
log.info(new Date().toISOString() + " [getChannels] processing channels for\n reaction message update: " + (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length));
|
|
16660
16739
|
channelMessageMap = {};
|
|
16661
|
-
_context2.n =
|
|
16740
|
+
_context2.n = 14;
|
|
16662
16741
|
return call(function () {
|
|
16663
16742
|
try {
|
|
16664
16743
|
return Promise.resolve(Promise.all(channelsForUpdateLastReactionMessage.map(function (channel) {
|
|
@@ -16681,7 +16760,7 @@ function getChannels(action) {
|
|
|
16681
16760
|
return Promise.reject(e);
|
|
16682
16761
|
}
|
|
16683
16762
|
});
|
|
16684
|
-
case
|
|
16763
|
+
case 14:
|
|
16685
16764
|
log.info(new Date().toISOString() + " [getChannels] reaction messages fetched: " + (channelMessageMap ? (_Object$keys = Object.keys(channelMessageMap)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length : 0), channelMessageMap ? (_Object$keys2 = Object.keys(channelMessageMap)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length : 0);
|
|
16686
16765
|
mappedChannels = mappedChannels.map(function (channel) {
|
|
16687
16766
|
if (channelMessageMap[channel === null || channel === void 0 ? void 0 : channel.id]) {
|
|
@@ -16690,31 +16769,31 @@ function getChannels(action) {
|
|
|
16690
16769
|
return channel;
|
|
16691
16770
|
});
|
|
16692
16771
|
log.info(new Date().toISOString() + " [getChannels] mappedChannels updated with reaction messages, final count: " + (((_mappedChannels2 = mappedChannels) === null || _mappedChannels2 === void 0 ? void 0 : _mappedChannels2.length) || 0));
|
|
16693
|
-
case
|
|
16772
|
+
case 15:
|
|
16694
16773
|
log.info(new Date().toISOString() + " [getChannels] setting channels in state, count: " + (((_mappedChannels3 = mappedChannels) === null || _mappedChannels3 === void 0 ? void 0 : _mappedChannels3.length) || 0));
|
|
16695
|
-
_context2.n =
|
|
16774
|
+
_context2.n = 16;
|
|
16696
16775
|
return put(setChannelsAC(mappedChannels));
|
|
16697
|
-
case
|
|
16776
|
+
case 16:
|
|
16698
16777
|
if (!channelId) {
|
|
16699
16778
|
activeChannel = channelList[0];
|
|
16700
16779
|
log.info(new Date().toISOString() + " [getChannels] no active channelId, setting first channel as active: " + ((_activeChannel2 = activeChannel) === null || _activeChannel2 === void 0 ? void 0 : _activeChannel2.id));
|
|
16701
16780
|
}
|
|
16702
16781
|
query.channelQuery = channelQuery;
|
|
16703
16782
|
if (!(activeChannel && getAutoSelectFitsChannel())) {
|
|
16704
|
-
_context2.n =
|
|
16783
|
+
_context2.n = 17;
|
|
16705
16784
|
break;
|
|
16706
16785
|
}
|
|
16707
16786
|
log.info(new Date().toISOString() + " [getChannels] auto-selecting channel: " + ((_activeChannel3 = activeChannel) === null || _activeChannel3 === void 0 ? void 0 : _activeChannel3.id));
|
|
16708
|
-
_context2.n = 16;
|
|
16709
|
-
return put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
16710
|
-
case 16:
|
|
16711
16787
|
_context2.n = 17;
|
|
16712
|
-
return put(
|
|
16788
|
+
return put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
16713
16789
|
case 17:
|
|
16790
|
+
_context2.n = 18;
|
|
16791
|
+
return put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
16792
|
+
case 18:
|
|
16714
16793
|
hiddenList = store.getState().ChannelReducer.hideChannelList;
|
|
16715
16794
|
log.info(new Date().toISOString() + " [getChannels] hiddenList state: " + hiddenList);
|
|
16716
16795
|
if (hiddenList) {
|
|
16717
|
-
_context2.n =
|
|
16796
|
+
_context2.n = 29;
|
|
16718
16797
|
break;
|
|
16719
16798
|
}
|
|
16720
16799
|
log.info(new Date().toISOString() + " [getChannels] starting all channels query (hiddenList is false)");
|
|
@@ -16729,36 +16808,36 @@ function getChannels(action) {
|
|
|
16729
16808
|
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery memberCount: " + (params === null || params === void 0 ? void 0 : params.memberCount));
|
|
16730
16809
|
}
|
|
16731
16810
|
allChannelsQueryBuilder.limit(50);
|
|
16732
|
-
_context2.n =
|
|
16811
|
+
_context2.n = 19;
|
|
16733
16812
|
return call(allChannelsQueryBuilder.build);
|
|
16734
|
-
case
|
|
16813
|
+
case 19:
|
|
16735
16814
|
allChannelsQuery = _context2.v;
|
|
16736
16815
|
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery built");
|
|
16737
16816
|
hasNext = true;
|
|
16738
16817
|
totalAllChannelsAdded = 0;
|
|
16739
16818
|
i = 0;
|
|
16740
|
-
case
|
|
16819
|
+
case 20:
|
|
16741
16820
|
if (!(i <= 4)) {
|
|
16742
|
-
_context2.n =
|
|
16821
|
+
_context2.n = 28;
|
|
16743
16822
|
break;
|
|
16744
16823
|
}
|
|
16745
16824
|
if (!hasNext) {
|
|
16746
|
-
_context2.n =
|
|
16825
|
+
_context2.n = 26;
|
|
16747
16826
|
break;
|
|
16748
16827
|
}
|
|
16749
|
-
_context2.p =
|
|
16828
|
+
_context2.p = 21;
|
|
16750
16829
|
_connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
16751
16830
|
if (!(_connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
16752
|
-
_context2.n =
|
|
16831
|
+
_context2.n = 22;
|
|
16753
16832
|
break;
|
|
16754
16833
|
}
|
|
16755
16834
|
log.warn(new Date().toISOString() + " [getChannels] connection not ready, aborting. Status: " + _connectionStatus);
|
|
16756
|
-
return _context2.a(3,
|
|
16757
|
-
case
|
|
16835
|
+
return _context2.a(3, 28);
|
|
16836
|
+
case 22:
|
|
16758
16837
|
log.info(new Date().toISOString() + " [getChannels] loading all channels page: " + (i + 1));
|
|
16759
|
-
_context2.n =
|
|
16838
|
+
_context2.n = 23;
|
|
16760
16839
|
return call(allChannelsQuery.loadNextPage);
|
|
16761
|
-
case
|
|
16840
|
+
case 23:
|
|
16762
16841
|
allChannelsData = _context2.v;
|
|
16763
16842
|
hasNext = allChannelsData.hasNext;
|
|
16764
16843
|
allChannelList = allChannelsData.channels;
|
|
@@ -16769,34 +16848,34 @@ function getChannels(action) {
|
|
|
16769
16848
|
addChannelsToAllChannels(allChannelList);
|
|
16770
16849
|
totalAllChannelsAdded += (allChannelList === null || allChannelList === void 0 ? void 0 : allChannelList.length) || 0;
|
|
16771
16850
|
log.info(new Date().toISOString() + " [getChannels] total all channels added so far: " + totalAllChannelsAdded);
|
|
16772
|
-
_context2.n =
|
|
16851
|
+
_context2.n = 25;
|
|
16773
16852
|
break;
|
|
16774
|
-
case
|
|
16775
|
-
_context2.p =
|
|
16853
|
+
case 24:
|
|
16854
|
+
_context2.p = 24;
|
|
16776
16855
|
_t3 = _context2.v;
|
|
16777
16856
|
log.error(_t3, "Error on get all channels page: " + (i + 1));
|
|
16778
|
-
return _context2.a(3,
|
|
16779
|
-
case 24:
|
|
16780
|
-
_context2.n = 26;
|
|
16781
|
-
break;
|
|
16857
|
+
return _context2.a(3, 28);
|
|
16782
16858
|
case 25:
|
|
16783
|
-
|
|
16859
|
+
_context2.n = 27;
|
|
16860
|
+
break;
|
|
16784
16861
|
case 26:
|
|
16862
|
+
log.info(new Date().toISOString() + " [getChannels] no more pages available, stopping at iteration: " + i);
|
|
16863
|
+
case 27:
|
|
16785
16864
|
i++;
|
|
16786
|
-
_context2.n =
|
|
16865
|
+
_context2.n = 20;
|
|
16787
16866
|
break;
|
|
16788
|
-
case
|
|
16867
|
+
case 28:
|
|
16789
16868
|
log.info(new Date().toISOString() + " [getChannels] all channels query completed, total channels added: " + totalAllChannelsAdded);
|
|
16790
|
-
_context2.n =
|
|
16869
|
+
_context2.n = 30;
|
|
16791
16870
|
break;
|
|
16792
|
-
case 28:
|
|
16793
|
-
log.info(new Date().toISOString() + " [getChannels] skipping all channels query (hiddenList is true)");
|
|
16794
16871
|
case 29:
|
|
16872
|
+
log.info(new Date().toISOString() + " [getChannels] skipping all channels query (hiddenList is true)");
|
|
16873
|
+
case 30:
|
|
16795
16874
|
log.info(new Date().toISOString() + " [getChannels] completed successfully. Final mapped channels count: " + (((_mappedChannels4 = mappedChannels) === null || _mappedChannels4 === void 0 ? void 0 : _mappedChannels4.length) || 0));
|
|
16796
|
-
_context2.n =
|
|
16875
|
+
_context2.n = 32;
|
|
16797
16876
|
break;
|
|
16798
|
-
case
|
|
16799
|
-
_context2.p =
|
|
16877
|
+
case 31:
|
|
16878
|
+
_context2.p = 31;
|
|
16800
16879
|
_t4 = _context2.v;
|
|
16801
16880
|
log.error(new Date().toISOString() + " [getChannels] error occurred: " + JSON.stringify(_t4), 'Error on get channels');
|
|
16802
16881
|
log.error(new Date().toISOString() + " [getChannels] error details: " + JSON.stringify({
|
|
@@ -16804,10 +16883,10 @@ function getChannels(action) {
|
|
|
16804
16883
|
code: _t4.code,
|
|
16805
16884
|
stack: _t4.stack
|
|
16806
16885
|
}));
|
|
16807
|
-
case
|
|
16886
|
+
case 32:
|
|
16808
16887
|
return _context2.a(2);
|
|
16809
16888
|
}
|
|
16810
|
-
}, _marked2$1, null, [[
|
|
16889
|
+
}, _marked2$1, null, [[21, 24], [1, 31]]);
|
|
16811
16890
|
}
|
|
16812
16891
|
function searchChannels(action) {
|
|
16813
16892
|
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;
|
|
@@ -17878,50 +17957,52 @@ function leaveChannel(action) {
|
|
|
17878
17957
|
}
|
|
17879
17958
|
}, _marked18, null, [[0, 6]]);
|
|
17880
17959
|
}
|
|
17881
|
-
function
|
|
17882
|
-
var
|
|
17960
|
+
function deletePendingDeleteChannels() {
|
|
17961
|
+
var pendingDeleteChannels, _iterator6, _step6, channel, resendableError, _t20;
|
|
17883
17962
|
return _regenerator().w(function (_context19) {
|
|
17884
17963
|
while (1) switch (_context19.p = _context19.n) {
|
|
17885
17964
|
case 0:
|
|
17886
|
-
|
|
17887
|
-
|
|
17888
|
-
channelId = payload.channelId;
|
|
17889
|
-
_context19.n = 1;
|
|
17890
|
-
return call(getChannelFromMap, channelId);
|
|
17965
|
+
pendingDeleteChannels = getPendingDeleteChannels();
|
|
17966
|
+
_iterator6 = _createForOfIteratorHelperLoose(pendingDeleteChannels);
|
|
17891
17967
|
case 1:
|
|
17892
|
-
|
|
17893
|
-
|
|
17894
|
-
channel = getChannelFromAllChannels(channelId);
|
|
17895
|
-
}
|
|
17896
|
-
if (!channel) {
|
|
17897
|
-
_context19.n = 5;
|
|
17968
|
+
if ((_step6 = _iterator6()).done) {
|
|
17969
|
+
_context19.n = 9;
|
|
17898
17970
|
break;
|
|
17899
17971
|
}
|
|
17900
|
-
|
|
17901
|
-
|
|
17902
|
-
case 2:
|
|
17972
|
+
channel = _step6.value;
|
|
17973
|
+
_context19.p = 2;
|
|
17903
17974
|
_context19.n = 3;
|
|
17904
|
-
return
|
|
17975
|
+
return call(channel["delete"]);
|
|
17905
17976
|
case 3:
|
|
17906
17977
|
_context19.n = 4;
|
|
17907
|
-
return put(
|
|
17978
|
+
return put(setChannelToRemoveAC(channel));
|
|
17908
17979
|
case 4:
|
|
17909
17980
|
_context19.n = 5;
|
|
17910
|
-
return put(
|
|
17981
|
+
return put(removeChannelAC(channel.id));
|
|
17911
17982
|
case 5:
|
|
17912
|
-
_context19.n =
|
|
17913
|
-
|
|
17983
|
+
_context19.n = 6;
|
|
17984
|
+
return put(removeChannelCachesAC(channel.id));
|
|
17914
17985
|
case 6:
|
|
17915
|
-
|
|
17916
|
-
|
|
17917
|
-
|
|
17986
|
+
removePendingDeleteChannel(channel.id);
|
|
17987
|
+
_context19.n = 8;
|
|
17988
|
+
break;
|
|
17918
17989
|
case 7:
|
|
17990
|
+
_context19.p = 7;
|
|
17991
|
+
_t20 = _context19.v;
|
|
17992
|
+
resendableError = isResendableError(_t20 === null || _t20 === void 0 ? void 0 : _t20.type);
|
|
17993
|
+
if (!resendableError) {
|
|
17994
|
+
removePendingDeleteChannel(channel.id);
|
|
17995
|
+
}
|
|
17996
|
+
case 8:
|
|
17997
|
+
_context19.n = 1;
|
|
17998
|
+
break;
|
|
17999
|
+
case 9:
|
|
17919
18000
|
return _context19.a(2);
|
|
17920
18001
|
}
|
|
17921
|
-
}, _marked19, null, [[
|
|
18002
|
+
}, _marked19, null, [[2, 7]]);
|
|
17922
18003
|
}
|
|
17923
|
-
function
|
|
17924
|
-
var payload, channelId, channel, _t21;
|
|
18004
|
+
function deleteChannel(action) {
|
|
18005
|
+
var payload, channelId, channel, activeChannelId, lastChannel, _t21;
|
|
17925
18006
|
return _regenerator().w(function (_context20) {
|
|
17926
18007
|
while (1) switch (_context20.p = _context20.n) {
|
|
17927
18008
|
case 0:
|
|
@@ -17935,39 +18016,63 @@ function blockChannel(action) {
|
|
|
17935
18016
|
if (!channel) {
|
|
17936
18017
|
channel = getChannelFromAllChannels(channelId);
|
|
17937
18018
|
}
|
|
17938
|
-
if (!
|
|
17939
|
-
_context20.n =
|
|
18019
|
+
if (!(store.getState().UserReducer.connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
18020
|
+
_context20.n = 5;
|
|
17940
18021
|
break;
|
|
17941
18022
|
}
|
|
18023
|
+
setPendingDeleteChannel(channel);
|
|
17942
18024
|
_context20.n = 2;
|
|
17943
|
-
return call(
|
|
18025
|
+
return call(getActiveChannelId);
|
|
17944
18026
|
case 2:
|
|
18027
|
+
activeChannelId = _context20.v;
|
|
18028
|
+
if (!(activeChannelId === channelId)) {
|
|
18029
|
+
_context20.n = 4;
|
|
18030
|
+
break;
|
|
18031
|
+
}
|
|
17945
18032
|
_context20.n = 3;
|
|
17946
|
-
return
|
|
18033
|
+
return call(getLastChannelFromMap, true);
|
|
17947
18034
|
case 3:
|
|
18035
|
+
lastChannel = _context20.v;
|
|
17948
18036
|
_context20.n = 4;
|
|
17949
|
-
return put(
|
|
18037
|
+
return put(switchChannelActionAC(lastChannel || null));
|
|
17950
18038
|
case 4:
|
|
18039
|
+
return _context20.a(2);
|
|
18040
|
+
case 5:
|
|
18041
|
+
if (!channel) {
|
|
18042
|
+
_context20.n = 9;
|
|
18043
|
+
break;
|
|
18044
|
+
}
|
|
17951
18045
|
_context20.n = 6;
|
|
18046
|
+
return call(channel["delete"]);
|
|
18047
|
+
case 6:
|
|
18048
|
+
_context20.n = 7;
|
|
18049
|
+
return put(setChannelToRemoveAC(channel));
|
|
18050
|
+
case 7:
|
|
18051
|
+
_context20.n = 8;
|
|
18052
|
+
return put(removeChannelAC(channelId));
|
|
18053
|
+
case 8:
|
|
18054
|
+
_context20.n = 9;
|
|
18055
|
+
return put(removeChannelCachesAC(channelId));
|
|
18056
|
+
case 9:
|
|
18057
|
+
_context20.n = 11;
|
|
17952
18058
|
break;
|
|
17953
|
-
case
|
|
17954
|
-
_context20.p =
|
|
18059
|
+
case 10:
|
|
18060
|
+
_context20.p = 10;
|
|
17955
18061
|
_t21 = _context20.v;
|
|
17956
|
-
log.error('ERROR in
|
|
17957
|
-
case
|
|
18062
|
+
log.error('ERROR in delete channel', _t21);
|
|
18063
|
+
case 11:
|
|
17958
18064
|
return _context20.a(2);
|
|
17959
18065
|
}
|
|
17960
|
-
}, _marked20, null, [[0,
|
|
18066
|
+
}, _marked20, null, [[0, 10]]);
|
|
17961
18067
|
}
|
|
17962
|
-
function
|
|
17963
|
-
var payload, channelId,
|
|
18068
|
+
function blockChannel(action) {
|
|
18069
|
+
var payload, channelId, channel, _t22;
|
|
17964
18070
|
return _regenerator().w(function (_context21) {
|
|
17965
18071
|
while (1) switch (_context21.p = _context21.n) {
|
|
17966
18072
|
case 0:
|
|
17967
18073
|
_context21.p = 0;
|
|
17968
18074
|
payload = action.payload;
|
|
17969
|
-
channelId = payload.channelId
|
|
17970
|
-
_SceytChatClient6 = getClient();
|
|
18075
|
+
channelId = payload.channelId;
|
|
17971
18076
|
_context21.n = 1;
|
|
17972
18077
|
return call(getChannelFromMap, channelId);
|
|
17973
18078
|
case 1:
|
|
@@ -17975,6 +18080,46 @@ function updateChannel(action) {
|
|
|
17975
18080
|
if (!channel) {
|
|
17976
18081
|
channel = getChannelFromAllChannels(channelId);
|
|
17977
18082
|
}
|
|
18083
|
+
if (!channel) {
|
|
18084
|
+
_context21.n = 4;
|
|
18085
|
+
break;
|
|
18086
|
+
}
|
|
18087
|
+
_context21.n = 2;
|
|
18088
|
+
return call(channel.block);
|
|
18089
|
+
case 2:
|
|
18090
|
+
_context21.n = 3;
|
|
18091
|
+
return put(removeChannelAC(channelId));
|
|
18092
|
+
case 3:
|
|
18093
|
+
_context21.n = 4;
|
|
18094
|
+
return put(removeChannelCachesAC(channelId));
|
|
18095
|
+
case 4:
|
|
18096
|
+
_context21.n = 6;
|
|
18097
|
+
break;
|
|
18098
|
+
case 5:
|
|
18099
|
+
_context21.p = 5;
|
|
18100
|
+
_t22 = _context21.v;
|
|
18101
|
+
log.error('ERROR in block channel - ', _t22.message);
|
|
18102
|
+
case 6:
|
|
18103
|
+
return _context21.a(2);
|
|
18104
|
+
}
|
|
18105
|
+
}, _marked21, null, [[0, 5]]);
|
|
18106
|
+
}
|
|
18107
|
+
function updateChannel(action) {
|
|
18108
|
+
var payload, channelId, config, _SceytChatClient6, channel, paramsToUpdate, fileToUpload, _yield$call5, subject, avatarUrl, metadata, onUpdateChannel, _channel3, _channel4, _channel5, fields, updatedChannel, _t23;
|
|
18109
|
+
return _regenerator().w(function (_context22) {
|
|
18110
|
+
while (1) switch (_context22.p = _context22.n) {
|
|
18111
|
+
case 0:
|
|
18112
|
+
_context22.p = 0;
|
|
18113
|
+
payload = action.payload;
|
|
18114
|
+
channelId = payload.channelId, config = payload.config;
|
|
18115
|
+
_SceytChatClient6 = getClient();
|
|
18116
|
+
_context22.n = 1;
|
|
18117
|
+
return call(getChannelFromMap, channelId);
|
|
18118
|
+
case 1:
|
|
18119
|
+
channel = _context22.v;
|
|
18120
|
+
if (!channel) {
|
|
18121
|
+
channel = getChannelFromAllChannels(channelId);
|
|
18122
|
+
}
|
|
17978
18123
|
paramsToUpdate = {
|
|
17979
18124
|
uri: channel.uri,
|
|
17980
18125
|
subject: channel.subject,
|
|
@@ -17982,7 +18127,7 @@ function updateChannel(action) {
|
|
|
17982
18127
|
avatarUrl: channel.avatarUrl
|
|
17983
18128
|
};
|
|
17984
18129
|
if (!config.avatar) {
|
|
17985
|
-
|
|
18130
|
+
_context22.n = 3;
|
|
17986
18131
|
break;
|
|
17987
18132
|
}
|
|
17988
18133
|
fileToUpload = {
|
|
@@ -17991,10 +18136,10 @@ function updateChannel(action) {
|
|
|
17991
18136
|
log.info('upload percent - ', progressPercent);
|
|
17992
18137
|
}
|
|
17993
18138
|
};
|
|
17994
|
-
|
|
18139
|
+
_context22.n = 2;
|
|
17995
18140
|
return call(_SceytChatClient6.uploadFile, fileToUpload);
|
|
17996
18141
|
case 2:
|
|
17997
|
-
paramsToUpdate.avatarUrl =
|
|
18142
|
+
paramsToUpdate.avatarUrl = _context22.v;
|
|
17998
18143
|
case 3:
|
|
17999
18144
|
if (config.subject) {
|
|
18000
18145
|
paramsToUpdate.subject = config.subject;
|
|
@@ -18005,14 +18150,14 @@ function updateChannel(action) {
|
|
|
18005
18150
|
if (config.avatarUrl === '') {
|
|
18006
18151
|
paramsToUpdate.avatarUrl = '';
|
|
18007
18152
|
}
|
|
18008
|
-
|
|
18153
|
+
_context22.n = 4;
|
|
18009
18154
|
return call(channel.update, paramsToUpdate);
|
|
18010
18155
|
case 4:
|
|
18011
|
-
_yield$call5 =
|
|
18156
|
+
_yield$call5 = _context22.v;
|
|
18012
18157
|
subject = _yield$call5.subject;
|
|
18013
18158
|
avatarUrl = _yield$call5.avatarUrl;
|
|
18014
18159
|
metadata = _yield$call5.metadata;
|
|
18015
|
-
|
|
18160
|
+
_context22.n = 5;
|
|
18016
18161
|
return put(updateChannelDataAC(channelId, {
|
|
18017
18162
|
subject: subject,
|
|
18018
18163
|
avatarUrl: avatarUrl,
|
|
@@ -18026,7 +18171,7 @@ function updateChannel(action) {
|
|
|
18026
18171
|
});
|
|
18027
18172
|
onUpdateChannel = getOnUpdateChannel();
|
|
18028
18173
|
if (!onUpdateChannel) {
|
|
18029
|
-
|
|
18174
|
+
_context22.n = 7;
|
|
18030
18175
|
break;
|
|
18031
18176
|
}
|
|
18032
18177
|
fields = [];
|
|
@@ -18039,35 +18184,35 @@ function updateChannel(action) {
|
|
|
18039
18184
|
if (JSON.stringify((_channel5 = channel) === null || _channel5 === void 0 ? void 0 : _channel5.metadata) !== metadata) {
|
|
18040
18185
|
fields.push('metadata');
|
|
18041
18186
|
}
|
|
18042
|
-
|
|
18187
|
+
_context22.n = 6;
|
|
18043
18188
|
return call(getChannelFromMap, channelId);
|
|
18044
18189
|
case 6:
|
|
18045
|
-
updatedChannel =
|
|
18190
|
+
updatedChannel = _context22.v;
|
|
18046
18191
|
onUpdateChannel(updatedChannel, fields);
|
|
18047
18192
|
case 7:
|
|
18048
|
-
|
|
18193
|
+
_context22.n = 9;
|
|
18049
18194
|
break;
|
|
18050
18195
|
case 8:
|
|
18051
|
-
|
|
18052
|
-
|
|
18053
|
-
log.error('ERROR in update channel',
|
|
18196
|
+
_context22.p = 8;
|
|
18197
|
+
_t23 = _context22.v;
|
|
18198
|
+
log.error('ERROR in update channel', _t23.message);
|
|
18054
18199
|
case 9:
|
|
18055
|
-
return
|
|
18200
|
+
return _context22.a(2);
|
|
18056
18201
|
}
|
|
18057
|
-
},
|
|
18202
|
+
}, _marked22, null, [[0, 8]]);
|
|
18058
18203
|
}
|
|
18059
18204
|
function checkUsersStatus() {
|
|
18060
|
-
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData,
|
|
18061
|
-
return _regenerator().w(function (
|
|
18062
|
-
while (1) switch (
|
|
18205
|
+
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData, _t24;
|
|
18206
|
+
return _regenerator().w(function (_context23) {
|
|
18207
|
+
while (1) switch (_context23.p = _context23.n) {
|
|
18063
18208
|
case 0:
|
|
18064
|
-
|
|
18209
|
+
_context23.p = 0;
|
|
18065
18210
|
_SceytChatClient7 = getClient();
|
|
18066
18211
|
usersForUpdate = Object.keys(usersMap);
|
|
18067
|
-
|
|
18212
|
+
_context23.n = 1;
|
|
18068
18213
|
return call(_SceytChatClient7.getUsers, usersForUpdate);
|
|
18069
18214
|
case 1:
|
|
18070
|
-
updatedUsers =
|
|
18215
|
+
updatedUsers = _context23.v;
|
|
18071
18216
|
usersToUpdateMap = {};
|
|
18072
18217
|
update = false;
|
|
18073
18218
|
updatedUsers.forEach(function (updatedUser) {
|
|
@@ -18079,149 +18224,149 @@ function checkUsersStatus() {
|
|
|
18079
18224
|
}
|
|
18080
18225
|
});
|
|
18081
18226
|
if (!update) {
|
|
18082
|
-
|
|
18227
|
+
_context23.n = 4;
|
|
18083
18228
|
break;
|
|
18084
18229
|
}
|
|
18085
18230
|
updateData = JSON.parse(JSON.stringify(usersToUpdateMap));
|
|
18086
|
-
|
|
18231
|
+
_context23.n = 2;
|
|
18087
18232
|
return put(updateMembersPresenceAC(updateData));
|
|
18088
18233
|
case 2:
|
|
18089
|
-
|
|
18234
|
+
_context23.n = 3;
|
|
18090
18235
|
return put(updateUserStatusOnMapAC(updateData));
|
|
18091
18236
|
case 3:
|
|
18092
|
-
|
|
18237
|
+
_context23.n = 4;
|
|
18093
18238
|
return put(updateUserStatusOnChannelAC(updateData));
|
|
18094
18239
|
case 4:
|
|
18095
|
-
|
|
18240
|
+
_context23.n = 6;
|
|
18096
18241
|
break;
|
|
18097
18242
|
case 5:
|
|
18098
|
-
|
|
18099
|
-
|
|
18100
|
-
log.error('ERROR in check user status : ',
|
|
18243
|
+
_context23.p = 5;
|
|
18244
|
+
_t24 = _context23.v;
|
|
18245
|
+
log.error('ERROR in check user status : ', _t24.message);
|
|
18101
18246
|
case 6:
|
|
18102
|
-
return
|
|
18247
|
+
return _context23.a(2);
|
|
18103
18248
|
}
|
|
18104
|
-
},
|
|
18249
|
+
}, _marked23, null, [[0, 5]]);
|
|
18105
18250
|
}
|
|
18106
18251
|
function sendTyping(action) {
|
|
18107
|
-
var state, activeChannelId, channel,
|
|
18108
|
-
return _regenerator().w(function (
|
|
18109
|
-
while (1) switch (
|
|
18252
|
+
var state, activeChannelId, channel, _t25;
|
|
18253
|
+
return _regenerator().w(function (_context24) {
|
|
18254
|
+
while (1) switch (_context24.p = _context24.n) {
|
|
18110
18255
|
case 0:
|
|
18111
18256
|
state = action.payload.state;
|
|
18112
|
-
|
|
18257
|
+
_context24.n = 1;
|
|
18113
18258
|
return call(getActiveChannelId);
|
|
18114
18259
|
case 1:
|
|
18115
|
-
activeChannelId =
|
|
18116
|
-
|
|
18260
|
+
activeChannelId = _context24.v;
|
|
18261
|
+
_context24.n = 2;
|
|
18117
18262
|
return call(getChannelFromMap, activeChannelId);
|
|
18118
18263
|
case 2:
|
|
18119
|
-
channel =
|
|
18120
|
-
|
|
18264
|
+
channel = _context24.v;
|
|
18265
|
+
_context24.p = 3;
|
|
18121
18266
|
if (!channel) {
|
|
18122
|
-
|
|
18267
|
+
_context24.n = 6;
|
|
18123
18268
|
break;
|
|
18124
18269
|
}
|
|
18125
18270
|
if (!state) {
|
|
18126
|
-
|
|
18271
|
+
_context24.n = 5;
|
|
18127
18272
|
break;
|
|
18128
18273
|
}
|
|
18129
|
-
|
|
18274
|
+
_context24.n = 4;
|
|
18130
18275
|
return call(channel.startTyping);
|
|
18131
18276
|
case 4:
|
|
18132
|
-
|
|
18277
|
+
_context24.n = 6;
|
|
18133
18278
|
break;
|
|
18134
18279
|
case 5:
|
|
18135
|
-
|
|
18280
|
+
_context24.n = 6;
|
|
18136
18281
|
return call(channel.stopTyping);
|
|
18137
18282
|
case 6:
|
|
18138
|
-
|
|
18283
|
+
_context24.n = 8;
|
|
18139
18284
|
break;
|
|
18140
18285
|
case 7:
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
log.error('ERROR in send typing',
|
|
18286
|
+
_context24.p = 7;
|
|
18287
|
+
_t25 = _context24.v;
|
|
18288
|
+
log.error('ERROR in send typing', _t25);
|
|
18144
18289
|
case 8:
|
|
18145
|
-
return
|
|
18290
|
+
return _context24.a(2);
|
|
18146
18291
|
}
|
|
18147
|
-
},
|
|
18292
|
+
}, _marked24, null, [[3, 7]]);
|
|
18148
18293
|
}
|
|
18149
18294
|
function sendRecording(action) {
|
|
18150
|
-
var _action$payload, state, channelId, channel,
|
|
18151
|
-
return _regenerator().w(function (
|
|
18152
|
-
while (1) switch (
|
|
18295
|
+
var _action$payload, state, channelId, channel, _t26;
|
|
18296
|
+
return _regenerator().w(function (_context25) {
|
|
18297
|
+
while (1) switch (_context25.p = _context25.n) {
|
|
18153
18298
|
case 0:
|
|
18154
18299
|
_action$payload = action.payload, state = _action$payload.state, channelId = _action$payload.channelId;
|
|
18155
|
-
|
|
18300
|
+
_context25.n = 1;
|
|
18156
18301
|
return call(getChannelFromMap, channelId);
|
|
18157
18302
|
case 1:
|
|
18158
|
-
channel =
|
|
18159
|
-
|
|
18303
|
+
channel = _context25.v;
|
|
18304
|
+
_context25.p = 2;
|
|
18160
18305
|
if (!channel) {
|
|
18161
|
-
|
|
18306
|
+
_context25.n = 5;
|
|
18162
18307
|
break;
|
|
18163
18308
|
}
|
|
18164
18309
|
if (!state) {
|
|
18165
|
-
|
|
18310
|
+
_context25.n = 4;
|
|
18166
18311
|
break;
|
|
18167
18312
|
}
|
|
18168
|
-
|
|
18313
|
+
_context25.n = 3;
|
|
18169
18314
|
return call(channel.startRecording);
|
|
18170
18315
|
case 3:
|
|
18171
|
-
|
|
18316
|
+
_context25.n = 5;
|
|
18172
18317
|
break;
|
|
18173
18318
|
case 4:
|
|
18174
|
-
|
|
18319
|
+
_context25.n = 5;
|
|
18175
18320
|
return call(channel.stopRecording);
|
|
18176
18321
|
case 5:
|
|
18177
|
-
|
|
18322
|
+
_context25.n = 7;
|
|
18178
18323
|
break;
|
|
18179
18324
|
case 6:
|
|
18180
|
-
|
|
18181
|
-
|
|
18182
|
-
log.error('ERROR in send recording',
|
|
18325
|
+
_context25.p = 6;
|
|
18326
|
+
_t26 = _context25.v;
|
|
18327
|
+
log.error('ERROR in send recording', _t26);
|
|
18183
18328
|
case 7:
|
|
18184
|
-
return
|
|
18329
|
+
return _context25.a(2);
|
|
18185
18330
|
}
|
|
18186
|
-
},
|
|
18331
|
+
}, _marked25, null, [[2, 6]]);
|
|
18187
18332
|
}
|
|
18188
18333
|
function clearHistory(action) {
|
|
18189
|
-
var payload, channelId, channel, activeChannelId, groupName,
|
|
18190
|
-
return _regenerator().w(function (
|
|
18191
|
-
while (1) switch (
|
|
18334
|
+
var payload, channelId, channel, activeChannelId, groupName, _t27;
|
|
18335
|
+
return _regenerator().w(function (_context26) {
|
|
18336
|
+
while (1) switch (_context26.p = _context26.n) {
|
|
18192
18337
|
case 0:
|
|
18193
|
-
|
|
18338
|
+
_context26.p = 0;
|
|
18194
18339
|
payload = action.payload;
|
|
18195
18340
|
channelId = payload.channelId;
|
|
18196
|
-
|
|
18341
|
+
_context26.n = 1;
|
|
18197
18342
|
return call(getChannelFromMap, channelId);
|
|
18198
18343
|
case 1:
|
|
18199
|
-
channel =
|
|
18344
|
+
channel = _context26.v;
|
|
18200
18345
|
if (!channel) {
|
|
18201
18346
|
channel = getChannelFromAllChannels(channelId);
|
|
18202
18347
|
}
|
|
18203
|
-
|
|
18348
|
+
_context26.n = 2;
|
|
18204
18349
|
return call(getActiveChannelId);
|
|
18205
18350
|
case 2:
|
|
18206
|
-
activeChannelId =
|
|
18351
|
+
activeChannelId = _context26.v;
|
|
18207
18352
|
if (!channel) {
|
|
18208
|
-
|
|
18353
|
+
_context26.n = 7;
|
|
18209
18354
|
break;
|
|
18210
18355
|
}
|
|
18211
|
-
|
|
18356
|
+
_context26.n = 3;
|
|
18212
18357
|
return call(channel.deleteAllMessages);
|
|
18213
18358
|
case 3:
|
|
18214
|
-
|
|
18359
|
+
_context26.n = 4;
|
|
18215
18360
|
return put(clearMessagesAC());
|
|
18216
18361
|
case 4:
|
|
18217
18362
|
removeMessagesFromMap(channelId);
|
|
18218
18363
|
if (channelId === activeChannelId) {
|
|
18219
18364
|
removeAllMessages();
|
|
18220
18365
|
}
|
|
18221
|
-
|
|
18366
|
+
_context26.n = 5;
|
|
18222
18367
|
return put(clearSelectedMessagesAC());
|
|
18223
18368
|
case 5:
|
|
18224
|
-
|
|
18369
|
+
_context26.n = 6;
|
|
18225
18370
|
return put(updateChannelDataAC(channel.id, {
|
|
18226
18371
|
lastMessage: null,
|
|
18227
18372
|
newMessageCount: 0,
|
|
@@ -18234,64 +18379,64 @@ function clearHistory(action) {
|
|
|
18234
18379
|
newMentionCount: 0
|
|
18235
18380
|
});
|
|
18236
18381
|
groupName = getChannelGroupName(channel);
|
|
18237
|
-
|
|
18382
|
+
_context26.n = 7;
|
|
18238
18383
|
return put(updateSearchedChannelDataAC(channel.id, {
|
|
18239
18384
|
lastMessage: null,
|
|
18240
18385
|
newMessageCount: 0,
|
|
18241
18386
|
newMentionCount: 0
|
|
18242
18387
|
}, groupName));
|
|
18243
18388
|
case 7:
|
|
18244
|
-
|
|
18389
|
+
_context26.n = 9;
|
|
18245
18390
|
break;
|
|
18246
18391
|
case 8:
|
|
18247
|
-
|
|
18248
|
-
|
|
18249
|
-
log.error('ERROR in clear history',
|
|
18392
|
+
_context26.p = 8;
|
|
18393
|
+
_t27 = _context26.v;
|
|
18394
|
+
log.error('ERROR in clear history', _t27);
|
|
18250
18395
|
case 9:
|
|
18251
|
-
return
|
|
18396
|
+
return _context26.a(2);
|
|
18252
18397
|
}
|
|
18253
|
-
},
|
|
18398
|
+
}, _marked26, null, [[0, 8]]);
|
|
18254
18399
|
}
|
|
18255
18400
|
function deleteAllMessages(action) {
|
|
18256
|
-
var payload, channelId, channel, activeChannelId, groupName,
|
|
18257
|
-
return _regenerator().w(function (
|
|
18258
|
-
while (1) switch (
|
|
18401
|
+
var payload, channelId, channel, activeChannelId, groupName, _t28;
|
|
18402
|
+
return _regenerator().w(function (_context27) {
|
|
18403
|
+
while (1) switch (_context27.p = _context27.n) {
|
|
18259
18404
|
case 0:
|
|
18260
|
-
|
|
18405
|
+
_context27.p = 0;
|
|
18261
18406
|
payload = action.payload;
|
|
18262
18407
|
channelId = payload.channelId;
|
|
18263
|
-
|
|
18408
|
+
_context27.n = 1;
|
|
18264
18409
|
return call(getChannelFromMap, channelId);
|
|
18265
18410
|
case 1:
|
|
18266
|
-
channel =
|
|
18411
|
+
channel = _context27.v;
|
|
18267
18412
|
if (!channel) {
|
|
18268
18413
|
channel = getChannelFromAllChannels(channelId);
|
|
18269
18414
|
}
|
|
18270
|
-
|
|
18415
|
+
_context27.n = 2;
|
|
18271
18416
|
return call(getActiveChannelId);
|
|
18272
18417
|
case 2:
|
|
18273
|
-
activeChannelId =
|
|
18418
|
+
activeChannelId = _context27.v;
|
|
18274
18419
|
if (!channel) {
|
|
18275
|
-
|
|
18420
|
+
_context27.n = 8;
|
|
18276
18421
|
break;
|
|
18277
18422
|
}
|
|
18278
|
-
|
|
18423
|
+
_context27.n = 3;
|
|
18279
18424
|
return call(channel.deleteAllMessages, true);
|
|
18280
18425
|
case 3:
|
|
18281
18426
|
removeMessagesFromMap(channelId);
|
|
18282
18427
|
if (!(channelId === activeChannelId)) {
|
|
18283
|
-
|
|
18428
|
+
_context27.n = 5;
|
|
18284
18429
|
break;
|
|
18285
18430
|
}
|
|
18286
|
-
|
|
18431
|
+
_context27.n = 4;
|
|
18287
18432
|
return put(clearMessagesAC());
|
|
18288
18433
|
case 4:
|
|
18289
18434
|
removeAllMessages();
|
|
18290
18435
|
case 5:
|
|
18291
|
-
|
|
18436
|
+
_context27.n = 6;
|
|
18292
18437
|
return put(clearSelectedMessagesAC());
|
|
18293
18438
|
case 6:
|
|
18294
|
-
|
|
18439
|
+
_context27.n = 7;
|
|
18295
18440
|
return put(updateChannelDataAC(channel.id, {
|
|
18296
18441
|
lastMessage: null,
|
|
18297
18442
|
newMessageCount: 0,
|
|
@@ -18304,230 +18449,230 @@ function deleteAllMessages(action) {
|
|
|
18304
18449
|
newMentionCount: 0
|
|
18305
18450
|
});
|
|
18306
18451
|
groupName = getChannelGroupName(channel);
|
|
18307
|
-
|
|
18452
|
+
_context27.n = 8;
|
|
18308
18453
|
return put(updateSearchedChannelDataAC(channel.id, {
|
|
18309
18454
|
lastMessage: null,
|
|
18310
18455
|
newMessageCount: 0,
|
|
18311
18456
|
newMentionCount: 0
|
|
18312
18457
|
}, groupName));
|
|
18313
18458
|
case 8:
|
|
18314
|
-
|
|
18459
|
+
_context27.n = 10;
|
|
18315
18460
|
break;
|
|
18316
18461
|
case 9:
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
log.error('ERROR in clear history',
|
|
18462
|
+
_context27.p = 9;
|
|
18463
|
+
_t28 = _context27.v;
|
|
18464
|
+
log.error('ERROR in clear history', _t28);
|
|
18320
18465
|
case 10:
|
|
18321
|
-
return
|
|
18466
|
+
return _context27.a(2);
|
|
18322
18467
|
}
|
|
18323
|
-
},
|
|
18468
|
+
}, _marked27, null, [[0, 9]]);
|
|
18324
18469
|
}
|
|
18325
18470
|
function joinChannel(action) {
|
|
18326
|
-
var payload, channelId, _SceytChatClient8, channel, joinedChannel,
|
|
18327
|
-
return _regenerator().w(function (
|
|
18328
|
-
while (1) switch (
|
|
18471
|
+
var payload, channelId, _SceytChatClient8, channel, joinedChannel, _t29;
|
|
18472
|
+
return _regenerator().w(function (_context28) {
|
|
18473
|
+
while (1) switch (_context28.p = _context28.n) {
|
|
18329
18474
|
case 0:
|
|
18330
|
-
|
|
18475
|
+
_context28.p = 0;
|
|
18331
18476
|
payload = action.payload;
|
|
18332
18477
|
channelId = payload.channelId;
|
|
18333
18478
|
_SceytChatClient8 = getClient();
|
|
18334
|
-
|
|
18479
|
+
_context28.n = 1;
|
|
18335
18480
|
return call(getChannelFromMap, channelId);
|
|
18336
18481
|
case 1:
|
|
18337
|
-
channel =
|
|
18482
|
+
channel = _context28.v;
|
|
18338
18483
|
if (!channel) {
|
|
18339
18484
|
channel = getChannelFromAllChannels(channelId);
|
|
18340
18485
|
}
|
|
18341
18486
|
if (channel) {
|
|
18342
|
-
|
|
18487
|
+
_context28.n = 3;
|
|
18343
18488
|
break;
|
|
18344
18489
|
}
|
|
18345
|
-
|
|
18490
|
+
_context28.n = 2;
|
|
18346
18491
|
return call(_SceytChatClient8.getChannel, channelId);
|
|
18347
18492
|
case 2:
|
|
18348
|
-
channel =
|
|
18493
|
+
channel = _context28.v;
|
|
18349
18494
|
case 3:
|
|
18350
|
-
|
|
18495
|
+
_context28.n = 4;
|
|
18351
18496
|
return call(channel.join);
|
|
18352
18497
|
case 4:
|
|
18353
|
-
joinedChannel =
|
|
18354
|
-
|
|
18498
|
+
joinedChannel = _context28.v;
|
|
18499
|
+
_context28.n = 5;
|
|
18355
18500
|
return put(setCloseSearchChannelsAC(true));
|
|
18356
18501
|
case 5:
|
|
18357
|
-
|
|
18502
|
+
_context28.n = 6;
|
|
18358
18503
|
return put(setChannelToAddAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
18359
18504
|
case 6:
|
|
18360
|
-
|
|
18505
|
+
_context28.n = 7;
|
|
18361
18506
|
return put(switchChannelActionAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
18362
18507
|
case 7:
|
|
18363
18508
|
addChannelToAllChannels(joinedChannel);
|
|
18364
|
-
|
|
18509
|
+
_context28.n = 8;
|
|
18365
18510
|
return call(setActiveChannelId, joinedChannel.id);
|
|
18366
18511
|
case 8:
|
|
18367
|
-
|
|
18512
|
+
_context28.n = 10;
|
|
18368
18513
|
break;
|
|
18369
18514
|
case 9:
|
|
18370
|
-
|
|
18371
|
-
|
|
18372
|
-
log.error(
|
|
18515
|
+
_context28.p = 9;
|
|
18516
|
+
_t29 = _context28.v;
|
|
18517
|
+
log.error(_t29, 'Error in join to channel');
|
|
18373
18518
|
case 10:
|
|
18374
|
-
return
|
|
18519
|
+
return _context28.a(2);
|
|
18375
18520
|
}
|
|
18376
|
-
},
|
|
18521
|
+
}, _marked28, null, [[0, 9]]);
|
|
18377
18522
|
}
|
|
18378
18523
|
function watchForChannelEvents() {
|
|
18379
|
-
return _regenerator().w(function (
|
|
18380
|
-
while (1) switch (
|
|
18524
|
+
return _regenerator().w(function (_context29) {
|
|
18525
|
+
while (1) switch (_context29.n) {
|
|
18381
18526
|
case 0:
|
|
18382
|
-
|
|
18527
|
+
_context29.n = 1;
|
|
18383
18528
|
return call(watchForEvents);
|
|
18384
18529
|
case 1:
|
|
18385
|
-
return
|
|
18530
|
+
return _context29.a(2);
|
|
18386
18531
|
}
|
|
18387
|
-
},
|
|
18532
|
+
}, _marked29);
|
|
18388
18533
|
}
|
|
18389
18534
|
function createChannelInviteKey(action) {
|
|
18390
|
-
var payload, channelId, _SceytChatClient9, channel, inviteKey,
|
|
18391
|
-
return _regenerator().w(function (
|
|
18392
|
-
while (1) switch (
|
|
18535
|
+
var payload, channelId, _SceytChatClient9, channel, inviteKey, _t30;
|
|
18536
|
+
return _regenerator().w(function (_context30) {
|
|
18537
|
+
while (1) switch (_context30.p = _context30.n) {
|
|
18393
18538
|
case 0:
|
|
18394
|
-
|
|
18539
|
+
_context30.p = 0;
|
|
18395
18540
|
payload = action.payload;
|
|
18396
18541
|
channelId = payload.channelId;
|
|
18397
18542
|
_SceytChatClient9 = getClient();
|
|
18398
|
-
|
|
18543
|
+
_context30.n = 1;
|
|
18399
18544
|
return call(getChannelFromMap, channelId);
|
|
18400
18545
|
case 1:
|
|
18401
|
-
channel =
|
|
18546
|
+
channel = _context30.v;
|
|
18402
18547
|
if (!channel) {
|
|
18403
18548
|
channel = getChannelFromAllChannels(channelId);
|
|
18404
18549
|
}
|
|
18405
18550
|
if (!channel) {
|
|
18406
|
-
|
|
18551
|
+
_context30.n = 3;
|
|
18407
18552
|
break;
|
|
18408
18553
|
}
|
|
18409
|
-
|
|
18554
|
+
_context30.n = 2;
|
|
18410
18555
|
return call(_SceytChatClient9.createInviteKey, {
|
|
18411
18556
|
maxUses: 0,
|
|
18412
18557
|
expiresAt: 0,
|
|
18413
18558
|
accessPriorHistory: true
|
|
18414
18559
|
});
|
|
18415
18560
|
case 2:
|
|
18416
|
-
inviteKey =
|
|
18417
|
-
|
|
18561
|
+
inviteKey = _context30.v;
|
|
18562
|
+
_context30.n = 3;
|
|
18418
18563
|
return put(setChannelInviteKeysAC(channelId, [inviteKey]));
|
|
18419
18564
|
case 3:
|
|
18420
|
-
|
|
18565
|
+
_context30.n = 5;
|
|
18421
18566
|
break;
|
|
18422
18567
|
case 4:
|
|
18423
|
-
|
|
18424
|
-
|
|
18425
|
-
log.error('ERROR in create channel invite key',
|
|
18568
|
+
_context30.p = 4;
|
|
18569
|
+
_t30 = _context30.v;
|
|
18570
|
+
log.error('ERROR in create channel invite key', _t30);
|
|
18426
18571
|
case 5:
|
|
18427
|
-
return
|
|
18572
|
+
return _context30.a(2);
|
|
18428
18573
|
}
|
|
18429
|
-
},
|
|
18574
|
+
}, _marked30, null, [[0, 4]]);
|
|
18430
18575
|
}
|
|
18431
18576
|
function getChannelInviteKeys(action) {
|
|
18432
|
-
var payload, channelId, channel, inviteKeys,
|
|
18433
|
-
return _regenerator().w(function (
|
|
18434
|
-
while (1) switch (
|
|
18577
|
+
var payload, channelId, channel, inviteKeys, _t31;
|
|
18578
|
+
return _regenerator().w(function (_context31) {
|
|
18579
|
+
while (1) switch (_context31.p = _context31.n) {
|
|
18435
18580
|
case 0:
|
|
18436
|
-
|
|
18581
|
+
_context31.p = 0;
|
|
18437
18582
|
payload = action.payload;
|
|
18438
18583
|
channelId = payload.channelId;
|
|
18439
|
-
|
|
18584
|
+
_context31.n = 1;
|
|
18440
18585
|
return call(getChannelFromMap, channelId);
|
|
18441
18586
|
case 1:
|
|
18442
|
-
channel =
|
|
18587
|
+
channel = _context31.v;
|
|
18443
18588
|
if (!channel) {
|
|
18444
18589
|
channel = getChannelFromAllChannels(channelId);
|
|
18445
18590
|
}
|
|
18446
18591
|
if (!channel) {
|
|
18447
|
-
|
|
18592
|
+
_context31.n = 3;
|
|
18448
18593
|
break;
|
|
18449
18594
|
}
|
|
18450
|
-
|
|
18595
|
+
_context31.n = 2;
|
|
18451
18596
|
return call(channel.getInviteKeys);
|
|
18452
18597
|
case 2:
|
|
18453
|
-
inviteKeys =
|
|
18454
|
-
|
|
18598
|
+
inviteKeys = _context31.v;
|
|
18599
|
+
_context31.n = 3;
|
|
18455
18600
|
return put(setChannelInviteKeysAC(channelId, inviteKeys));
|
|
18456
18601
|
case 3:
|
|
18457
|
-
|
|
18602
|
+
_context31.n = 5;
|
|
18458
18603
|
break;
|
|
18459
18604
|
case 4:
|
|
18460
|
-
|
|
18461
|
-
|
|
18462
|
-
log.error('ERROR in get channel invite keys',
|
|
18605
|
+
_context31.p = 4;
|
|
18606
|
+
_t31 = _context31.v;
|
|
18607
|
+
log.error('ERROR in get channel invite keys', _t31);
|
|
18463
18608
|
case 5:
|
|
18464
|
-
return
|
|
18609
|
+
return _context31.a(2);
|
|
18465
18610
|
}
|
|
18466
|
-
},
|
|
18611
|
+
}, _marked31, null, [[0, 4]]);
|
|
18467
18612
|
}
|
|
18468
18613
|
function regenerateChannelInviteKey(action) {
|
|
18469
|
-
var payload, channelId, key, deletePermanently, channel, inviteKey,
|
|
18470
|
-
return _regenerator().w(function (
|
|
18471
|
-
while (1) switch (
|
|
18614
|
+
var payload, channelId, key, deletePermanently, channel, inviteKey, _t32;
|
|
18615
|
+
return _regenerator().w(function (_context32) {
|
|
18616
|
+
while (1) switch (_context32.p = _context32.n) {
|
|
18472
18617
|
case 0:
|
|
18473
|
-
|
|
18618
|
+
_context32.p = 0;
|
|
18474
18619
|
payload = action.payload;
|
|
18475
18620
|
channelId = payload.channelId, key = payload.key, deletePermanently = payload.deletePermanently;
|
|
18476
|
-
|
|
18621
|
+
_context32.n = 1;
|
|
18477
18622
|
return call(getChannelFromMap, channelId);
|
|
18478
18623
|
case 1:
|
|
18479
|
-
channel =
|
|
18624
|
+
channel = _context32.v;
|
|
18480
18625
|
if (!channel) {
|
|
18481
18626
|
channel = getChannelFromAllChannels(channelId);
|
|
18482
18627
|
}
|
|
18483
18628
|
if (!channel) {
|
|
18484
|
-
|
|
18629
|
+
_context32.n = 3;
|
|
18485
18630
|
break;
|
|
18486
18631
|
}
|
|
18487
|
-
|
|
18632
|
+
_context32.n = 2;
|
|
18488
18633
|
return call(channel.regenerateInviteKey, {
|
|
18489
18634
|
key: key,
|
|
18490
18635
|
channelId: channelId,
|
|
18491
18636
|
deletePermanently: deletePermanently
|
|
18492
18637
|
});
|
|
18493
18638
|
case 2:
|
|
18494
|
-
inviteKey =
|
|
18495
|
-
|
|
18639
|
+
inviteKey = _context32.v;
|
|
18640
|
+
_context32.n = 3;
|
|
18496
18641
|
return put(setChannelInviteKeysAC(channelId, [inviteKey]));
|
|
18497
18642
|
case 3:
|
|
18498
|
-
|
|
18643
|
+
_context32.n = 5;
|
|
18499
18644
|
break;
|
|
18500
18645
|
case 4:
|
|
18501
|
-
|
|
18502
|
-
|
|
18503
|
-
log.error('ERROR in regenerate channel invite key',
|
|
18646
|
+
_context32.p = 4;
|
|
18647
|
+
_t32 = _context32.v;
|
|
18648
|
+
log.error('ERROR in regenerate channel invite key', _t32);
|
|
18504
18649
|
case 5:
|
|
18505
|
-
return
|
|
18650
|
+
return _context32.a(2);
|
|
18506
18651
|
}
|
|
18507
|
-
},
|
|
18652
|
+
}, _marked32, null, [[0, 4]]);
|
|
18508
18653
|
}
|
|
18509
18654
|
function updateChannelInviteKey(action) {
|
|
18510
|
-
var channelInviteKeys, channelId, payload, payloadChannelId, key, accessPriorHistory, expiresAt, maxUses, channel, copiedChannelInviteKeys,
|
|
18511
|
-
return _regenerator().w(function (
|
|
18512
|
-
while (1) switch (
|
|
18655
|
+
var channelInviteKeys, channelId, payload, payloadChannelId, key, accessPriorHistory, expiresAt, maxUses, channel, copiedChannelInviteKeys, _t33;
|
|
18656
|
+
return _regenerator().w(function (_context33) {
|
|
18657
|
+
while (1) switch (_context33.p = _context33.n) {
|
|
18513
18658
|
case 0:
|
|
18514
18659
|
channelInviteKeys = [];
|
|
18515
18660
|
channelId = '';
|
|
18516
|
-
|
|
18661
|
+
_context33.p = 1;
|
|
18517
18662
|
payload = action.payload;
|
|
18518
18663
|
payloadChannelId = payload.channelId, key = payload.key, accessPriorHistory = payload.accessPriorHistory, expiresAt = payload.expiresAt, maxUses = payload.maxUses;
|
|
18519
18664
|
channelId = payloadChannelId;
|
|
18520
|
-
|
|
18665
|
+
_context33.n = 2;
|
|
18521
18666
|
return call(getChannelFromMap, channelId);
|
|
18522
18667
|
case 2:
|
|
18523
|
-
channel =
|
|
18668
|
+
channel = _context33.v;
|
|
18524
18669
|
if (!channel) {
|
|
18525
18670
|
channel = getChannelFromAllChannels(channelId);
|
|
18526
18671
|
}
|
|
18527
18672
|
channelInviteKeys = store.getState().ChannelReducer.channelInviteKeys[channelId];
|
|
18528
18673
|
copiedChannelInviteKeys = JSON.parse(JSON.stringify(channelInviteKeys));
|
|
18529
18674
|
if (!copiedChannelInviteKeys) {
|
|
18530
|
-
|
|
18675
|
+
_context33.n = 3;
|
|
18531
18676
|
break;
|
|
18532
18677
|
}
|
|
18533
18678
|
copiedChannelInviteKeys.forEach(function (inviteKey) {
|
|
@@ -18537,14 +18682,14 @@ function updateChannelInviteKey(action) {
|
|
|
18537
18682
|
inviteKey.maxUses = maxUses;
|
|
18538
18683
|
}
|
|
18539
18684
|
});
|
|
18540
|
-
|
|
18685
|
+
_context33.n = 3;
|
|
18541
18686
|
return put(setChannelInviteKeysAC(channelId, copiedChannelInviteKeys));
|
|
18542
18687
|
case 3:
|
|
18543
18688
|
if (!channel) {
|
|
18544
|
-
|
|
18689
|
+
_context33.n = 4;
|
|
18545
18690
|
break;
|
|
18546
18691
|
}
|
|
18547
|
-
|
|
18692
|
+
_context33.n = 4;
|
|
18548
18693
|
return call(channel.updateInviteKey, {
|
|
18549
18694
|
key: key,
|
|
18550
18695
|
channelId: channelId,
|
|
@@ -18553,88 +18698,88 @@ function updateChannelInviteKey(action) {
|
|
|
18553
18698
|
accessPriorHistory: accessPriorHistory
|
|
18554
18699
|
});
|
|
18555
18700
|
case 4:
|
|
18556
|
-
|
|
18701
|
+
_context33.n = 6;
|
|
18557
18702
|
break;
|
|
18558
18703
|
case 5:
|
|
18559
|
-
|
|
18560
|
-
|
|
18561
|
-
log.error('ERROR in update channel invite key',
|
|
18562
|
-
|
|
18704
|
+
_context33.p = 5;
|
|
18705
|
+
_t33 = _context33.v;
|
|
18706
|
+
log.error('ERROR in update channel invite key', _t33);
|
|
18707
|
+
_context33.n = 6;
|
|
18563
18708
|
return put(setChannelInviteKeysAC(channelId, channelInviteKeys));
|
|
18564
18709
|
case 6:
|
|
18565
|
-
return
|
|
18710
|
+
return _context33.a(2);
|
|
18566
18711
|
}
|
|
18567
|
-
},
|
|
18712
|
+
}, _marked33, null, [[1, 5]]);
|
|
18568
18713
|
}
|
|
18569
18714
|
function getChannelByInviteKey(action) {
|
|
18570
|
-
var _channel$, _channel$2, payload, key, _SceytChatClient0, channel,
|
|
18571
|
-
return _regenerator().w(function (
|
|
18572
|
-
while (1) switch (
|
|
18715
|
+
var _channel$, _channel$2, payload, key, _SceytChatClient0, channel, _t34;
|
|
18716
|
+
return _regenerator().w(function (_context34) {
|
|
18717
|
+
while (1) switch (_context34.p = _context34.n) {
|
|
18573
18718
|
case 0:
|
|
18574
|
-
|
|
18719
|
+
_context34.p = 0;
|
|
18575
18720
|
payload = action.payload;
|
|
18576
18721
|
key = payload.key;
|
|
18577
18722
|
_SceytChatClient0 = getClient();
|
|
18578
|
-
|
|
18723
|
+
_context34.n = 1;
|
|
18579
18724
|
return call(_SceytChatClient0.Channel.getChannelByInviteKey, key);
|
|
18580
18725
|
case 1:
|
|
18581
|
-
channel =
|
|
18726
|
+
channel = _context34.v;
|
|
18582
18727
|
if (!(channel && channel.length > 0 && !((_channel$ = channel[0]) !== null && _channel$ !== void 0 && _channel$.role))) {
|
|
18583
|
-
|
|
18728
|
+
_context34.n = 3;
|
|
18584
18729
|
break;
|
|
18585
18730
|
}
|
|
18586
|
-
|
|
18731
|
+
_context34.n = 2;
|
|
18587
18732
|
return put(setJoinableChannelAC(JSON.parse(JSON.stringify(channel[0]))));
|
|
18588
18733
|
case 2:
|
|
18589
18734
|
window.history.pushState({}, '', window.location.pathname + '?join=' + key);
|
|
18590
|
-
|
|
18735
|
+
_context34.n = 5;
|
|
18591
18736
|
break;
|
|
18592
18737
|
case 3:
|
|
18593
18738
|
if (!(channel && channel.length > 0 && (_channel$2 = channel[0]) !== null && _channel$2 !== void 0 && _channel$2.role)) {
|
|
18594
|
-
|
|
18739
|
+
_context34.n = 5;
|
|
18595
18740
|
break;
|
|
18596
18741
|
}
|
|
18597
|
-
|
|
18742
|
+
_context34.n = 4;
|
|
18598
18743
|
return put(switchChannelActionAC(JSON.parse(JSON.stringify(channel[0]))));
|
|
18599
18744
|
case 4:
|
|
18600
18745
|
window.history.pushState({}, '', window.location.pathname);
|
|
18601
18746
|
case 5:
|
|
18602
|
-
|
|
18747
|
+
_context34.n = 8;
|
|
18603
18748
|
break;
|
|
18604
18749
|
case 6:
|
|
18605
|
-
|
|
18606
|
-
|
|
18607
|
-
if (!(
|
|
18608
|
-
|
|
18750
|
+
_context34.p = 6;
|
|
18751
|
+
_t34 = _context34.v;
|
|
18752
|
+
if (!(_t34.code === 1109)) {
|
|
18753
|
+
_context34.n = 7;
|
|
18609
18754
|
break;
|
|
18610
18755
|
}
|
|
18611
|
-
|
|
18756
|
+
_context34.n = 7;
|
|
18612
18757
|
return put(setChannelInviteKeyAvailableAC(false));
|
|
18613
18758
|
case 7:
|
|
18614
|
-
log.error('ERROR in get channel by invite key',
|
|
18759
|
+
log.error('ERROR in get channel by invite key', _t34);
|
|
18615
18760
|
case 8:
|
|
18616
|
-
return
|
|
18761
|
+
return _context34.a(2);
|
|
18617
18762
|
}
|
|
18618
|
-
},
|
|
18763
|
+
}, _marked34, null, [[0, 6]]);
|
|
18619
18764
|
}
|
|
18620
18765
|
function joinChannelWithInviteKey(action) {
|
|
18621
|
-
var payload, key, _SceytChatClient1, user, channel, messageToSend,
|
|
18622
|
-
return _regenerator().w(function (
|
|
18623
|
-
while (1) switch (
|
|
18766
|
+
var payload, key, _SceytChatClient1, user, channel, messageToSend, _t35;
|
|
18767
|
+
return _regenerator().w(function (_context35) {
|
|
18768
|
+
while (1) switch (_context35.p = _context35.n) {
|
|
18624
18769
|
case 0:
|
|
18625
|
-
|
|
18770
|
+
_context35.p = 0;
|
|
18626
18771
|
payload = action.payload;
|
|
18627
18772
|
key = payload.key;
|
|
18628
18773
|
_SceytChatClient1 = getClient();
|
|
18629
18774
|
user = _SceytChatClient1.user;
|
|
18630
|
-
|
|
18775
|
+
_context35.n = 1;
|
|
18631
18776
|
return call(_SceytChatClient1.Channel.joinChannelByInviteKey, key);
|
|
18632
18777
|
case 1:
|
|
18633
|
-
channel =
|
|
18634
|
-
|
|
18778
|
+
channel = _context35.v;
|
|
18779
|
+
_context35.n = 2;
|
|
18635
18780
|
return put(setJoinableChannelAC(null));
|
|
18636
18781
|
case 2:
|
|
18637
|
-
|
|
18782
|
+
_context35.n = 3;
|
|
18638
18783
|
return call(setChannelInMap, channel);
|
|
18639
18784
|
case 3:
|
|
18640
18785
|
messageToSend = {
|
|
@@ -18643,47 +18788,47 @@ function joinChannelWithInviteKey(action) {
|
|
|
18643
18788
|
attachments: [],
|
|
18644
18789
|
type: 'system'
|
|
18645
18790
|
};
|
|
18646
|
-
|
|
18791
|
+
_context35.n = 4;
|
|
18647
18792
|
return put(sendTextMessageAC(messageToSend, channel === null || channel === void 0 ? void 0 : channel.id, CONNECTION_STATUS.CONNECTED));
|
|
18648
18793
|
case 4:
|
|
18649
|
-
|
|
18794
|
+
_context35.n = 5;
|
|
18650
18795
|
return put(switchChannelActionAC(JSON.parse(JSON.stringify(channel))));
|
|
18651
18796
|
case 5:
|
|
18652
18797
|
window.history.pushState({}, '', window.location.pathname);
|
|
18653
|
-
|
|
18798
|
+
_context35.n = 7;
|
|
18654
18799
|
break;
|
|
18655
18800
|
case 6:
|
|
18656
|
-
|
|
18657
|
-
|
|
18658
|
-
log.error('ERROR in join channel with invite key',
|
|
18801
|
+
_context35.p = 6;
|
|
18802
|
+
_t35 = _context35.v;
|
|
18803
|
+
log.error('ERROR in join channel with invite key', _t35);
|
|
18659
18804
|
case 7:
|
|
18660
|
-
return
|
|
18805
|
+
return _context35.a(2);
|
|
18661
18806
|
}
|
|
18662
|
-
},
|
|
18807
|
+
}, _marked35, null, [[0, 6]]);
|
|
18663
18808
|
}
|
|
18664
18809
|
function setMessageRetentionPeriod(action) {
|
|
18665
|
-
var payload, channelId, periodInMilliseconds, channel, messageToSend,
|
|
18666
|
-
return _regenerator().w(function (
|
|
18667
|
-
while (1) switch (
|
|
18810
|
+
var payload, channelId, periodInMilliseconds, channel, messageToSend, _t36;
|
|
18811
|
+
return _regenerator().w(function (_context36) {
|
|
18812
|
+
while (1) switch (_context36.p = _context36.n) {
|
|
18668
18813
|
case 0:
|
|
18669
|
-
|
|
18814
|
+
_context36.p = 0;
|
|
18670
18815
|
payload = action.payload;
|
|
18671
18816
|
channelId = payload.channelId, periodInMilliseconds = payload.periodInMilliseconds;
|
|
18672
|
-
|
|
18817
|
+
_context36.n = 1;
|
|
18673
18818
|
return call(getChannelFromMap, channelId);
|
|
18674
18819
|
case 1:
|
|
18675
|
-
channel =
|
|
18820
|
+
channel = _context36.v;
|
|
18676
18821
|
if (!channel) {
|
|
18677
18822
|
channel = getChannelFromAllChannels(channelId);
|
|
18678
18823
|
}
|
|
18679
18824
|
if (!channel) {
|
|
18680
|
-
|
|
18825
|
+
_context36.n = 4;
|
|
18681
18826
|
break;
|
|
18682
18827
|
}
|
|
18683
|
-
|
|
18828
|
+
_context36.n = 2;
|
|
18684
18829
|
return call(channel.setMessageRetentionPeriod, periodInMilliseconds);
|
|
18685
18830
|
case 2:
|
|
18686
|
-
|
|
18831
|
+
_context36.n = 3;
|
|
18687
18832
|
return put(updateChannelDataAC(channelId, {
|
|
18688
18833
|
messageRetentionPeriod: periodInMilliseconds
|
|
18689
18834
|
}));
|
|
@@ -18700,32 +18845,32 @@ function setMessageRetentionPeriod(action) {
|
|
|
18700
18845
|
attachments: [],
|
|
18701
18846
|
type: 'system'
|
|
18702
18847
|
};
|
|
18703
|
-
|
|
18848
|
+
_context36.n = 4;
|
|
18704
18849
|
return put(sendTextMessageAC(messageToSend, channelId, CONNECTION_STATUS.CONNECTED));
|
|
18705
18850
|
case 4:
|
|
18706
|
-
|
|
18851
|
+
_context36.n = 6;
|
|
18707
18852
|
break;
|
|
18708
18853
|
case 5:
|
|
18709
|
-
|
|
18710
|
-
|
|
18711
|
-
log.error('ERROR in set message retention period',
|
|
18854
|
+
_context36.p = 5;
|
|
18855
|
+
_t36 = _context36.v;
|
|
18856
|
+
log.error('ERROR in set message retention period', _t36);
|
|
18712
18857
|
case 6:
|
|
18713
|
-
return
|
|
18858
|
+
return _context36.a(2);
|
|
18714
18859
|
}
|
|
18715
|
-
},
|
|
18860
|
+
}, _marked36, null, [[0, 5]]);
|
|
18716
18861
|
}
|
|
18717
18862
|
function getChannelsWithUser(action) {
|
|
18718
|
-
var payload, userId, _SceytChatClient10, channelsQueryBuilder, channelsQuery, channelsData, channels,
|
|
18719
|
-
return _regenerator().w(function (
|
|
18720
|
-
while (1) switch (
|
|
18863
|
+
var payload, userId, _SceytChatClient10, channelsQueryBuilder, channelsQuery, channelsData, channels, _t37;
|
|
18864
|
+
return _regenerator().w(function (_context37) {
|
|
18865
|
+
while (1) switch (_context37.p = _context37.n) {
|
|
18721
18866
|
case 0:
|
|
18722
|
-
|
|
18867
|
+
_context37.n = 1;
|
|
18723
18868
|
return put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18724
18869
|
case 1:
|
|
18725
|
-
|
|
18870
|
+
_context37.n = 2;
|
|
18726
18871
|
return put(setMutualChannelsAC([]));
|
|
18727
18872
|
case 2:
|
|
18728
|
-
|
|
18873
|
+
_context37.p = 2;
|
|
18729
18874
|
payload = action.payload;
|
|
18730
18875
|
userId = payload.userId;
|
|
18731
18876
|
_SceytChatClient10 = getClient();
|
|
@@ -18734,231 +18879,231 @@ function getChannelsWithUser(action) {
|
|
|
18734
18879
|
channelsQueryBuilder.setMutualWithUserId(userId);
|
|
18735
18880
|
channelsQueryBuilder.withExcludeTypes([DEFAULT_CHANNEL_TYPE.DIRECT]);
|
|
18736
18881
|
channelsQueryBuilder.limit(15);
|
|
18737
|
-
|
|
18882
|
+
_context37.n = 3;
|
|
18738
18883
|
return call(channelsQueryBuilder.build);
|
|
18739
18884
|
case 3:
|
|
18740
|
-
channelsQuery =
|
|
18885
|
+
channelsQuery = _context37.v;
|
|
18741
18886
|
query.mutualChannelsQuery = channelsQuery;
|
|
18742
|
-
|
|
18887
|
+
_context37.n = 4;
|
|
18743
18888
|
return call(channelsQuery.loadNextPage);
|
|
18744
18889
|
case 4:
|
|
18745
|
-
channelsData =
|
|
18890
|
+
channelsData = _context37.v;
|
|
18746
18891
|
channels = channelsData.channels;
|
|
18747
18892
|
if (!channelsData.hasNext) {
|
|
18748
|
-
|
|
18893
|
+
_context37.n = 6;
|
|
18749
18894
|
break;
|
|
18750
18895
|
}
|
|
18751
|
-
|
|
18896
|
+
_context37.n = 5;
|
|
18752
18897
|
return put(setMutualChannelsHasNextAC(true));
|
|
18753
18898
|
case 5:
|
|
18754
|
-
|
|
18899
|
+
_context37.n = 7;
|
|
18755
18900
|
break;
|
|
18756
18901
|
case 6:
|
|
18757
|
-
|
|
18902
|
+
_context37.n = 7;
|
|
18758
18903
|
return put(setMutualChannelsHasNextAC(false));
|
|
18759
18904
|
case 7:
|
|
18760
|
-
|
|
18905
|
+
_context37.n = 8;
|
|
18761
18906
|
return put(setMutualChannelsAC(channels));
|
|
18762
18907
|
case 8:
|
|
18763
|
-
|
|
18908
|
+
_context37.n = 10;
|
|
18764
18909
|
break;
|
|
18765
18910
|
case 9:
|
|
18766
|
-
|
|
18767
|
-
|
|
18768
|
-
log.error('ERROR in get groups in common',
|
|
18911
|
+
_context37.p = 9;
|
|
18912
|
+
_t37 = _context37.v;
|
|
18913
|
+
log.error('ERROR in get groups in common', _t37);
|
|
18769
18914
|
case 10:
|
|
18770
|
-
|
|
18771
|
-
|
|
18915
|
+
_context37.p = 10;
|
|
18916
|
+
_context37.n = 11;
|
|
18772
18917
|
return put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18773
18918
|
case 11:
|
|
18774
|
-
return
|
|
18919
|
+
return _context37.f(10);
|
|
18775
18920
|
case 12:
|
|
18776
|
-
return
|
|
18921
|
+
return _context37.a(2);
|
|
18777
18922
|
}
|
|
18778
|
-
},
|
|
18923
|
+
}, _marked37, null, [[2, 9, 10, 12]]);
|
|
18779
18924
|
}
|
|
18780
18925
|
function loadMoreMutualChannels(action) {
|
|
18781
|
-
var payload, limit, mutualChannelsQuery, channelsData,
|
|
18782
|
-
return _regenerator().w(function (
|
|
18783
|
-
while (1) switch (
|
|
18926
|
+
var payload, limit, mutualChannelsQuery, channelsData, _t38;
|
|
18927
|
+
return _regenerator().w(function (_context38) {
|
|
18928
|
+
while (1) switch (_context38.p = _context38.n) {
|
|
18784
18929
|
case 0:
|
|
18785
|
-
|
|
18930
|
+
_context38.n = 1;
|
|
18786
18931
|
return put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18787
18932
|
case 1:
|
|
18788
|
-
|
|
18933
|
+
_context38.p = 1;
|
|
18789
18934
|
payload = action.payload;
|
|
18790
18935
|
limit = payload.limit;
|
|
18791
18936
|
mutualChannelsQuery = query.mutualChannelsQuery;
|
|
18792
18937
|
if (mutualChannelsQuery) {
|
|
18793
|
-
|
|
18938
|
+
_context38.n = 2;
|
|
18794
18939
|
break;
|
|
18795
18940
|
}
|
|
18796
|
-
return
|
|
18941
|
+
return _context38.a(2);
|
|
18797
18942
|
case 2:
|
|
18798
18943
|
if (limit) {
|
|
18799
18944
|
mutualChannelsQuery.limit = limit;
|
|
18800
18945
|
}
|
|
18801
|
-
|
|
18946
|
+
_context38.n = 3;
|
|
18802
18947
|
return call(mutualChannelsQuery.loadNextPage);
|
|
18803
18948
|
case 3:
|
|
18804
|
-
channelsData =
|
|
18949
|
+
channelsData = _context38.v;
|
|
18805
18950
|
if (!channelsData.hasNext) {
|
|
18806
|
-
|
|
18951
|
+
_context38.n = 5;
|
|
18807
18952
|
break;
|
|
18808
18953
|
}
|
|
18809
|
-
|
|
18954
|
+
_context38.n = 4;
|
|
18810
18955
|
return put(setMutualChannelsHasNextAC(true));
|
|
18811
18956
|
case 4:
|
|
18812
|
-
|
|
18957
|
+
_context38.n = 6;
|
|
18813
18958
|
break;
|
|
18814
18959
|
case 5:
|
|
18815
|
-
|
|
18960
|
+
_context38.n = 6;
|
|
18816
18961
|
return put(setMutualChannelsHasNextAC(false));
|
|
18817
18962
|
case 6:
|
|
18818
|
-
|
|
18963
|
+
_context38.n = 7;
|
|
18819
18964
|
return put(setMutualChannelsAC(channelsData.channels));
|
|
18820
18965
|
case 7:
|
|
18821
|
-
|
|
18966
|
+
_context38.n = 9;
|
|
18822
18967
|
break;
|
|
18823
18968
|
case 8:
|
|
18824
|
-
|
|
18825
|
-
|
|
18826
|
-
log.error('ERROR in load more mutual channels',
|
|
18969
|
+
_context38.p = 8;
|
|
18970
|
+
_t38 = _context38.v;
|
|
18971
|
+
log.error('ERROR in load more mutual channels', _t38);
|
|
18827
18972
|
case 9:
|
|
18828
|
-
|
|
18829
|
-
|
|
18973
|
+
_context38.p = 9;
|
|
18974
|
+
_context38.n = 10;
|
|
18830
18975
|
return put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18831
18976
|
case 10:
|
|
18832
|
-
return
|
|
18977
|
+
return _context38.f(9);
|
|
18833
18978
|
case 11:
|
|
18834
|
-
return
|
|
18979
|
+
return _context38.a(2);
|
|
18835
18980
|
}
|
|
18836
|
-
},
|
|
18981
|
+
}, _marked38, null, [[1, 8, 9, 11]]);
|
|
18837
18982
|
}
|
|
18838
18983
|
function ChannelsSaga() {
|
|
18839
|
-
return _regenerator().w(function (
|
|
18840
|
-
while (1) switch (
|
|
18984
|
+
return _regenerator().w(function (_context39) {
|
|
18985
|
+
while (1) switch (_context39.n) {
|
|
18841
18986
|
case 0:
|
|
18842
|
-
|
|
18987
|
+
_context39.n = 1;
|
|
18843
18988
|
return takeLatest(CREATE_CHANNEL, createChannel);
|
|
18844
18989
|
case 1:
|
|
18845
|
-
|
|
18990
|
+
_context39.n = 2;
|
|
18846
18991
|
return takeLatest(GET_CHANNELS, getChannels);
|
|
18847
18992
|
case 2:
|
|
18848
|
-
|
|
18993
|
+
_context39.n = 3;
|
|
18849
18994
|
return takeLatest(SEARCH_CHANNELS, searchChannels);
|
|
18850
18995
|
case 3:
|
|
18851
|
-
|
|
18996
|
+
_context39.n = 4;
|
|
18852
18997
|
return takeLatest(GET_CHANNELS_FOR_FORWARD, getChannelsForForward);
|
|
18853
18998
|
case 4:
|
|
18854
|
-
|
|
18999
|
+
_context39.n = 5;
|
|
18855
19000
|
return takeLatest(SEARCH_CHANNELS_FOR_FORWARD, searchChannelsForForward);
|
|
18856
19001
|
case 5:
|
|
18857
|
-
|
|
19002
|
+
_context39.n = 6;
|
|
18858
19003
|
return takeLatest(LOAD_MORE_CHANNEL, channelsLoadMore);
|
|
18859
19004
|
case 6:
|
|
18860
|
-
|
|
19005
|
+
_context39.n = 7;
|
|
18861
19006
|
return takeLatest(LOAD_MORE_CHANNELS_FOR_FORWARD, channelsForForwardLoadMore);
|
|
18862
19007
|
case 7:
|
|
18863
|
-
|
|
19008
|
+
_context39.n = 8;
|
|
18864
19009
|
return takeLatest(GET_CHANNELS_WITH_USER, getChannelsWithUser);
|
|
18865
19010
|
case 8:
|
|
18866
|
-
|
|
19011
|
+
_context39.n = 9;
|
|
18867
19012
|
return takeLatest(LOAD_MORE_MUTUAL_CHANNELS, loadMoreMutualChannels);
|
|
18868
19013
|
case 9:
|
|
18869
|
-
|
|
19014
|
+
_context39.n = 10;
|
|
18870
19015
|
return takeEvery(SWITCH_CHANNEL, switchChannel);
|
|
18871
19016
|
case 10:
|
|
18872
|
-
|
|
19017
|
+
_context39.n = 11;
|
|
18873
19018
|
return takeLatest(LEAVE_CHANNEL, leaveChannel);
|
|
18874
19019
|
case 11:
|
|
18875
|
-
|
|
19020
|
+
_context39.n = 12;
|
|
18876
19021
|
return takeLatest(DELETE_CHANNEL, deleteChannel);
|
|
18877
19022
|
case 12:
|
|
18878
|
-
|
|
19023
|
+
_context39.n = 13;
|
|
18879
19024
|
return takeLatest(BLOCK_CHANNEL, blockChannel);
|
|
18880
19025
|
case 13:
|
|
18881
|
-
|
|
19026
|
+
_context39.n = 14;
|
|
18882
19027
|
return takeLatest(UPDATE_CHANNEL, updateChannel);
|
|
18883
19028
|
case 14:
|
|
18884
|
-
|
|
19029
|
+
_context39.n = 15;
|
|
18885
19030
|
return takeEvery(MARK_MESSAGES_AS_READ, markMessagesRead);
|
|
18886
19031
|
case 15:
|
|
18887
|
-
|
|
19032
|
+
_context39.n = 16;
|
|
18888
19033
|
return takeLatest(MARK_MESSAGES_AS_DELIVERED, markMessagesDelivered);
|
|
18889
19034
|
case 16:
|
|
18890
|
-
|
|
19035
|
+
_context39.n = 17;
|
|
18891
19036
|
return takeLatest(MARK_VOICE_MESSAGE_AS_PLAYED, markVoiceMessageAsPlayed);
|
|
18892
19037
|
case 17:
|
|
18893
|
-
|
|
19038
|
+
_context39.n = 18;
|
|
18894
19039
|
return takeLatest(WATCH_FOR_EVENTS, watchForChannelEvents);
|
|
18895
19040
|
case 18:
|
|
18896
|
-
|
|
19041
|
+
_context39.n = 19;
|
|
18897
19042
|
return takeLatest(TURN_OFF_NOTIFICATION, notificationsTurnOff);
|
|
18898
19043
|
case 19:
|
|
18899
|
-
|
|
19044
|
+
_context39.n = 20;
|
|
18900
19045
|
return takeLatest(TURN_ON_NOTIFICATION, notificationsTurnOn);
|
|
18901
19046
|
case 20:
|
|
18902
|
-
|
|
19047
|
+
_context39.n = 21;
|
|
18903
19048
|
return takeLatest(MARK_CHANNEL_AS_READ, markChannelAsRead);
|
|
18904
19049
|
case 21:
|
|
18905
|
-
|
|
19050
|
+
_context39.n = 22;
|
|
18906
19051
|
return takeLatest(MARK_CHANNEL_AS_UNREAD, markChannelAsUnRead);
|
|
18907
19052
|
case 22:
|
|
18908
|
-
|
|
19053
|
+
_context39.n = 23;
|
|
18909
19054
|
return takeLatest(CHECK_USER_STATUS, checkUsersStatus);
|
|
18910
19055
|
case 23:
|
|
18911
|
-
|
|
19056
|
+
_context39.n = 24;
|
|
18912
19057
|
return takeLatest(SEND_TYPING, sendTyping);
|
|
18913
19058
|
case 24:
|
|
18914
|
-
|
|
19059
|
+
_context39.n = 25;
|
|
18915
19060
|
return takeLatest(SEND_RECORDING, sendRecording);
|
|
18916
19061
|
case 25:
|
|
18917
|
-
|
|
19062
|
+
_context39.n = 26;
|
|
18918
19063
|
return takeLatest(PIN_CHANNEL, pinChannel);
|
|
18919
19064
|
case 26:
|
|
18920
|
-
|
|
19065
|
+
_context39.n = 27;
|
|
18921
19066
|
return takeLatest(UNPIN_CHANNEL, unpinChannel);
|
|
18922
19067
|
case 27:
|
|
18923
|
-
|
|
19068
|
+
_context39.n = 28;
|
|
18924
19069
|
return takeLatest(CLEAR_HISTORY, clearHistory);
|
|
18925
19070
|
case 28:
|
|
18926
|
-
|
|
19071
|
+
_context39.n = 29;
|
|
18927
19072
|
return takeLatest(JOIN_TO_CHANNEL, joinChannel);
|
|
18928
19073
|
case 29:
|
|
18929
|
-
|
|
19074
|
+
_context39.n = 30;
|
|
18930
19075
|
return takeLatest(DELETE_ALL_MESSAGES, deleteAllMessages);
|
|
18931
19076
|
case 30:
|
|
18932
|
-
|
|
19077
|
+
_context39.n = 31;
|
|
18933
19078
|
return takeLatest(REMOVE_CHANNEL_CACHES, removeChannelCaches);
|
|
18934
19079
|
case 31:
|
|
18935
|
-
|
|
19080
|
+
_context39.n = 32;
|
|
18936
19081
|
return takeLatest(GET_CHANNEL_MENTIONS, getChannelMentions);
|
|
18937
19082
|
case 32:
|
|
18938
|
-
|
|
19083
|
+
_context39.n = 33;
|
|
18939
19084
|
return takeLatest(CREATE_CHANNEL_INVITE_KEY, createChannelInviteKey);
|
|
18940
19085
|
case 33:
|
|
18941
|
-
|
|
19086
|
+
_context39.n = 34;
|
|
18942
19087
|
return takeLatest(UPDATE_CHANNEL_INVITE_KEY, updateChannelInviteKey);
|
|
18943
19088
|
case 34:
|
|
18944
|
-
|
|
19089
|
+
_context39.n = 35;
|
|
18945
19090
|
return takeLatest(REGENERATE_CHANNEL_INVITE_KEY, regenerateChannelInviteKey);
|
|
18946
19091
|
case 35:
|
|
18947
|
-
|
|
19092
|
+
_context39.n = 36;
|
|
18948
19093
|
return takeLatest(GET_CHANNEL_INVITE_KEYS, getChannelInviteKeys);
|
|
18949
19094
|
case 36:
|
|
18950
|
-
|
|
19095
|
+
_context39.n = 37;
|
|
18951
19096
|
return takeLatest(GET_CHANNEL_BY_INVITE_KEY, getChannelByInviteKey);
|
|
18952
19097
|
case 37:
|
|
18953
|
-
|
|
19098
|
+
_context39.n = 38;
|
|
18954
19099
|
return takeLatest(JOIN_TO_CHANNEL_WITH_INVITE_KEY, joinChannelWithInviteKey);
|
|
18955
19100
|
case 38:
|
|
18956
|
-
|
|
19101
|
+
_context39.n = 39;
|
|
18957
19102
|
return takeLatest(SET_MESSAGE_RETENTION_PERIOD, setMessageRetentionPeriod);
|
|
18958
19103
|
case 39:
|
|
18959
|
-
return
|
|
19104
|
+
return _context39.a(2);
|
|
18960
19105
|
}
|
|
18961
|
-
},
|
|
19106
|
+
}, _marked39);
|
|
18962
19107
|
}
|
|
18963
19108
|
|
|
18964
19109
|
function rgbaToThumbHash(w, h, rgba) {
|
|
@@ -19358,56 +19503,6 @@ var getFrame = function getFrame(videoSrc, time) {
|
|
|
19358
19503
|
}
|
|
19359
19504
|
};
|
|
19360
19505
|
|
|
19361
|
-
var SDKErrorTypeEnum = {
|
|
19362
|
-
BadRequest: {
|
|
19363
|
-
value: 'BadRequest',
|
|
19364
|
-
isResendable: false
|
|
19365
|
-
},
|
|
19366
|
-
BadParam: {
|
|
19367
|
-
value: 'BadParam',
|
|
19368
|
-
isResendable: false
|
|
19369
|
-
},
|
|
19370
|
-
NotFound: {
|
|
19371
|
-
value: 'NotFound',
|
|
19372
|
-
isResendable: false
|
|
19373
|
-
},
|
|
19374
|
-
NotAllowed: {
|
|
19375
|
-
value: 'NotAllowed',
|
|
19376
|
-
isResendable: false
|
|
19377
|
-
},
|
|
19378
|
-
TooLargeRequest: {
|
|
19379
|
-
value: 'TooLargeRequest',
|
|
19380
|
-
isResendable: false
|
|
19381
|
-
},
|
|
19382
|
-
InternalError: {
|
|
19383
|
-
value: 'InternalError',
|
|
19384
|
-
isResendable: true
|
|
19385
|
-
},
|
|
19386
|
-
TooManyRequests: {
|
|
19387
|
-
value: 'TooManyRequests',
|
|
19388
|
-
isResendable: true
|
|
19389
|
-
},
|
|
19390
|
-
Authentication: {
|
|
19391
|
-
value: 'Authentication',
|
|
19392
|
-
isResendable: true
|
|
19393
|
-
}
|
|
19394
|
-
};
|
|
19395
|
-
var fromValue = function fromValue(value) {
|
|
19396
|
-
if (!value) return null;
|
|
19397
|
-
var entries = Object.values(SDKErrorTypeEnum);
|
|
19398
|
-
return entries.find(function (entry) {
|
|
19399
|
-
return entry.value === value;
|
|
19400
|
-
}) || null;
|
|
19401
|
-
};
|
|
19402
|
-
var isResendableError = function isResendableError(value) {
|
|
19403
|
-
var _errorType$isResendab;
|
|
19404
|
-
if (!value) {
|
|
19405
|
-
return true;
|
|
19406
|
-
}
|
|
19407
|
-
var errorType = fromValue(value);
|
|
19408
|
-
return (_errorType$isResendab = errorType === null || errorType === void 0 ? void 0 : errorType.isResendable) != null ? _errorType$isResendab : true;
|
|
19409
|
-
};
|
|
19410
|
-
|
|
19411
19506
|
var _marked$3 = /*#__PURE__*/_regenerator().m(sendMessage),
|
|
19412
19507
|
_marked2$2 = /*#__PURE__*/_regenerator().m(sendTextMessage),
|
|
19413
19508
|
_marked3$1 = /*#__PURE__*/_regenerator().m(forwardMessage),
|
|
@@ -20798,7 +20893,7 @@ var getFilteredPendingMessages = function getFilteredPendingMessages(messages) {
|
|
|
20798
20893
|
return filteredPendingMessages;
|
|
20799
20894
|
};
|
|
20800
20895
|
function getMessagesQuery(action) {
|
|
20801
|
-
var _action$payload, channel, loadWithLastMessage, messageId, limit, highlight, behavior, scrollToMessage, networkChanged, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, _result$messages$, _result$messages, _messages$Math$floor, messages, centerMessageId, loadWithMessageId, allMessages, messageIndex, maxLengthPart, _result$messages$2, _result$messages2, secondResult, thirdResult, fourthResult, _fourthResult, _result$messages$3, _result$messages3, _channel$lastMessage4, _channel$lastMessage5, _channel$lastMessage6, _filteredPendingMessages, updatedMessages, messageIdForLoad, _updatedMessages$, filteredPendingMessages, waitToSendPendingMessages, updatedChannel, _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16, _t17, _t18, _t19, _t20;
|
|
20896
|
+
var _action$payload, channel, loadWithLastMessage, messageId, limit, highlight, behavior, scrollToMessage, networkChanged, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, _result$messages$, _result$messages, _messages$Math$floor, messages, centerMessageId, loadWithMessageId, allMessages, messageIndex, maxLengthPart, _result$messages$2, _result$messages2, secondResult, thirdResult, fourthResult, _fourthResult, _result$messages$3, _result$messages3, _channel$lastMessage4, _channel$lastMessage5, _channel$lastMessage6, _result$messages4, _filteredPendingMessages, updatedMessages, messageIdForLoad, _updatedMessages$, filteredPendingMessages, waitToSendPendingMessages, updatedChannel, _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16, _t17, _t18, _t19, _t20;
|
|
20802
20897
|
return _regenerator().w(function (_context10) {
|
|
20803
20898
|
while (1) switch (_context10.p = _context10.n) {
|
|
20804
20899
|
case 0:
|
|
@@ -20809,7 +20904,7 @@ function getMessagesQuery(action) {
|
|
|
20809
20904
|
_action$payload = action.payload, channel = _action$payload.channel, loadWithLastMessage = _action$payload.loadWithLastMessage, messageId = _action$payload.messageId, limit = _action$payload.limit, highlight = _action$payload.highlight, behavior = _action$payload.behavior, scrollToMessage = _action$payload.scrollToMessage, networkChanged = _action$payload.networkChanged;
|
|
20810
20905
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
20811
20906
|
if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
|
|
20812
|
-
_context10.n =
|
|
20907
|
+
_context10.n = 87;
|
|
20813
20908
|
break;
|
|
20814
20909
|
}
|
|
20815
20910
|
SceytChatClient = getClient();
|
|
@@ -20930,7 +21025,7 @@ function getMessagesQuery(action) {
|
|
|
20930
21025
|
_context10.n = 21;
|
|
20931
21026
|
return put(scrollToNewMessageAC(true));
|
|
20932
21027
|
case 21:
|
|
20933
|
-
_context10.n =
|
|
21028
|
+
_context10.n = 80;
|
|
20934
21029
|
break;
|
|
20935
21030
|
case 22:
|
|
20936
21031
|
if (!messageId) {
|
|
@@ -21107,7 +21202,7 @@ function getMessagesQuery(action) {
|
|
|
21107
21202
|
_context10.n = 51;
|
|
21108
21203
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
21109
21204
|
case 51:
|
|
21110
|
-
_context10.n =
|
|
21205
|
+
_context10.n = 80;
|
|
21111
21206
|
break;
|
|
21112
21207
|
case 52:
|
|
21113
21208
|
if (!(channel.newMessageCount && channel.lastDisplayedMessageId)) {
|
|
@@ -21169,7 +21264,7 @@ function getMessagesQuery(action) {
|
|
|
21169
21264
|
_context10.n = 63;
|
|
21170
21265
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
21171
21266
|
case 63:
|
|
21172
|
-
_context10.n =
|
|
21267
|
+
_context10.n = 80;
|
|
21173
21268
|
break;
|
|
21174
21269
|
case 64:
|
|
21175
21270
|
if (!(cachedMessages && cachedMessages.length)) {
|
|
@@ -21244,7 +21339,7 @@ function getMessagesQuery(action) {
|
|
|
21244
21339
|
});
|
|
21245
21340
|
messageIdForLoad = (channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId) > (channel === null || channel === void 0 ? void 0 : (_channel$lastMessage5 = channel.lastMessage) === null || _channel$lastMessage5 === void 0 ? void 0 : _channel$lastMessage5.id) ? (channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId) || '0' : (channel === null || channel === void 0 ? void 0 : (_channel$lastMessage6 = channel.lastMessage) === null || _channel$lastMessage6 === void 0 ? void 0 : _channel$lastMessage6.id) || '0';
|
|
21246
21341
|
if (!updatedMessages.length) {
|
|
21247
|
-
_context10.n =
|
|
21342
|
+
_context10.n = 79;
|
|
21248
21343
|
break;
|
|
21249
21344
|
}
|
|
21250
21345
|
_context10.n = 76;
|
|
@@ -21256,60 +21351,70 @@ function getMessagesQuery(action) {
|
|
|
21256
21351
|
_context10.n = 78;
|
|
21257
21352
|
return put(setMessagesHasNextAC(false));
|
|
21258
21353
|
case 78:
|
|
21259
|
-
|
|
21260
|
-
|
|
21261
|
-
return put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21354
|
+
_context10.n = 80;
|
|
21355
|
+
break;
|
|
21262
21356
|
case 79:
|
|
21263
|
-
|
|
21264
|
-
|
|
21265
|
-
_context10.n = 81;
|
|
21357
|
+
if (!(!(cachedMessages !== null && cachedMessages !== void 0 && cachedMessages.length) && !((_result$messages4 = result.messages) !== null && _result$messages4 !== void 0 && _result$messages4.length))) {
|
|
21358
|
+
_context10.n = 80;
|
|
21266
21359
|
break;
|
|
21267
21360
|
}
|
|
21268
21361
|
_context10.n = 80;
|
|
21269
|
-
return put(
|
|
21362
|
+
return put(setMessagesAC([]));
|
|
21270
21363
|
case 80:
|
|
21364
|
+
filteredPendingMessages = getFilteredPendingMessages(result.messages);
|
|
21271
21365
|
_context10.n = 81;
|
|
21272
|
-
return
|
|
21366
|
+
return put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21273
21367
|
case 81:
|
|
21368
|
+
waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
|
|
21369
|
+
if (!(connectionState === CONNECTION_STATUS.CONNECTED && waitToSendPendingMessages)) {
|
|
21370
|
+
_context10.n = 83;
|
|
21371
|
+
break;
|
|
21372
|
+
}
|
|
21274
21373
|
_context10.n = 82;
|
|
21275
|
-
return
|
|
21374
|
+
return put(setWaitToSendPendingMessagesAC(false));
|
|
21276
21375
|
case 82:
|
|
21376
|
+
_context10.n = 83;
|
|
21377
|
+
return spawn(sendPendingMessages, connectionState);
|
|
21378
|
+
case 83:
|
|
21379
|
+
_context10.n = 84;
|
|
21380
|
+
return call(SceytChatClient.getChannel, channel.id, true);
|
|
21381
|
+
case 84:
|
|
21277
21382
|
updatedChannel = _context10.v;
|
|
21278
21383
|
if (!(updatedChannel && updatedChannel !== null && updatedChannel !== void 0 && updatedChannel.lastMessage)) {
|
|
21279
|
-
_context10.n =
|
|
21384
|
+
_context10.n = 86;
|
|
21280
21385
|
break;
|
|
21281
21386
|
}
|
|
21282
|
-
_context10.n =
|
|
21387
|
+
_context10.n = 85;
|
|
21283
21388
|
return put(updateChannelLastMessageAC(updatedChannel.lastMessage, updatedChannel));
|
|
21284
|
-
case
|
|
21389
|
+
case 85:
|
|
21285
21390
|
updateChannelLastMessageOnAllChannels(channel.id, updatedChannel.lastMessage);
|
|
21286
|
-
case
|
|
21287
|
-
_context10.n =
|
|
21391
|
+
case 86:
|
|
21392
|
+
_context10.n = 88;
|
|
21288
21393
|
break;
|
|
21289
|
-
case
|
|
21394
|
+
case 87:
|
|
21290
21395
|
if (!(channel !== null && channel !== void 0 && channel.isMockChannel)) {
|
|
21291
|
-
_context10.n =
|
|
21396
|
+
_context10.n = 88;
|
|
21292
21397
|
break;
|
|
21293
21398
|
}
|
|
21294
|
-
_context10.n = 86;
|
|
21295
|
-
return put(setMessagesAC([]));
|
|
21296
|
-
case 86:
|
|
21297
21399
|
_context10.n = 88;
|
|
21400
|
+
return put(setMessagesAC([]));
|
|
21401
|
+
case 88:
|
|
21402
|
+
_context10.n = 90;
|
|
21298
21403
|
break;
|
|
21299
|
-
case
|
|
21300
|
-
_context10.p =
|
|
21404
|
+
case 89:
|
|
21405
|
+
_context10.p = 89;
|
|
21301
21406
|
_t20 = _context10.v;
|
|
21302
21407
|
log.error('error in message query', _t20);
|
|
21303
|
-
case 88:
|
|
21304
|
-
_context10.p = 88;
|
|
21305
|
-
_context10.n = 89;
|
|
21306
|
-
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
21307
|
-
case 89:
|
|
21308
|
-
return _context10.f(88);
|
|
21309
21408
|
case 90:
|
|
21409
|
+
_context10.p = 90;
|
|
21410
|
+
_context10.n = 91;
|
|
21411
|
+
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
21412
|
+
case 91:
|
|
21413
|
+
return _context10.f(90);
|
|
21414
|
+
case 92:
|
|
21310
21415
|
return _context10.a(2);
|
|
21311
21416
|
}
|
|
21312
|
-
}, _marked7$1, null, [[0,
|
|
21417
|
+
}, _marked7$1, null, [[0, 89, 90, 92]]);
|
|
21313
21418
|
}
|
|
21314
21419
|
function getMessageQuery(action) {
|
|
21315
21420
|
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage, _t21;
|
|
@@ -21370,7 +21475,7 @@ function getMessageQuery(action) {
|
|
|
21370
21475
|
}, _marked8$1, null, [[0, 7]]);
|
|
21371
21476
|
}
|
|
21372
21477
|
function loadMoreMessages(action) {
|
|
21373
|
-
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _result$messages$4, _result$
|
|
21478
|
+
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _result$messages$4, _result$messages5, _result$messages$5, _result$messages6, _t22;
|
|
21374
21479
|
return _regenerator().w(function (_context12) {
|
|
21375
21480
|
while (1) switch (_context12.p = _context12.n) {
|
|
21376
21481
|
case 0:
|
|
@@ -21414,7 +21519,7 @@ function loadMoreMessages(action) {
|
|
|
21414
21519
|
result = _context12.v;
|
|
21415
21520
|
if (result.messages.length) {
|
|
21416
21521
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.PREV);
|
|
21417
|
-
setMessagesToMap(channelId, result.messages, (_result$messages$4 = result.messages[0]) === null || _result$messages$4 === void 0 ? void 0 : _result$messages$4.id, (_result$
|
|
21522
|
+
setMessagesToMap(channelId, result.messages, (_result$messages$4 = result.messages[0]) === null || _result$messages$4 === void 0 ? void 0 : _result$messages$4.id, (_result$messages5 = result.messages[result.messages.length - 1]) === null || _result$messages5 === void 0 ? void 0 : _result$messages5.id);
|
|
21418
21523
|
}
|
|
21419
21524
|
_context12.n = 5;
|
|
21420
21525
|
return put(setMessagesHasPrevAC(result.hasNext));
|
|
@@ -21442,7 +21547,7 @@ function loadMoreMessages(action) {
|
|
|
21442
21547
|
result = _context12.v;
|
|
21443
21548
|
if (result.messages.length) {
|
|
21444
21549
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.NEXT);
|
|
21445
|
-
setMessagesToMap(channelId, result.messages, (_result$messages$5 = result.messages[0]) === null || _result$messages$5 === void 0 ? void 0 : _result$messages$5.id, (_result$
|
|
21550
|
+
setMessagesToMap(channelId, result.messages, (_result$messages$5 = result.messages[0]) === null || _result$messages$5 === void 0 ? void 0 : _result$messages$5.id, (_result$messages6 = result.messages[result.messages.length - 1]) === null || _result$messages6 === void 0 ? void 0 : _result$messages6.id);
|
|
21446
21551
|
}
|
|
21447
21552
|
_context12.n = 9;
|
|
21448
21553
|
return put(setMessagesHasNextAC(result.hasNext));
|
|
@@ -27874,7 +27979,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
27874
27979
|
loadMoreChannels: handleLoadMoreChannels,
|
|
27875
27980
|
searchValue: searchValue
|
|
27876
27981
|
}, !searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, channels.map(function (channel) {
|
|
27877
|
-
return ListItem ? (/*#__PURE__*/React__default.createElement(ListItem, {
|
|
27982
|
+
return !getPendingDeleteChannel(channel.id) && (ListItem ? (/*#__PURE__*/React__default.createElement(ListItem, {
|
|
27878
27983
|
channel: channel,
|
|
27879
27984
|
setSelectedChannel: setSelectedChannel,
|
|
27880
27985
|
key: channel.id
|
|
@@ -27907,7 +28012,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
27907
28012
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
27908
28013
|
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
27909
28014
|
showPhoneNumber: showPhoneNumber
|
|
27910
|
-
}));
|
|
28015
|
+
})));
|
|
27911
28016
|
}))) : channelsLoading === LOADING_STATE.LOADED && searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha = searchedChannels.chats_groups) !== null && _searchedChannels$cha !== void 0 && _searchedChannels$cha.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha2 = searchedChannels.channels) !== null && _searchedChannels$cha2 !== void 0 && _searchedChannels$cha2.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$con = searchedChannels.contacts) !== null && _searchedChannels$con !== void 0 && _searchedChannels$con.length ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, !!(searchedChannels.chats_groups && searchedChannels.chats_groups.length) && (/*#__PURE__*/React__default.createElement(DirectChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
|
|
27912
28017
|
color: textSecondary,
|
|
27913
28018
|
fontSize: searchedChannelsTitleFontSize
|