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