sceyt-chat-react-uikit 1.7.9-beta.6 → 1.7.9-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1083 -964
- package/index.modern.js +1083 -964
- 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,
|
|
@@ -10822,6 +10847,11 @@ function updatePendingMessageAC(channelId, messageId, updatedMessage) {
|
|
|
10822
10847
|
updatedMessage: updatedMessage
|
|
10823
10848
|
});
|
|
10824
10849
|
}
|
|
10850
|
+
function setUnreadMessageIdAC(messageId) {
|
|
10851
|
+
return setUnreadMessageId({
|
|
10852
|
+
messageId: messageId
|
|
10853
|
+
});
|
|
10854
|
+
}
|
|
10825
10855
|
|
|
10826
10856
|
var MESSAGES_MAX_PAGE_COUNT = 80;
|
|
10827
10857
|
var MESSAGES_MAX_LENGTH = 50;
|
|
@@ -11342,6 +11372,31 @@ var setPendingPollAction = function setPendingPollAction(action) {
|
|
|
11342
11372
|
}
|
|
11343
11373
|
store.dispatch(setPendingPollActionsMapAC(messageId, action));
|
|
11344
11374
|
};
|
|
11375
|
+
var getCenterTwoMessages = function getCenterTwoMessages(messages) {
|
|
11376
|
+
var mid = Math.floor(messages.length / 2);
|
|
11377
|
+
if (messages.length % 2 === 0) {
|
|
11378
|
+
return {
|
|
11379
|
+
mid1: {
|
|
11380
|
+
messageId: messages[mid - 1].id,
|
|
11381
|
+
index: mid - 1
|
|
11382
|
+
},
|
|
11383
|
+
mid2: {
|
|
11384
|
+
messageId: messages[mid].id,
|
|
11385
|
+
index: mid
|
|
11386
|
+
}
|
|
11387
|
+
};
|
|
11388
|
+
}
|
|
11389
|
+
return {
|
|
11390
|
+
mid1: {
|
|
11391
|
+
messageId: messages[mid - 1].id,
|
|
11392
|
+
index: mid - 1
|
|
11393
|
+
},
|
|
11394
|
+
mid2: {
|
|
11395
|
+
messageId: messages[mid + 1].id,
|
|
11396
|
+
index: mid + 1
|
|
11397
|
+
}
|
|
11398
|
+
};
|
|
11399
|
+
};
|
|
11345
11400
|
|
|
11346
11401
|
var initialState$1 = {
|
|
11347
11402
|
messagesLoadingState: null,
|
|
@@ -11388,7 +11443,8 @@ var initialState$1 = {
|
|
|
11388
11443
|
pollVotesInitialCount: null,
|
|
11389
11444
|
pendingPollActions: {},
|
|
11390
11445
|
pendingMessagesMap: {},
|
|
11391
|
-
unreadScrollTo: true
|
|
11446
|
+
unreadScrollTo: true,
|
|
11447
|
+
unreadMessageId: ''
|
|
11392
11448
|
};
|
|
11393
11449
|
var messageSlice = createSlice({
|
|
11394
11450
|
name: 'messages',
|
|
@@ -11964,6 +12020,9 @@ var messageSlice = createSlice({
|
|
|
11964
12020
|
},
|
|
11965
12021
|
clearPendingMessagesMap: function clearPendingMessagesMap(state) {
|
|
11966
12022
|
state.pendingMessagesMap = {};
|
|
12023
|
+
},
|
|
12024
|
+
setUnreadMessageId: function setUnreadMessageId(state, action) {
|
|
12025
|
+
state.unreadMessageId = action.payload.messageId;
|
|
11967
12026
|
}
|
|
11968
12027
|
},
|
|
11969
12028
|
extraReducers: function extraReducers(builder) {
|
|
@@ -12028,7 +12087,8 @@ var _messageSlice$actions = messageSlice.actions,
|
|
|
12028
12087
|
setPendingMessage$1 = _messageSlice$actions.setPendingMessage,
|
|
12029
12088
|
removePendingMessage = _messageSlice$actions.removePendingMessage,
|
|
12030
12089
|
updatePendingMessage = _messageSlice$actions.updatePendingMessage,
|
|
12031
|
-
updatePendingPollAction = _messageSlice$actions.updatePendingPollAction
|
|
12090
|
+
updatePendingPollAction = _messageSlice$actions.updatePendingPollAction,
|
|
12091
|
+
setUnreadMessageId = _messageSlice$actions.setUnreadMessageId;
|
|
12032
12092
|
var MessageReducer = messageSlice.reducer;
|
|
12033
12093
|
|
|
12034
12094
|
var initialState$2 = {
|
|
@@ -16318,6 +16378,56 @@ function watchForEvents() {
|
|
|
16318
16378
|
}, _marked$1);
|
|
16319
16379
|
}
|
|
16320
16380
|
|
|
16381
|
+
var SDKErrorTypeEnum = {
|
|
16382
|
+
BadRequest: {
|
|
16383
|
+
value: 'BadRequest',
|
|
16384
|
+
isResendable: false
|
|
16385
|
+
},
|
|
16386
|
+
BadParam: {
|
|
16387
|
+
value: 'BadParam',
|
|
16388
|
+
isResendable: false
|
|
16389
|
+
},
|
|
16390
|
+
NotFound: {
|
|
16391
|
+
value: 'NotFound',
|
|
16392
|
+
isResendable: false
|
|
16393
|
+
},
|
|
16394
|
+
NotAllowed: {
|
|
16395
|
+
value: 'NotAllowed',
|
|
16396
|
+
isResendable: false
|
|
16397
|
+
},
|
|
16398
|
+
TooLargeRequest: {
|
|
16399
|
+
value: 'TooLargeRequest',
|
|
16400
|
+
isResendable: false
|
|
16401
|
+
},
|
|
16402
|
+
InternalError: {
|
|
16403
|
+
value: 'InternalError',
|
|
16404
|
+
isResendable: true
|
|
16405
|
+
},
|
|
16406
|
+
TooManyRequests: {
|
|
16407
|
+
value: 'TooManyRequests',
|
|
16408
|
+
isResendable: true
|
|
16409
|
+
},
|
|
16410
|
+
Authentication: {
|
|
16411
|
+
value: 'Authentication',
|
|
16412
|
+
isResendable: true
|
|
16413
|
+
}
|
|
16414
|
+
};
|
|
16415
|
+
var fromValue = function fromValue(value) {
|
|
16416
|
+
if (!value) return null;
|
|
16417
|
+
var entries = Object.values(SDKErrorTypeEnum);
|
|
16418
|
+
return entries.find(function (entry) {
|
|
16419
|
+
return entry.value === value;
|
|
16420
|
+
}) || null;
|
|
16421
|
+
};
|
|
16422
|
+
var isResendableError = function isResendableError(value) {
|
|
16423
|
+
var _errorType$isResendab;
|
|
16424
|
+
if (!value) {
|
|
16425
|
+
return true;
|
|
16426
|
+
}
|
|
16427
|
+
var errorType = fromValue(value);
|
|
16428
|
+
return (_errorType$isResendab = errorType === null || errorType === void 0 ? void 0 : errorType.isResendable) != null ? _errorType$isResendab : true;
|
|
16429
|
+
};
|
|
16430
|
+
|
|
16321
16431
|
var _marked$2 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
16322
16432
|
_marked2$1 = /*#__PURE__*/_regenerator().m(getChannels),
|
|
16323
16433
|
_marked3 = /*#__PURE__*/_regenerator().m(searchChannels),
|
|
@@ -16338,26 +16448,27 @@ var _marked$2 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
|
16338
16448
|
_marked16 = /*#__PURE__*/_regenerator().m(unpinChannel),
|
|
16339
16449
|
_marked17 = /*#__PURE__*/_regenerator().m(removeChannelCaches),
|
|
16340
16450
|
_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(
|
|
16451
|
+
_marked19 = /*#__PURE__*/_regenerator().m(deletePendingDeleteChannels),
|
|
16452
|
+
_marked20 = /*#__PURE__*/_regenerator().m(deleteChannel),
|
|
16453
|
+
_marked21 = /*#__PURE__*/_regenerator().m(blockChannel),
|
|
16454
|
+
_marked22 = /*#__PURE__*/_regenerator().m(updateChannel),
|
|
16455
|
+
_marked23 = /*#__PURE__*/_regenerator().m(checkUsersStatus),
|
|
16456
|
+
_marked24 = /*#__PURE__*/_regenerator().m(sendTyping),
|
|
16457
|
+
_marked25 = /*#__PURE__*/_regenerator().m(sendRecording),
|
|
16458
|
+
_marked26 = /*#__PURE__*/_regenerator().m(clearHistory),
|
|
16459
|
+
_marked27 = /*#__PURE__*/_regenerator().m(deleteAllMessages),
|
|
16460
|
+
_marked28 = /*#__PURE__*/_regenerator().m(joinChannel),
|
|
16461
|
+
_marked29 = /*#__PURE__*/_regenerator().m(watchForChannelEvents),
|
|
16462
|
+
_marked30 = /*#__PURE__*/_regenerator().m(createChannelInviteKey),
|
|
16463
|
+
_marked31 = /*#__PURE__*/_regenerator().m(getChannelInviteKeys),
|
|
16464
|
+
_marked32 = /*#__PURE__*/_regenerator().m(regenerateChannelInviteKey),
|
|
16465
|
+
_marked33 = /*#__PURE__*/_regenerator().m(updateChannelInviteKey),
|
|
16466
|
+
_marked34 = /*#__PURE__*/_regenerator().m(getChannelByInviteKey),
|
|
16467
|
+
_marked35 = /*#__PURE__*/_regenerator().m(joinChannelWithInviteKey),
|
|
16468
|
+
_marked36 = /*#__PURE__*/_regenerator().m(setMessageRetentionPeriod),
|
|
16469
|
+
_marked37 = /*#__PURE__*/_regenerator().m(getChannelsWithUser),
|
|
16470
|
+
_marked38 = /*#__PURE__*/_regenerator().m(loadMoreMutualChannels),
|
|
16471
|
+
_marked39 = /*#__PURE__*/_regenerator().m(ChannelsSaga);
|
|
16361
16472
|
function createChannel(action) {
|
|
16362
16473
|
var payload, channelData, dontCreateIfNotExists, callback, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, whoDoesNotAdded, checkChannelExist, messageToSend, _allChannels, _memberId, _t;
|
|
16363
16474
|
return _regenerator().w(function (_context) {
|
|
@@ -16565,20 +16676,23 @@ function getChannels(action) {
|
|
|
16565
16676
|
_context2.p = 1;
|
|
16566
16677
|
payload = action.payload;
|
|
16567
16678
|
params = payload.params;
|
|
16679
|
+
_context2.n = 2;
|
|
16680
|
+
return effects.call(deletePendingDeleteChannels);
|
|
16681
|
+
case 2:
|
|
16568
16682
|
log.info(new Date().toISOString() + " [getChannels] input params: " + JSON.stringify(params));
|
|
16569
16683
|
SceytChatClient = getClient();
|
|
16570
16684
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
16571
16685
|
log.info(new Date().toISOString() + " [getChannels] connection status: " + connectionStatus);
|
|
16572
16686
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
16573
|
-
_context2.n =
|
|
16687
|
+
_context2.n = 3;
|
|
16574
16688
|
break;
|
|
16575
16689
|
}
|
|
16576
16690
|
log.warn(new Date().toISOString() + " [getChannels] connection not ready, aborting. Status: " + connectionStatus);
|
|
16577
16691
|
return _context2.a(2);
|
|
16578
|
-
case 2:
|
|
16579
|
-
_context2.n = 3;
|
|
16580
|
-
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
16581
16692
|
case 3:
|
|
16693
|
+
_context2.n = 4;
|
|
16694
|
+
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
16695
|
+
case 4:
|
|
16582
16696
|
channelQueryBuilder = new SceytChatClient.ChannelListQueryBuilder();
|
|
16583
16697
|
channelTypesFilter = getChannelTypesFilter();
|
|
16584
16698
|
log.info(new Date().toISOString() + " [getChannels] channelTypesFilter: " + JSON.stringify(channelTypesFilter));
|
|
@@ -16601,50 +16715,50 @@ function getChannels(action) {
|
|
|
16601
16715
|
limit = params.limit || 50;
|
|
16602
16716
|
log.info(new Date().toISOString() + " [getChannels] query limit: " + limit);
|
|
16603
16717
|
channelQueryBuilder.limit(limit);
|
|
16604
|
-
_context2.n =
|
|
16718
|
+
_context2.n = 5;
|
|
16605
16719
|
return effects.call(channelQueryBuilder.build);
|
|
16606
|
-
case
|
|
16720
|
+
case 5:
|
|
16607
16721
|
channelQuery = _context2.v;
|
|
16608
16722
|
log.info(new Date().toISOString() + " [getChannels] query built successfully");
|
|
16609
|
-
_context2.n =
|
|
16723
|
+
_context2.n = 6;
|
|
16610
16724
|
return effects.call(channelQuery.loadNextPage);
|
|
16611
|
-
case
|
|
16725
|
+
case 6:
|
|
16612
16726
|
channelsData = _context2.v;
|
|
16613
16727
|
channelList = channelsData.channels;
|
|
16614
16728
|
log.info(new Date().toISOString() + " [getChannels] channelsData received: " + JSON.stringify({
|
|
16615
16729
|
channelsCount: (channelList === null || channelList === void 0 ? void 0 : channelList.length) || 0,
|
|
16616
16730
|
hasNext: channelsData.hasNext
|
|
16617
16731
|
}));
|
|
16618
|
-
_context2.n = 6;
|
|
16619
|
-
return effects.put(channelHasNextAC(channelsData.hasNext));
|
|
16620
|
-
case 6:
|
|
16621
16732
|
_context2.n = 7;
|
|
16622
|
-
return effects.
|
|
16733
|
+
return effects.put(channelHasNextAC(channelsData.hasNext));
|
|
16623
16734
|
case 7:
|
|
16735
|
+
_context2.n = 8;
|
|
16736
|
+
return effects.call(getActiveChannelId);
|
|
16737
|
+
case 8:
|
|
16624
16738
|
channelId = _context2.v;
|
|
16625
16739
|
log.info(new Date().toISOString() + " [getChannels] active channelId: " + channelId);
|
|
16626
16740
|
if (!channelId) {
|
|
16627
|
-
_context2.n =
|
|
16741
|
+
_context2.n = 10;
|
|
16628
16742
|
break;
|
|
16629
16743
|
}
|
|
16630
|
-
_context2.n =
|
|
16744
|
+
_context2.n = 9;
|
|
16631
16745
|
return effects.call(getChannelFromMap, channelId);
|
|
16632
|
-
case
|
|
16746
|
+
case 9:
|
|
16633
16747
|
_t2 = _context2.v;
|
|
16634
|
-
_context2.n =
|
|
16748
|
+
_context2.n = 11;
|
|
16635
16749
|
break;
|
|
16636
|
-
case 9:
|
|
16637
|
-
_t2 = null;
|
|
16638
16750
|
case 10:
|
|
16751
|
+
_t2 = null;
|
|
16752
|
+
case 11:
|
|
16639
16753
|
activeChannel = _t2;
|
|
16640
16754
|
log.info(new Date().toISOString() + " [getChannels] activeChannel from map: " + (activeChannel ? (_activeChannel = activeChannel) === null || _activeChannel === void 0 ? void 0 : _activeChannel.id : 'null'));
|
|
16641
|
-
_context2.n =
|
|
16755
|
+
_context2.n = 12;
|
|
16642
16756
|
return effects.call(destroyChannelsMap);
|
|
16643
|
-
case
|
|
16757
|
+
case 12:
|
|
16644
16758
|
log.info(new Date().toISOString() + " [getChannels] channels map destroyed");
|
|
16645
|
-
_context2.n =
|
|
16759
|
+
_context2.n = 13;
|
|
16646
16760
|
return effects.call(setChannelsInMap, channelList);
|
|
16647
|
-
case
|
|
16761
|
+
case 13:
|
|
16648
16762
|
_yield$call = _context2.v;
|
|
16649
16763
|
mappedChannels = _yield$call.channels;
|
|
16650
16764
|
channelsForUpdateLastReactionMessage = _yield$call.channelsForUpdateLastReactionMessage;
|
|
@@ -16654,12 +16768,12 @@ function getChannels(action) {
|
|
|
16654
16768
|
}));
|
|
16655
16769
|
log.info(new Date().toISOString() + " channelsForUpdateLastReactionMessage: " + (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length));
|
|
16656
16770
|
if (!(channelsForUpdateLastReactionMessage !== null && channelsForUpdateLastReactionMessage !== void 0 && channelsForUpdateLastReactionMessage.length)) {
|
|
16657
|
-
_context2.n =
|
|
16771
|
+
_context2.n = 15;
|
|
16658
16772
|
break;
|
|
16659
16773
|
}
|
|
16660
16774
|
log.info(new Date().toISOString() + " [getChannels] processing channels for\n reaction message update: " + (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length));
|
|
16661
16775
|
channelMessageMap = {};
|
|
16662
|
-
_context2.n =
|
|
16776
|
+
_context2.n = 14;
|
|
16663
16777
|
return effects.call(function () {
|
|
16664
16778
|
try {
|
|
16665
16779
|
return Promise.resolve(Promise.all(channelsForUpdateLastReactionMessage.map(function (channel) {
|
|
@@ -16682,7 +16796,7 @@ function getChannels(action) {
|
|
|
16682
16796
|
return Promise.reject(e);
|
|
16683
16797
|
}
|
|
16684
16798
|
});
|
|
16685
|
-
case
|
|
16799
|
+
case 14:
|
|
16686
16800
|
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
16801
|
mappedChannels = mappedChannels.map(function (channel) {
|
|
16688
16802
|
if (channelMessageMap[channel === null || channel === void 0 ? void 0 : channel.id]) {
|
|
@@ -16691,31 +16805,31 @@ function getChannels(action) {
|
|
|
16691
16805
|
return channel;
|
|
16692
16806
|
});
|
|
16693
16807
|
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
|
|
16808
|
+
case 15:
|
|
16695
16809
|
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 =
|
|
16810
|
+
_context2.n = 16;
|
|
16697
16811
|
return effects.put(setChannelsAC(mappedChannels));
|
|
16698
|
-
case
|
|
16812
|
+
case 16:
|
|
16699
16813
|
if (!channelId) {
|
|
16700
16814
|
activeChannel = channelList[0];
|
|
16701
16815
|
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
16816
|
}
|
|
16703
16817
|
query.channelQuery = channelQuery;
|
|
16704
16818
|
if (!(activeChannel && getAutoSelectFitsChannel())) {
|
|
16705
|
-
_context2.n =
|
|
16819
|
+
_context2.n = 17;
|
|
16706
16820
|
break;
|
|
16707
16821
|
}
|
|
16708
16822
|
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
16823
|
_context2.n = 17;
|
|
16713
|
-
return effects.put(
|
|
16824
|
+
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
16714
16825
|
case 17:
|
|
16826
|
+
_context2.n = 18;
|
|
16827
|
+
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
16828
|
+
case 18:
|
|
16715
16829
|
hiddenList = store.getState().ChannelReducer.hideChannelList;
|
|
16716
16830
|
log.info(new Date().toISOString() + " [getChannels] hiddenList state: " + hiddenList);
|
|
16717
16831
|
if (hiddenList) {
|
|
16718
|
-
_context2.n =
|
|
16832
|
+
_context2.n = 29;
|
|
16719
16833
|
break;
|
|
16720
16834
|
}
|
|
16721
16835
|
log.info(new Date().toISOString() + " [getChannels] starting all channels query (hiddenList is false)");
|
|
@@ -16730,36 +16844,36 @@ function getChannels(action) {
|
|
|
16730
16844
|
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery memberCount: " + (params === null || params === void 0 ? void 0 : params.memberCount));
|
|
16731
16845
|
}
|
|
16732
16846
|
allChannelsQueryBuilder.limit(50);
|
|
16733
|
-
_context2.n =
|
|
16847
|
+
_context2.n = 19;
|
|
16734
16848
|
return effects.call(allChannelsQueryBuilder.build);
|
|
16735
|
-
case
|
|
16849
|
+
case 19:
|
|
16736
16850
|
allChannelsQuery = _context2.v;
|
|
16737
16851
|
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery built");
|
|
16738
16852
|
hasNext = true;
|
|
16739
16853
|
totalAllChannelsAdded = 0;
|
|
16740
16854
|
i = 0;
|
|
16741
|
-
case
|
|
16855
|
+
case 20:
|
|
16742
16856
|
if (!(i <= 4)) {
|
|
16743
|
-
_context2.n =
|
|
16857
|
+
_context2.n = 28;
|
|
16744
16858
|
break;
|
|
16745
16859
|
}
|
|
16746
16860
|
if (!hasNext) {
|
|
16747
|
-
_context2.n =
|
|
16861
|
+
_context2.n = 26;
|
|
16748
16862
|
break;
|
|
16749
16863
|
}
|
|
16750
|
-
_context2.p =
|
|
16864
|
+
_context2.p = 21;
|
|
16751
16865
|
_connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
16752
16866
|
if (!(_connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
16753
|
-
_context2.n =
|
|
16867
|
+
_context2.n = 22;
|
|
16754
16868
|
break;
|
|
16755
16869
|
}
|
|
16756
16870
|
log.warn(new Date().toISOString() + " [getChannels] connection not ready, aborting. Status: " + _connectionStatus);
|
|
16757
|
-
return _context2.a(3,
|
|
16758
|
-
case
|
|
16871
|
+
return _context2.a(3, 28);
|
|
16872
|
+
case 22:
|
|
16759
16873
|
log.info(new Date().toISOString() + " [getChannels] loading all channels page: " + (i + 1));
|
|
16760
|
-
_context2.n =
|
|
16874
|
+
_context2.n = 23;
|
|
16761
16875
|
return effects.call(allChannelsQuery.loadNextPage);
|
|
16762
|
-
case
|
|
16876
|
+
case 23:
|
|
16763
16877
|
allChannelsData = _context2.v;
|
|
16764
16878
|
hasNext = allChannelsData.hasNext;
|
|
16765
16879
|
allChannelList = allChannelsData.channels;
|
|
@@ -16770,34 +16884,34 @@ function getChannels(action) {
|
|
|
16770
16884
|
addChannelsToAllChannels(allChannelList);
|
|
16771
16885
|
totalAllChannelsAdded += (allChannelList === null || allChannelList === void 0 ? void 0 : allChannelList.length) || 0;
|
|
16772
16886
|
log.info(new Date().toISOString() + " [getChannels] total all channels added so far: " + totalAllChannelsAdded);
|
|
16773
|
-
_context2.n =
|
|
16887
|
+
_context2.n = 25;
|
|
16774
16888
|
break;
|
|
16775
|
-
case
|
|
16776
|
-
_context2.p =
|
|
16889
|
+
case 24:
|
|
16890
|
+
_context2.p = 24;
|
|
16777
16891
|
_t3 = _context2.v;
|
|
16778
16892
|
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;
|
|
16893
|
+
return _context2.a(3, 28);
|
|
16783
16894
|
case 25:
|
|
16784
|
-
|
|
16895
|
+
_context2.n = 27;
|
|
16896
|
+
break;
|
|
16785
16897
|
case 26:
|
|
16898
|
+
log.info(new Date().toISOString() + " [getChannels] no more pages available, stopping at iteration: " + i);
|
|
16899
|
+
case 27:
|
|
16786
16900
|
i++;
|
|
16787
|
-
_context2.n =
|
|
16901
|
+
_context2.n = 20;
|
|
16788
16902
|
break;
|
|
16789
|
-
case
|
|
16903
|
+
case 28:
|
|
16790
16904
|
log.info(new Date().toISOString() + " [getChannels] all channels query completed, total channels added: " + totalAllChannelsAdded);
|
|
16791
|
-
_context2.n =
|
|
16905
|
+
_context2.n = 30;
|
|
16792
16906
|
break;
|
|
16793
|
-
case 28:
|
|
16794
|
-
log.info(new Date().toISOString() + " [getChannels] skipping all channels query (hiddenList is true)");
|
|
16795
16907
|
case 29:
|
|
16908
|
+
log.info(new Date().toISOString() + " [getChannels] skipping all channels query (hiddenList is true)");
|
|
16909
|
+
case 30:
|
|
16796
16910
|
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 =
|
|
16911
|
+
_context2.n = 32;
|
|
16798
16912
|
break;
|
|
16799
|
-
case
|
|
16800
|
-
_context2.p =
|
|
16913
|
+
case 31:
|
|
16914
|
+
_context2.p = 31;
|
|
16801
16915
|
_t4 = _context2.v;
|
|
16802
16916
|
log.error(new Date().toISOString() + " [getChannels] error occurred: " + JSON.stringify(_t4), 'Error on get channels');
|
|
16803
16917
|
log.error(new Date().toISOString() + " [getChannels] error details: " + JSON.stringify({
|
|
@@ -16805,10 +16919,10 @@ function getChannels(action) {
|
|
|
16805
16919
|
code: _t4.code,
|
|
16806
16920
|
stack: _t4.stack
|
|
16807
16921
|
}));
|
|
16808
|
-
case
|
|
16922
|
+
case 32:
|
|
16809
16923
|
return _context2.a(2);
|
|
16810
16924
|
}
|
|
16811
|
-
}, _marked2$1, null, [[
|
|
16925
|
+
}, _marked2$1, null, [[21, 24], [1, 31]]);
|
|
16812
16926
|
}
|
|
16813
16927
|
function searchChannels(action) {
|
|
16814
16928
|
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;
|
|
@@ -17412,7 +17526,7 @@ function markMessagesRead(action) {
|
|
|
17412
17526
|
}, _marked9, null, [[2, 9]]);
|
|
17413
17527
|
}
|
|
17414
17528
|
function markVoiceMessageAsPlayed(action) {
|
|
17415
|
-
var payload, channelId, messageIds, channel, _t10;
|
|
17529
|
+
var payload, channelId, messageIds, channel, messageListMarker, _iterator6, _step6, messageId, updateParams, _t10;
|
|
17416
17530
|
return _regenerator().w(function (_context0) {
|
|
17417
17531
|
while (1) switch (_context0.p = _context0.n) {
|
|
17418
17532
|
case 0:
|
|
@@ -17430,25 +17544,54 @@ function markVoiceMessageAsPlayed(action) {
|
|
|
17430
17544
|
}
|
|
17431
17545
|
}
|
|
17432
17546
|
if (!channel) {
|
|
17433
|
-
_context0.n =
|
|
17547
|
+
_context0.n = 7;
|
|
17434
17548
|
break;
|
|
17435
17549
|
}
|
|
17436
17550
|
_context0.n = 3;
|
|
17437
17551
|
return effects.call(channel.markVoiceMessagesAsPlayed, messageIds);
|
|
17438
17552
|
case 3:
|
|
17553
|
+
messageListMarker = _context0.v;
|
|
17554
|
+
_iterator6 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
17555
|
+
case 4:
|
|
17556
|
+
if ((_step6 = _iterator6()).done) {
|
|
17557
|
+
_context0.n = 7;
|
|
17558
|
+
break;
|
|
17559
|
+
}
|
|
17560
|
+
messageId = _step6.value;
|
|
17561
|
+
updateParams = {
|
|
17562
|
+
deliveryStatus: MESSAGE_DELIVERY_STATUS.PLAYED,
|
|
17563
|
+
userMarkers: [{
|
|
17564
|
+
user: messageListMarker.user,
|
|
17565
|
+
createdAt: messageListMarker.createdAt,
|
|
17566
|
+
messageId: messageId,
|
|
17567
|
+
name: MESSAGE_DELIVERY_STATUS.READ
|
|
17568
|
+
}]
|
|
17569
|
+
};
|
|
17439
17570
|
_context0.n = 5;
|
|
17571
|
+
return effects.put(updateMessageAC(messageId, updateParams));
|
|
17572
|
+
case 5:
|
|
17573
|
+
updateMessageOnMap(channel.id, {
|
|
17574
|
+
messageId: messageId,
|
|
17575
|
+
params: updateParams
|
|
17576
|
+
});
|
|
17577
|
+
updateMessageOnAllMessages(messageId, updateParams);
|
|
17578
|
+
case 6:
|
|
17579
|
+
_context0.n = 4;
|
|
17440
17580
|
break;
|
|
17441
|
-
case
|
|
17442
|
-
_context0.
|
|
17581
|
+
case 7:
|
|
17582
|
+
_context0.n = 9;
|
|
17583
|
+
break;
|
|
17584
|
+
case 8:
|
|
17585
|
+
_context0.p = 8;
|
|
17443
17586
|
_t10 = _context0.v;
|
|
17444
17587
|
log.error(_t10, 'Error on mark voice messages read');
|
|
17445
|
-
case
|
|
17588
|
+
case 9:
|
|
17446
17589
|
return _context0.a(2);
|
|
17447
17590
|
}
|
|
17448
|
-
}, _marked0, null, [[1,
|
|
17591
|
+
}, _marked0, null, [[1, 8]]);
|
|
17449
17592
|
}
|
|
17450
17593
|
function markMessagesDelivered(action) {
|
|
17451
|
-
var payload, channelId, messageIds, channel, _t11;
|
|
17594
|
+
var payload, channelId, messageIds, channel, messageListMarker, _iterator7, _step7, messageId, updateParams, _t11;
|
|
17452
17595
|
return _regenerator().w(function (_context1) {
|
|
17453
17596
|
while (1) switch (_context1.p = _context1.n) {
|
|
17454
17597
|
case 0:
|
|
@@ -17466,23 +17609,52 @@ function markMessagesDelivered(action) {
|
|
|
17466
17609
|
}
|
|
17467
17610
|
}
|
|
17468
17611
|
if (!channel) {
|
|
17469
|
-
_context1.n =
|
|
17612
|
+
_context1.n = 7;
|
|
17470
17613
|
break;
|
|
17471
17614
|
}
|
|
17472
17615
|
log.info('send delivered marker ', messageIds);
|
|
17473
17616
|
_context1.n = 3;
|
|
17474
17617
|
return effects.call(channel.markMessagesAsReceived, messageIds);
|
|
17475
17618
|
case 3:
|
|
17619
|
+
messageListMarker = _context1.v;
|
|
17620
|
+
_iterator7 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
17621
|
+
case 4:
|
|
17622
|
+
if ((_step7 = _iterator7()).done) {
|
|
17623
|
+
_context1.n = 7;
|
|
17624
|
+
break;
|
|
17625
|
+
}
|
|
17626
|
+
messageId = _step7.value;
|
|
17627
|
+
updateParams = {
|
|
17628
|
+
deliveryStatus: MESSAGE_DELIVERY_STATUS.DELIVERED,
|
|
17629
|
+
userMarkers: [{
|
|
17630
|
+
user: messageListMarker.user,
|
|
17631
|
+
createdAt: messageListMarker.createdAt,
|
|
17632
|
+
messageId: messageId,
|
|
17633
|
+
name: MESSAGE_DELIVERY_STATUS.DELIVERED
|
|
17634
|
+
}]
|
|
17635
|
+
};
|
|
17476
17636
|
_context1.n = 5;
|
|
17637
|
+
return effects.put(updateMessageAC(messageId, updateParams));
|
|
17638
|
+
case 5:
|
|
17639
|
+
updateMessageOnMap(channel.id, {
|
|
17640
|
+
messageId: messageId,
|
|
17641
|
+
params: updateParams
|
|
17642
|
+
});
|
|
17643
|
+
updateMessageOnAllMessages(messageId, updateParams);
|
|
17644
|
+
case 6:
|
|
17645
|
+
_context1.n = 4;
|
|
17477
17646
|
break;
|
|
17478
|
-
case
|
|
17479
|
-
_context1.
|
|
17647
|
+
case 7:
|
|
17648
|
+
_context1.n = 9;
|
|
17649
|
+
break;
|
|
17650
|
+
case 8:
|
|
17651
|
+
_context1.p = 8;
|
|
17480
17652
|
_t11 = _context1.v;
|
|
17481
17653
|
log.error(_t11, 'Error on mark messages delivered');
|
|
17482
|
-
case
|
|
17654
|
+
case 9:
|
|
17483
17655
|
return _context1.a(2);
|
|
17484
17656
|
}
|
|
17485
|
-
}, _marked1, null, [[1,
|
|
17657
|
+
}, _marked1, null, [[1, 8]]);
|
|
17486
17658
|
}
|
|
17487
17659
|
function switchChannel(action) {
|
|
17488
17660
|
var payload, channel, updateActiveChannel, channelToSwitch, existingChannel, addChannel, _SceytChatClient5, fetchedChannel, channelFromMap, currentActiveChannel, _t12;
|
|
@@ -17879,50 +18051,52 @@ function leaveChannel(action) {
|
|
|
17879
18051
|
}
|
|
17880
18052
|
}, _marked18, null, [[0, 6]]);
|
|
17881
18053
|
}
|
|
17882
|
-
function
|
|
17883
|
-
var
|
|
18054
|
+
function deletePendingDeleteChannels() {
|
|
18055
|
+
var pendingDeleteChannels, _iterator8, _step8, channel, resendableError, _t20;
|
|
17884
18056
|
return _regenerator().w(function (_context19) {
|
|
17885
18057
|
while (1) switch (_context19.p = _context19.n) {
|
|
17886
18058
|
case 0:
|
|
17887
|
-
|
|
17888
|
-
|
|
17889
|
-
channelId = payload.channelId;
|
|
17890
|
-
_context19.n = 1;
|
|
17891
|
-
return effects.call(getChannelFromMap, channelId);
|
|
18059
|
+
pendingDeleteChannels = getPendingDeleteChannels();
|
|
18060
|
+
_iterator8 = _createForOfIteratorHelperLoose(pendingDeleteChannels);
|
|
17892
18061
|
case 1:
|
|
17893
|
-
|
|
17894
|
-
|
|
17895
|
-
channel = getChannelFromAllChannels(channelId);
|
|
17896
|
-
}
|
|
17897
|
-
if (!channel) {
|
|
17898
|
-
_context19.n = 5;
|
|
18062
|
+
if ((_step8 = _iterator8()).done) {
|
|
18063
|
+
_context19.n = 9;
|
|
17899
18064
|
break;
|
|
17900
18065
|
}
|
|
17901
|
-
|
|
17902
|
-
|
|
17903
|
-
case 2:
|
|
18066
|
+
channel = _step8.value;
|
|
18067
|
+
_context19.p = 2;
|
|
17904
18068
|
_context19.n = 3;
|
|
17905
|
-
return effects.
|
|
18069
|
+
return effects.call(channel["delete"]);
|
|
17906
18070
|
case 3:
|
|
17907
18071
|
_context19.n = 4;
|
|
17908
|
-
return effects.put(
|
|
18072
|
+
return effects.put(setChannelToRemoveAC(channel));
|
|
17909
18073
|
case 4:
|
|
17910
18074
|
_context19.n = 5;
|
|
17911
|
-
return effects.put(
|
|
18075
|
+
return effects.put(removeChannelAC(channel.id));
|
|
17912
18076
|
case 5:
|
|
17913
|
-
_context19.n =
|
|
17914
|
-
|
|
18077
|
+
_context19.n = 6;
|
|
18078
|
+
return effects.put(removeChannelCachesAC(channel.id));
|
|
17915
18079
|
case 6:
|
|
17916
|
-
|
|
17917
|
-
|
|
17918
|
-
|
|
18080
|
+
removePendingDeleteChannel(channel.id);
|
|
18081
|
+
_context19.n = 8;
|
|
18082
|
+
break;
|
|
17919
18083
|
case 7:
|
|
18084
|
+
_context19.p = 7;
|
|
18085
|
+
_t20 = _context19.v;
|
|
18086
|
+
resendableError = isResendableError(_t20 === null || _t20 === void 0 ? void 0 : _t20.type);
|
|
18087
|
+
if (!resendableError) {
|
|
18088
|
+
removePendingDeleteChannel(channel.id);
|
|
18089
|
+
}
|
|
18090
|
+
case 8:
|
|
18091
|
+
_context19.n = 1;
|
|
18092
|
+
break;
|
|
18093
|
+
case 9:
|
|
17920
18094
|
return _context19.a(2);
|
|
17921
18095
|
}
|
|
17922
|
-
}, _marked19, null, [[
|
|
18096
|
+
}, _marked19, null, [[2, 7]]);
|
|
17923
18097
|
}
|
|
17924
|
-
function
|
|
17925
|
-
var payload, channelId, channel, _t21;
|
|
18098
|
+
function deleteChannel(action) {
|
|
18099
|
+
var payload, channelId, channel, activeChannelId, lastChannel, _t21;
|
|
17926
18100
|
return _regenerator().w(function (_context20) {
|
|
17927
18101
|
while (1) switch (_context20.p = _context20.n) {
|
|
17928
18102
|
case 0:
|
|
@@ -17936,39 +18110,63 @@ function blockChannel(action) {
|
|
|
17936
18110
|
if (!channel) {
|
|
17937
18111
|
channel = getChannelFromAllChannels(channelId);
|
|
17938
18112
|
}
|
|
17939
|
-
if (!
|
|
17940
|
-
_context20.n =
|
|
18113
|
+
if (!(store.getState().UserReducer.connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
18114
|
+
_context20.n = 5;
|
|
17941
18115
|
break;
|
|
17942
18116
|
}
|
|
18117
|
+
setPendingDeleteChannel(channel);
|
|
17943
18118
|
_context20.n = 2;
|
|
17944
|
-
return effects.call(
|
|
18119
|
+
return effects.call(getActiveChannelId);
|
|
17945
18120
|
case 2:
|
|
18121
|
+
activeChannelId = _context20.v;
|
|
18122
|
+
if (!(activeChannelId === channelId)) {
|
|
18123
|
+
_context20.n = 4;
|
|
18124
|
+
break;
|
|
18125
|
+
}
|
|
17946
18126
|
_context20.n = 3;
|
|
17947
|
-
return effects.
|
|
18127
|
+
return effects.call(getLastChannelFromMap, true);
|
|
17948
18128
|
case 3:
|
|
18129
|
+
lastChannel = _context20.v;
|
|
17949
18130
|
_context20.n = 4;
|
|
17950
|
-
return effects.put(
|
|
18131
|
+
return effects.put(switchChannelActionAC(lastChannel || null));
|
|
17951
18132
|
case 4:
|
|
17952
|
-
_context20.
|
|
17953
|
-
break;
|
|
18133
|
+
return _context20.a(2);
|
|
17954
18134
|
case 5:
|
|
17955
|
-
|
|
17956
|
-
|
|
17957
|
-
|
|
18135
|
+
if (!channel) {
|
|
18136
|
+
_context20.n = 9;
|
|
18137
|
+
break;
|
|
18138
|
+
}
|
|
18139
|
+
_context20.n = 6;
|
|
18140
|
+
return effects.call(channel["delete"]);
|
|
17958
18141
|
case 6:
|
|
18142
|
+
_context20.n = 7;
|
|
18143
|
+
return effects.put(setChannelToRemoveAC(channel));
|
|
18144
|
+
case 7:
|
|
18145
|
+
_context20.n = 8;
|
|
18146
|
+
return effects.put(removeChannelAC(channelId));
|
|
18147
|
+
case 8:
|
|
18148
|
+
_context20.n = 9;
|
|
18149
|
+
return effects.put(removeChannelCachesAC(channelId));
|
|
18150
|
+
case 9:
|
|
18151
|
+
_context20.n = 11;
|
|
18152
|
+
break;
|
|
18153
|
+
case 10:
|
|
18154
|
+
_context20.p = 10;
|
|
18155
|
+
_t21 = _context20.v;
|
|
18156
|
+
log.error('ERROR in delete channel', _t21);
|
|
18157
|
+
case 11:
|
|
17959
18158
|
return _context20.a(2);
|
|
17960
18159
|
}
|
|
17961
|
-
}, _marked20, null, [[0,
|
|
18160
|
+
}, _marked20, null, [[0, 10]]);
|
|
17962
18161
|
}
|
|
17963
|
-
function
|
|
17964
|
-
var payload, channelId,
|
|
18162
|
+
function blockChannel(action) {
|
|
18163
|
+
var payload, channelId, channel, _t22;
|
|
17965
18164
|
return _regenerator().w(function (_context21) {
|
|
17966
18165
|
while (1) switch (_context21.p = _context21.n) {
|
|
17967
18166
|
case 0:
|
|
17968
18167
|
_context21.p = 0;
|
|
17969
18168
|
payload = action.payload;
|
|
17970
|
-
channelId = payload.channelId
|
|
17971
|
-
_SceytChatClient6 = getClient();
|
|
18169
|
+
channelId = payload.channelId;
|
|
17972
18170
|
_context21.n = 1;
|
|
17973
18171
|
return effects.call(getChannelFromMap, channelId);
|
|
17974
18172
|
case 1:
|
|
@@ -17976,6 +18174,46 @@ function updateChannel(action) {
|
|
|
17976
18174
|
if (!channel) {
|
|
17977
18175
|
channel = getChannelFromAllChannels(channelId);
|
|
17978
18176
|
}
|
|
18177
|
+
if (!channel) {
|
|
18178
|
+
_context21.n = 4;
|
|
18179
|
+
break;
|
|
18180
|
+
}
|
|
18181
|
+
_context21.n = 2;
|
|
18182
|
+
return effects.call(channel.block);
|
|
18183
|
+
case 2:
|
|
18184
|
+
_context21.n = 3;
|
|
18185
|
+
return effects.put(removeChannelAC(channelId));
|
|
18186
|
+
case 3:
|
|
18187
|
+
_context21.n = 4;
|
|
18188
|
+
return effects.put(removeChannelCachesAC(channelId));
|
|
18189
|
+
case 4:
|
|
18190
|
+
_context21.n = 6;
|
|
18191
|
+
break;
|
|
18192
|
+
case 5:
|
|
18193
|
+
_context21.p = 5;
|
|
18194
|
+
_t22 = _context21.v;
|
|
18195
|
+
log.error('ERROR in block channel - ', _t22.message);
|
|
18196
|
+
case 6:
|
|
18197
|
+
return _context21.a(2);
|
|
18198
|
+
}
|
|
18199
|
+
}, _marked21, null, [[0, 5]]);
|
|
18200
|
+
}
|
|
18201
|
+
function updateChannel(action) {
|
|
18202
|
+
var payload, channelId, config, _SceytChatClient6, channel, paramsToUpdate, fileToUpload, _yield$call5, subject, avatarUrl, metadata, onUpdateChannel, _channel3, _channel4, _channel5, fields, updatedChannel, _t23;
|
|
18203
|
+
return _regenerator().w(function (_context22) {
|
|
18204
|
+
while (1) switch (_context22.p = _context22.n) {
|
|
18205
|
+
case 0:
|
|
18206
|
+
_context22.p = 0;
|
|
18207
|
+
payload = action.payload;
|
|
18208
|
+
channelId = payload.channelId, config = payload.config;
|
|
18209
|
+
_SceytChatClient6 = getClient();
|
|
18210
|
+
_context22.n = 1;
|
|
18211
|
+
return effects.call(getChannelFromMap, channelId);
|
|
18212
|
+
case 1:
|
|
18213
|
+
channel = _context22.v;
|
|
18214
|
+
if (!channel) {
|
|
18215
|
+
channel = getChannelFromAllChannels(channelId);
|
|
18216
|
+
}
|
|
17979
18217
|
paramsToUpdate = {
|
|
17980
18218
|
uri: channel.uri,
|
|
17981
18219
|
subject: channel.subject,
|
|
@@ -17983,7 +18221,7 @@ function updateChannel(action) {
|
|
|
17983
18221
|
avatarUrl: channel.avatarUrl
|
|
17984
18222
|
};
|
|
17985
18223
|
if (!config.avatar) {
|
|
17986
|
-
|
|
18224
|
+
_context22.n = 3;
|
|
17987
18225
|
break;
|
|
17988
18226
|
}
|
|
17989
18227
|
fileToUpload = {
|
|
@@ -17992,10 +18230,10 @@ function updateChannel(action) {
|
|
|
17992
18230
|
log.info('upload percent - ', progressPercent);
|
|
17993
18231
|
}
|
|
17994
18232
|
};
|
|
17995
|
-
|
|
18233
|
+
_context22.n = 2;
|
|
17996
18234
|
return effects.call(_SceytChatClient6.uploadFile, fileToUpload);
|
|
17997
18235
|
case 2:
|
|
17998
|
-
paramsToUpdate.avatarUrl =
|
|
18236
|
+
paramsToUpdate.avatarUrl = _context22.v;
|
|
17999
18237
|
case 3:
|
|
18000
18238
|
if (config.subject) {
|
|
18001
18239
|
paramsToUpdate.subject = config.subject;
|
|
@@ -18006,14 +18244,14 @@ function updateChannel(action) {
|
|
|
18006
18244
|
if (config.avatarUrl === '') {
|
|
18007
18245
|
paramsToUpdate.avatarUrl = '';
|
|
18008
18246
|
}
|
|
18009
|
-
|
|
18247
|
+
_context22.n = 4;
|
|
18010
18248
|
return effects.call(channel.update, paramsToUpdate);
|
|
18011
18249
|
case 4:
|
|
18012
|
-
_yield$call5 =
|
|
18250
|
+
_yield$call5 = _context22.v;
|
|
18013
18251
|
subject = _yield$call5.subject;
|
|
18014
18252
|
avatarUrl = _yield$call5.avatarUrl;
|
|
18015
18253
|
metadata = _yield$call5.metadata;
|
|
18016
|
-
|
|
18254
|
+
_context22.n = 5;
|
|
18017
18255
|
return effects.put(updateChannelDataAC(channelId, {
|
|
18018
18256
|
subject: subject,
|
|
18019
18257
|
avatarUrl: avatarUrl,
|
|
@@ -18027,7 +18265,7 @@ function updateChannel(action) {
|
|
|
18027
18265
|
});
|
|
18028
18266
|
onUpdateChannel = getOnUpdateChannel();
|
|
18029
18267
|
if (!onUpdateChannel) {
|
|
18030
|
-
|
|
18268
|
+
_context22.n = 7;
|
|
18031
18269
|
break;
|
|
18032
18270
|
}
|
|
18033
18271
|
fields = [];
|
|
@@ -18040,35 +18278,35 @@ function updateChannel(action) {
|
|
|
18040
18278
|
if (JSON.stringify((_channel5 = channel) === null || _channel5 === void 0 ? void 0 : _channel5.metadata) !== metadata) {
|
|
18041
18279
|
fields.push('metadata');
|
|
18042
18280
|
}
|
|
18043
|
-
|
|
18281
|
+
_context22.n = 6;
|
|
18044
18282
|
return effects.call(getChannelFromMap, channelId);
|
|
18045
18283
|
case 6:
|
|
18046
|
-
updatedChannel =
|
|
18284
|
+
updatedChannel = _context22.v;
|
|
18047
18285
|
onUpdateChannel(updatedChannel, fields);
|
|
18048
18286
|
case 7:
|
|
18049
|
-
|
|
18287
|
+
_context22.n = 9;
|
|
18050
18288
|
break;
|
|
18051
18289
|
case 8:
|
|
18052
|
-
|
|
18053
|
-
|
|
18054
|
-
log.error('ERROR in update channel',
|
|
18290
|
+
_context22.p = 8;
|
|
18291
|
+
_t23 = _context22.v;
|
|
18292
|
+
log.error('ERROR in update channel', _t23.message);
|
|
18055
18293
|
case 9:
|
|
18056
|
-
return
|
|
18294
|
+
return _context22.a(2);
|
|
18057
18295
|
}
|
|
18058
|
-
},
|
|
18296
|
+
}, _marked22, null, [[0, 8]]);
|
|
18059
18297
|
}
|
|
18060
18298
|
function checkUsersStatus() {
|
|
18061
|
-
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData,
|
|
18062
|
-
return _regenerator().w(function (
|
|
18063
|
-
while (1) switch (
|
|
18299
|
+
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData, _t24;
|
|
18300
|
+
return _regenerator().w(function (_context23) {
|
|
18301
|
+
while (1) switch (_context23.p = _context23.n) {
|
|
18064
18302
|
case 0:
|
|
18065
|
-
|
|
18303
|
+
_context23.p = 0;
|
|
18066
18304
|
_SceytChatClient7 = getClient();
|
|
18067
18305
|
usersForUpdate = Object.keys(usersMap);
|
|
18068
|
-
|
|
18306
|
+
_context23.n = 1;
|
|
18069
18307
|
return effects.call(_SceytChatClient7.getUsers, usersForUpdate);
|
|
18070
18308
|
case 1:
|
|
18071
|
-
updatedUsers =
|
|
18309
|
+
updatedUsers = _context23.v;
|
|
18072
18310
|
usersToUpdateMap = {};
|
|
18073
18311
|
update = false;
|
|
18074
18312
|
updatedUsers.forEach(function (updatedUser) {
|
|
@@ -18080,149 +18318,149 @@ function checkUsersStatus() {
|
|
|
18080
18318
|
}
|
|
18081
18319
|
});
|
|
18082
18320
|
if (!update) {
|
|
18083
|
-
|
|
18321
|
+
_context23.n = 4;
|
|
18084
18322
|
break;
|
|
18085
18323
|
}
|
|
18086
18324
|
updateData = JSON.parse(JSON.stringify(usersToUpdateMap));
|
|
18087
|
-
|
|
18325
|
+
_context23.n = 2;
|
|
18088
18326
|
return effects.put(updateMembersPresenceAC(updateData));
|
|
18089
18327
|
case 2:
|
|
18090
|
-
|
|
18328
|
+
_context23.n = 3;
|
|
18091
18329
|
return effects.put(updateUserStatusOnMapAC(updateData));
|
|
18092
18330
|
case 3:
|
|
18093
|
-
|
|
18331
|
+
_context23.n = 4;
|
|
18094
18332
|
return effects.put(updateUserStatusOnChannelAC(updateData));
|
|
18095
18333
|
case 4:
|
|
18096
|
-
|
|
18334
|
+
_context23.n = 6;
|
|
18097
18335
|
break;
|
|
18098
18336
|
case 5:
|
|
18099
|
-
|
|
18100
|
-
|
|
18101
|
-
log.error('ERROR in check user status : ',
|
|
18337
|
+
_context23.p = 5;
|
|
18338
|
+
_t24 = _context23.v;
|
|
18339
|
+
log.error('ERROR in check user status : ', _t24.message);
|
|
18102
18340
|
case 6:
|
|
18103
|
-
return
|
|
18341
|
+
return _context23.a(2);
|
|
18104
18342
|
}
|
|
18105
|
-
},
|
|
18343
|
+
}, _marked23, null, [[0, 5]]);
|
|
18106
18344
|
}
|
|
18107
18345
|
function sendTyping(action) {
|
|
18108
|
-
var state, activeChannelId, channel,
|
|
18109
|
-
return _regenerator().w(function (
|
|
18110
|
-
while (1) switch (
|
|
18346
|
+
var state, activeChannelId, channel, _t25;
|
|
18347
|
+
return _regenerator().w(function (_context24) {
|
|
18348
|
+
while (1) switch (_context24.p = _context24.n) {
|
|
18111
18349
|
case 0:
|
|
18112
18350
|
state = action.payload.state;
|
|
18113
|
-
|
|
18351
|
+
_context24.n = 1;
|
|
18114
18352
|
return effects.call(getActiveChannelId);
|
|
18115
18353
|
case 1:
|
|
18116
|
-
activeChannelId =
|
|
18117
|
-
|
|
18354
|
+
activeChannelId = _context24.v;
|
|
18355
|
+
_context24.n = 2;
|
|
18118
18356
|
return effects.call(getChannelFromMap, activeChannelId);
|
|
18119
18357
|
case 2:
|
|
18120
|
-
channel =
|
|
18121
|
-
|
|
18358
|
+
channel = _context24.v;
|
|
18359
|
+
_context24.p = 3;
|
|
18122
18360
|
if (!channel) {
|
|
18123
|
-
|
|
18361
|
+
_context24.n = 6;
|
|
18124
18362
|
break;
|
|
18125
18363
|
}
|
|
18126
18364
|
if (!state) {
|
|
18127
|
-
|
|
18365
|
+
_context24.n = 5;
|
|
18128
18366
|
break;
|
|
18129
18367
|
}
|
|
18130
|
-
|
|
18368
|
+
_context24.n = 4;
|
|
18131
18369
|
return effects.call(channel.startTyping);
|
|
18132
18370
|
case 4:
|
|
18133
|
-
|
|
18371
|
+
_context24.n = 6;
|
|
18134
18372
|
break;
|
|
18135
18373
|
case 5:
|
|
18136
|
-
|
|
18374
|
+
_context24.n = 6;
|
|
18137
18375
|
return effects.call(channel.stopTyping);
|
|
18138
18376
|
case 6:
|
|
18139
|
-
|
|
18377
|
+
_context24.n = 8;
|
|
18140
18378
|
break;
|
|
18141
18379
|
case 7:
|
|
18142
|
-
|
|
18143
|
-
|
|
18144
|
-
log.error('ERROR in send typing',
|
|
18380
|
+
_context24.p = 7;
|
|
18381
|
+
_t25 = _context24.v;
|
|
18382
|
+
log.error('ERROR in send typing', _t25);
|
|
18145
18383
|
case 8:
|
|
18146
|
-
return
|
|
18384
|
+
return _context24.a(2);
|
|
18147
18385
|
}
|
|
18148
|
-
},
|
|
18386
|
+
}, _marked24, null, [[3, 7]]);
|
|
18149
18387
|
}
|
|
18150
18388
|
function sendRecording(action) {
|
|
18151
|
-
var _action$payload, state, channelId, channel,
|
|
18152
|
-
return _regenerator().w(function (
|
|
18153
|
-
while (1) switch (
|
|
18389
|
+
var _action$payload, state, channelId, channel, _t26;
|
|
18390
|
+
return _regenerator().w(function (_context25) {
|
|
18391
|
+
while (1) switch (_context25.p = _context25.n) {
|
|
18154
18392
|
case 0:
|
|
18155
18393
|
_action$payload = action.payload, state = _action$payload.state, channelId = _action$payload.channelId;
|
|
18156
|
-
|
|
18394
|
+
_context25.n = 1;
|
|
18157
18395
|
return effects.call(getChannelFromMap, channelId);
|
|
18158
18396
|
case 1:
|
|
18159
|
-
channel =
|
|
18160
|
-
|
|
18397
|
+
channel = _context25.v;
|
|
18398
|
+
_context25.p = 2;
|
|
18161
18399
|
if (!channel) {
|
|
18162
|
-
|
|
18400
|
+
_context25.n = 5;
|
|
18163
18401
|
break;
|
|
18164
18402
|
}
|
|
18165
18403
|
if (!state) {
|
|
18166
|
-
|
|
18404
|
+
_context25.n = 4;
|
|
18167
18405
|
break;
|
|
18168
18406
|
}
|
|
18169
|
-
|
|
18407
|
+
_context25.n = 3;
|
|
18170
18408
|
return effects.call(channel.startRecording);
|
|
18171
18409
|
case 3:
|
|
18172
|
-
|
|
18410
|
+
_context25.n = 5;
|
|
18173
18411
|
break;
|
|
18174
18412
|
case 4:
|
|
18175
|
-
|
|
18413
|
+
_context25.n = 5;
|
|
18176
18414
|
return effects.call(channel.stopRecording);
|
|
18177
18415
|
case 5:
|
|
18178
|
-
|
|
18416
|
+
_context25.n = 7;
|
|
18179
18417
|
break;
|
|
18180
18418
|
case 6:
|
|
18181
|
-
|
|
18182
|
-
|
|
18183
|
-
log.error('ERROR in send recording',
|
|
18419
|
+
_context25.p = 6;
|
|
18420
|
+
_t26 = _context25.v;
|
|
18421
|
+
log.error('ERROR in send recording', _t26);
|
|
18184
18422
|
case 7:
|
|
18185
|
-
return
|
|
18423
|
+
return _context25.a(2);
|
|
18186
18424
|
}
|
|
18187
|
-
},
|
|
18425
|
+
}, _marked25, null, [[2, 6]]);
|
|
18188
18426
|
}
|
|
18189
18427
|
function clearHistory(action) {
|
|
18190
|
-
var payload, channelId, channel, activeChannelId, groupName,
|
|
18191
|
-
return _regenerator().w(function (
|
|
18192
|
-
while (1) switch (
|
|
18428
|
+
var payload, channelId, channel, activeChannelId, groupName, _t27;
|
|
18429
|
+
return _regenerator().w(function (_context26) {
|
|
18430
|
+
while (1) switch (_context26.p = _context26.n) {
|
|
18193
18431
|
case 0:
|
|
18194
|
-
|
|
18432
|
+
_context26.p = 0;
|
|
18195
18433
|
payload = action.payload;
|
|
18196
18434
|
channelId = payload.channelId;
|
|
18197
|
-
|
|
18435
|
+
_context26.n = 1;
|
|
18198
18436
|
return effects.call(getChannelFromMap, channelId);
|
|
18199
18437
|
case 1:
|
|
18200
|
-
channel =
|
|
18438
|
+
channel = _context26.v;
|
|
18201
18439
|
if (!channel) {
|
|
18202
18440
|
channel = getChannelFromAllChannels(channelId);
|
|
18203
18441
|
}
|
|
18204
|
-
|
|
18442
|
+
_context26.n = 2;
|
|
18205
18443
|
return effects.call(getActiveChannelId);
|
|
18206
18444
|
case 2:
|
|
18207
|
-
activeChannelId =
|
|
18445
|
+
activeChannelId = _context26.v;
|
|
18208
18446
|
if (!channel) {
|
|
18209
|
-
|
|
18447
|
+
_context26.n = 7;
|
|
18210
18448
|
break;
|
|
18211
18449
|
}
|
|
18212
|
-
|
|
18450
|
+
_context26.n = 3;
|
|
18213
18451
|
return effects.call(channel.deleteAllMessages);
|
|
18214
18452
|
case 3:
|
|
18215
|
-
|
|
18453
|
+
_context26.n = 4;
|
|
18216
18454
|
return effects.put(clearMessagesAC());
|
|
18217
18455
|
case 4:
|
|
18218
18456
|
removeMessagesFromMap(channelId);
|
|
18219
18457
|
if (channelId === activeChannelId) {
|
|
18220
18458
|
removeAllMessages();
|
|
18221
18459
|
}
|
|
18222
|
-
|
|
18460
|
+
_context26.n = 5;
|
|
18223
18461
|
return effects.put(clearSelectedMessagesAC());
|
|
18224
18462
|
case 5:
|
|
18225
|
-
|
|
18463
|
+
_context26.n = 6;
|
|
18226
18464
|
return effects.put(updateChannelDataAC(channel.id, {
|
|
18227
18465
|
lastMessage: null,
|
|
18228
18466
|
newMessageCount: 0,
|
|
@@ -18235,64 +18473,64 @@ function clearHistory(action) {
|
|
|
18235
18473
|
newMentionCount: 0
|
|
18236
18474
|
});
|
|
18237
18475
|
groupName = getChannelGroupName(channel);
|
|
18238
|
-
|
|
18476
|
+
_context26.n = 7;
|
|
18239
18477
|
return effects.put(updateSearchedChannelDataAC(channel.id, {
|
|
18240
18478
|
lastMessage: null,
|
|
18241
18479
|
newMessageCount: 0,
|
|
18242
18480
|
newMentionCount: 0
|
|
18243
18481
|
}, groupName));
|
|
18244
18482
|
case 7:
|
|
18245
|
-
|
|
18483
|
+
_context26.n = 9;
|
|
18246
18484
|
break;
|
|
18247
18485
|
case 8:
|
|
18248
|
-
|
|
18249
|
-
|
|
18250
|
-
log.error('ERROR in clear history',
|
|
18486
|
+
_context26.p = 8;
|
|
18487
|
+
_t27 = _context26.v;
|
|
18488
|
+
log.error('ERROR in clear history', _t27);
|
|
18251
18489
|
case 9:
|
|
18252
|
-
return
|
|
18490
|
+
return _context26.a(2);
|
|
18253
18491
|
}
|
|
18254
|
-
},
|
|
18492
|
+
}, _marked26, null, [[0, 8]]);
|
|
18255
18493
|
}
|
|
18256
18494
|
function deleteAllMessages(action) {
|
|
18257
|
-
var payload, channelId, channel, activeChannelId, groupName,
|
|
18258
|
-
return _regenerator().w(function (
|
|
18259
|
-
while (1) switch (
|
|
18495
|
+
var payload, channelId, channel, activeChannelId, groupName, _t28;
|
|
18496
|
+
return _regenerator().w(function (_context27) {
|
|
18497
|
+
while (1) switch (_context27.p = _context27.n) {
|
|
18260
18498
|
case 0:
|
|
18261
|
-
|
|
18499
|
+
_context27.p = 0;
|
|
18262
18500
|
payload = action.payload;
|
|
18263
18501
|
channelId = payload.channelId;
|
|
18264
|
-
|
|
18502
|
+
_context27.n = 1;
|
|
18265
18503
|
return effects.call(getChannelFromMap, channelId);
|
|
18266
18504
|
case 1:
|
|
18267
|
-
channel =
|
|
18505
|
+
channel = _context27.v;
|
|
18268
18506
|
if (!channel) {
|
|
18269
18507
|
channel = getChannelFromAllChannels(channelId);
|
|
18270
18508
|
}
|
|
18271
|
-
|
|
18509
|
+
_context27.n = 2;
|
|
18272
18510
|
return effects.call(getActiveChannelId);
|
|
18273
18511
|
case 2:
|
|
18274
|
-
activeChannelId =
|
|
18512
|
+
activeChannelId = _context27.v;
|
|
18275
18513
|
if (!channel) {
|
|
18276
|
-
|
|
18514
|
+
_context27.n = 8;
|
|
18277
18515
|
break;
|
|
18278
18516
|
}
|
|
18279
|
-
|
|
18517
|
+
_context27.n = 3;
|
|
18280
18518
|
return effects.call(channel.deleteAllMessages, true);
|
|
18281
18519
|
case 3:
|
|
18282
18520
|
removeMessagesFromMap(channelId);
|
|
18283
18521
|
if (!(channelId === activeChannelId)) {
|
|
18284
|
-
|
|
18522
|
+
_context27.n = 5;
|
|
18285
18523
|
break;
|
|
18286
18524
|
}
|
|
18287
|
-
|
|
18525
|
+
_context27.n = 4;
|
|
18288
18526
|
return effects.put(clearMessagesAC());
|
|
18289
18527
|
case 4:
|
|
18290
18528
|
removeAllMessages();
|
|
18291
18529
|
case 5:
|
|
18292
|
-
|
|
18530
|
+
_context27.n = 6;
|
|
18293
18531
|
return effects.put(clearSelectedMessagesAC());
|
|
18294
18532
|
case 6:
|
|
18295
|
-
|
|
18533
|
+
_context27.n = 7;
|
|
18296
18534
|
return effects.put(updateChannelDataAC(channel.id, {
|
|
18297
18535
|
lastMessage: null,
|
|
18298
18536
|
newMessageCount: 0,
|
|
@@ -18305,230 +18543,230 @@ function deleteAllMessages(action) {
|
|
|
18305
18543
|
newMentionCount: 0
|
|
18306
18544
|
});
|
|
18307
18545
|
groupName = getChannelGroupName(channel);
|
|
18308
|
-
|
|
18546
|
+
_context27.n = 8;
|
|
18309
18547
|
return effects.put(updateSearchedChannelDataAC(channel.id, {
|
|
18310
18548
|
lastMessage: null,
|
|
18311
18549
|
newMessageCount: 0,
|
|
18312
18550
|
newMentionCount: 0
|
|
18313
18551
|
}, groupName));
|
|
18314
18552
|
case 8:
|
|
18315
|
-
|
|
18553
|
+
_context27.n = 10;
|
|
18316
18554
|
break;
|
|
18317
18555
|
case 9:
|
|
18318
|
-
|
|
18319
|
-
|
|
18320
|
-
log.error('ERROR in clear history',
|
|
18556
|
+
_context27.p = 9;
|
|
18557
|
+
_t28 = _context27.v;
|
|
18558
|
+
log.error('ERROR in clear history', _t28);
|
|
18321
18559
|
case 10:
|
|
18322
|
-
return
|
|
18560
|
+
return _context27.a(2);
|
|
18323
18561
|
}
|
|
18324
|
-
},
|
|
18562
|
+
}, _marked27, null, [[0, 9]]);
|
|
18325
18563
|
}
|
|
18326
18564
|
function joinChannel(action) {
|
|
18327
|
-
var payload, channelId, _SceytChatClient8, channel, joinedChannel,
|
|
18328
|
-
return _regenerator().w(function (
|
|
18329
|
-
while (1) switch (
|
|
18565
|
+
var payload, channelId, _SceytChatClient8, channel, joinedChannel, _t29;
|
|
18566
|
+
return _regenerator().w(function (_context28) {
|
|
18567
|
+
while (1) switch (_context28.p = _context28.n) {
|
|
18330
18568
|
case 0:
|
|
18331
|
-
|
|
18569
|
+
_context28.p = 0;
|
|
18332
18570
|
payload = action.payload;
|
|
18333
18571
|
channelId = payload.channelId;
|
|
18334
18572
|
_SceytChatClient8 = getClient();
|
|
18335
|
-
|
|
18573
|
+
_context28.n = 1;
|
|
18336
18574
|
return effects.call(getChannelFromMap, channelId);
|
|
18337
18575
|
case 1:
|
|
18338
|
-
channel =
|
|
18576
|
+
channel = _context28.v;
|
|
18339
18577
|
if (!channel) {
|
|
18340
18578
|
channel = getChannelFromAllChannels(channelId);
|
|
18341
18579
|
}
|
|
18342
18580
|
if (channel) {
|
|
18343
|
-
|
|
18581
|
+
_context28.n = 3;
|
|
18344
18582
|
break;
|
|
18345
18583
|
}
|
|
18346
|
-
|
|
18584
|
+
_context28.n = 2;
|
|
18347
18585
|
return effects.call(_SceytChatClient8.getChannel, channelId);
|
|
18348
18586
|
case 2:
|
|
18349
|
-
channel =
|
|
18587
|
+
channel = _context28.v;
|
|
18350
18588
|
case 3:
|
|
18351
|
-
|
|
18589
|
+
_context28.n = 4;
|
|
18352
18590
|
return effects.call(channel.join);
|
|
18353
18591
|
case 4:
|
|
18354
|
-
joinedChannel =
|
|
18355
|
-
|
|
18592
|
+
joinedChannel = _context28.v;
|
|
18593
|
+
_context28.n = 5;
|
|
18356
18594
|
return effects.put(setCloseSearchChannelsAC(true));
|
|
18357
18595
|
case 5:
|
|
18358
|
-
|
|
18596
|
+
_context28.n = 6;
|
|
18359
18597
|
return effects.put(setChannelToAddAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
18360
18598
|
case 6:
|
|
18361
|
-
|
|
18599
|
+
_context28.n = 7;
|
|
18362
18600
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
18363
18601
|
case 7:
|
|
18364
18602
|
addChannelToAllChannels(joinedChannel);
|
|
18365
|
-
|
|
18603
|
+
_context28.n = 8;
|
|
18366
18604
|
return effects.call(setActiveChannelId, joinedChannel.id);
|
|
18367
18605
|
case 8:
|
|
18368
|
-
|
|
18606
|
+
_context28.n = 10;
|
|
18369
18607
|
break;
|
|
18370
18608
|
case 9:
|
|
18371
|
-
|
|
18372
|
-
|
|
18373
|
-
log.error(
|
|
18609
|
+
_context28.p = 9;
|
|
18610
|
+
_t29 = _context28.v;
|
|
18611
|
+
log.error(_t29, 'Error in join to channel');
|
|
18374
18612
|
case 10:
|
|
18375
|
-
return
|
|
18613
|
+
return _context28.a(2);
|
|
18376
18614
|
}
|
|
18377
|
-
},
|
|
18615
|
+
}, _marked28, null, [[0, 9]]);
|
|
18378
18616
|
}
|
|
18379
18617
|
function watchForChannelEvents() {
|
|
18380
|
-
return _regenerator().w(function (
|
|
18381
|
-
while (1) switch (
|
|
18618
|
+
return _regenerator().w(function (_context29) {
|
|
18619
|
+
while (1) switch (_context29.n) {
|
|
18382
18620
|
case 0:
|
|
18383
|
-
|
|
18621
|
+
_context29.n = 1;
|
|
18384
18622
|
return effects.call(watchForEvents);
|
|
18385
18623
|
case 1:
|
|
18386
|
-
return
|
|
18624
|
+
return _context29.a(2);
|
|
18387
18625
|
}
|
|
18388
|
-
},
|
|
18626
|
+
}, _marked29);
|
|
18389
18627
|
}
|
|
18390
18628
|
function createChannelInviteKey(action) {
|
|
18391
|
-
var payload, channelId, _SceytChatClient9, channel, inviteKey,
|
|
18392
|
-
return _regenerator().w(function (
|
|
18393
|
-
while (1) switch (
|
|
18629
|
+
var payload, channelId, _SceytChatClient9, channel, inviteKey, _t30;
|
|
18630
|
+
return _regenerator().w(function (_context30) {
|
|
18631
|
+
while (1) switch (_context30.p = _context30.n) {
|
|
18394
18632
|
case 0:
|
|
18395
|
-
|
|
18633
|
+
_context30.p = 0;
|
|
18396
18634
|
payload = action.payload;
|
|
18397
18635
|
channelId = payload.channelId;
|
|
18398
18636
|
_SceytChatClient9 = getClient();
|
|
18399
|
-
|
|
18637
|
+
_context30.n = 1;
|
|
18400
18638
|
return effects.call(getChannelFromMap, channelId);
|
|
18401
18639
|
case 1:
|
|
18402
|
-
channel =
|
|
18640
|
+
channel = _context30.v;
|
|
18403
18641
|
if (!channel) {
|
|
18404
18642
|
channel = getChannelFromAllChannels(channelId);
|
|
18405
18643
|
}
|
|
18406
18644
|
if (!channel) {
|
|
18407
|
-
|
|
18645
|
+
_context30.n = 3;
|
|
18408
18646
|
break;
|
|
18409
18647
|
}
|
|
18410
|
-
|
|
18648
|
+
_context30.n = 2;
|
|
18411
18649
|
return effects.call(_SceytChatClient9.createInviteKey, {
|
|
18412
18650
|
maxUses: 0,
|
|
18413
18651
|
expiresAt: 0,
|
|
18414
18652
|
accessPriorHistory: true
|
|
18415
18653
|
});
|
|
18416
18654
|
case 2:
|
|
18417
|
-
inviteKey =
|
|
18418
|
-
|
|
18655
|
+
inviteKey = _context30.v;
|
|
18656
|
+
_context30.n = 3;
|
|
18419
18657
|
return effects.put(setChannelInviteKeysAC(channelId, [inviteKey]));
|
|
18420
18658
|
case 3:
|
|
18421
|
-
|
|
18659
|
+
_context30.n = 5;
|
|
18422
18660
|
break;
|
|
18423
18661
|
case 4:
|
|
18424
|
-
|
|
18425
|
-
|
|
18426
|
-
log.error('ERROR in create channel invite key',
|
|
18662
|
+
_context30.p = 4;
|
|
18663
|
+
_t30 = _context30.v;
|
|
18664
|
+
log.error('ERROR in create channel invite key', _t30);
|
|
18427
18665
|
case 5:
|
|
18428
|
-
return
|
|
18666
|
+
return _context30.a(2);
|
|
18429
18667
|
}
|
|
18430
|
-
},
|
|
18668
|
+
}, _marked30, null, [[0, 4]]);
|
|
18431
18669
|
}
|
|
18432
18670
|
function getChannelInviteKeys(action) {
|
|
18433
|
-
var payload, channelId, channel, inviteKeys,
|
|
18434
|
-
return _regenerator().w(function (
|
|
18435
|
-
while (1) switch (
|
|
18671
|
+
var payload, channelId, channel, inviteKeys, _t31;
|
|
18672
|
+
return _regenerator().w(function (_context31) {
|
|
18673
|
+
while (1) switch (_context31.p = _context31.n) {
|
|
18436
18674
|
case 0:
|
|
18437
|
-
|
|
18675
|
+
_context31.p = 0;
|
|
18438
18676
|
payload = action.payload;
|
|
18439
18677
|
channelId = payload.channelId;
|
|
18440
|
-
|
|
18678
|
+
_context31.n = 1;
|
|
18441
18679
|
return effects.call(getChannelFromMap, channelId);
|
|
18442
18680
|
case 1:
|
|
18443
|
-
channel =
|
|
18681
|
+
channel = _context31.v;
|
|
18444
18682
|
if (!channel) {
|
|
18445
18683
|
channel = getChannelFromAllChannels(channelId);
|
|
18446
18684
|
}
|
|
18447
18685
|
if (!channel) {
|
|
18448
|
-
|
|
18686
|
+
_context31.n = 3;
|
|
18449
18687
|
break;
|
|
18450
18688
|
}
|
|
18451
|
-
|
|
18689
|
+
_context31.n = 2;
|
|
18452
18690
|
return effects.call(channel.getInviteKeys);
|
|
18453
18691
|
case 2:
|
|
18454
|
-
inviteKeys =
|
|
18455
|
-
|
|
18692
|
+
inviteKeys = _context31.v;
|
|
18693
|
+
_context31.n = 3;
|
|
18456
18694
|
return effects.put(setChannelInviteKeysAC(channelId, inviteKeys));
|
|
18457
18695
|
case 3:
|
|
18458
|
-
|
|
18696
|
+
_context31.n = 5;
|
|
18459
18697
|
break;
|
|
18460
18698
|
case 4:
|
|
18461
|
-
|
|
18462
|
-
|
|
18463
|
-
log.error('ERROR in get channel invite keys',
|
|
18699
|
+
_context31.p = 4;
|
|
18700
|
+
_t31 = _context31.v;
|
|
18701
|
+
log.error('ERROR in get channel invite keys', _t31);
|
|
18464
18702
|
case 5:
|
|
18465
|
-
return
|
|
18703
|
+
return _context31.a(2);
|
|
18466
18704
|
}
|
|
18467
|
-
},
|
|
18705
|
+
}, _marked31, null, [[0, 4]]);
|
|
18468
18706
|
}
|
|
18469
18707
|
function regenerateChannelInviteKey(action) {
|
|
18470
|
-
var payload, channelId, key, deletePermanently, channel, inviteKey,
|
|
18471
|
-
return _regenerator().w(function (
|
|
18472
|
-
while (1) switch (
|
|
18708
|
+
var payload, channelId, key, deletePermanently, channel, inviteKey, _t32;
|
|
18709
|
+
return _regenerator().w(function (_context32) {
|
|
18710
|
+
while (1) switch (_context32.p = _context32.n) {
|
|
18473
18711
|
case 0:
|
|
18474
|
-
|
|
18712
|
+
_context32.p = 0;
|
|
18475
18713
|
payload = action.payload;
|
|
18476
18714
|
channelId = payload.channelId, key = payload.key, deletePermanently = payload.deletePermanently;
|
|
18477
|
-
|
|
18715
|
+
_context32.n = 1;
|
|
18478
18716
|
return effects.call(getChannelFromMap, channelId);
|
|
18479
18717
|
case 1:
|
|
18480
|
-
channel =
|
|
18718
|
+
channel = _context32.v;
|
|
18481
18719
|
if (!channel) {
|
|
18482
18720
|
channel = getChannelFromAllChannels(channelId);
|
|
18483
18721
|
}
|
|
18484
18722
|
if (!channel) {
|
|
18485
|
-
|
|
18723
|
+
_context32.n = 3;
|
|
18486
18724
|
break;
|
|
18487
18725
|
}
|
|
18488
|
-
|
|
18726
|
+
_context32.n = 2;
|
|
18489
18727
|
return effects.call(channel.regenerateInviteKey, {
|
|
18490
18728
|
key: key,
|
|
18491
18729
|
channelId: channelId,
|
|
18492
18730
|
deletePermanently: deletePermanently
|
|
18493
18731
|
});
|
|
18494
18732
|
case 2:
|
|
18495
|
-
inviteKey =
|
|
18496
|
-
|
|
18733
|
+
inviteKey = _context32.v;
|
|
18734
|
+
_context32.n = 3;
|
|
18497
18735
|
return effects.put(setChannelInviteKeysAC(channelId, [inviteKey]));
|
|
18498
18736
|
case 3:
|
|
18499
|
-
|
|
18737
|
+
_context32.n = 5;
|
|
18500
18738
|
break;
|
|
18501
18739
|
case 4:
|
|
18502
|
-
|
|
18503
|
-
|
|
18504
|
-
log.error('ERROR in regenerate channel invite key',
|
|
18740
|
+
_context32.p = 4;
|
|
18741
|
+
_t32 = _context32.v;
|
|
18742
|
+
log.error('ERROR in regenerate channel invite key', _t32);
|
|
18505
18743
|
case 5:
|
|
18506
|
-
return
|
|
18744
|
+
return _context32.a(2);
|
|
18507
18745
|
}
|
|
18508
|
-
},
|
|
18746
|
+
}, _marked32, null, [[0, 4]]);
|
|
18509
18747
|
}
|
|
18510
18748
|
function updateChannelInviteKey(action) {
|
|
18511
|
-
var channelInviteKeys, channelId, payload, payloadChannelId, key, accessPriorHistory, expiresAt, maxUses, channel, copiedChannelInviteKeys,
|
|
18512
|
-
return _regenerator().w(function (
|
|
18513
|
-
while (1) switch (
|
|
18749
|
+
var channelInviteKeys, channelId, payload, payloadChannelId, key, accessPriorHistory, expiresAt, maxUses, channel, copiedChannelInviteKeys, _t33;
|
|
18750
|
+
return _regenerator().w(function (_context33) {
|
|
18751
|
+
while (1) switch (_context33.p = _context33.n) {
|
|
18514
18752
|
case 0:
|
|
18515
18753
|
channelInviteKeys = [];
|
|
18516
18754
|
channelId = '';
|
|
18517
|
-
|
|
18755
|
+
_context33.p = 1;
|
|
18518
18756
|
payload = action.payload;
|
|
18519
18757
|
payloadChannelId = payload.channelId, key = payload.key, accessPriorHistory = payload.accessPriorHistory, expiresAt = payload.expiresAt, maxUses = payload.maxUses;
|
|
18520
18758
|
channelId = payloadChannelId;
|
|
18521
|
-
|
|
18759
|
+
_context33.n = 2;
|
|
18522
18760
|
return effects.call(getChannelFromMap, channelId);
|
|
18523
18761
|
case 2:
|
|
18524
|
-
channel =
|
|
18762
|
+
channel = _context33.v;
|
|
18525
18763
|
if (!channel) {
|
|
18526
18764
|
channel = getChannelFromAllChannels(channelId);
|
|
18527
18765
|
}
|
|
18528
18766
|
channelInviteKeys = store.getState().ChannelReducer.channelInviteKeys[channelId];
|
|
18529
18767
|
copiedChannelInviteKeys = JSON.parse(JSON.stringify(channelInviteKeys));
|
|
18530
18768
|
if (!copiedChannelInviteKeys) {
|
|
18531
|
-
|
|
18769
|
+
_context33.n = 3;
|
|
18532
18770
|
break;
|
|
18533
18771
|
}
|
|
18534
18772
|
copiedChannelInviteKeys.forEach(function (inviteKey) {
|
|
@@ -18538,14 +18776,14 @@ function updateChannelInviteKey(action) {
|
|
|
18538
18776
|
inviteKey.maxUses = maxUses;
|
|
18539
18777
|
}
|
|
18540
18778
|
});
|
|
18541
|
-
|
|
18779
|
+
_context33.n = 3;
|
|
18542
18780
|
return effects.put(setChannelInviteKeysAC(channelId, copiedChannelInviteKeys));
|
|
18543
18781
|
case 3:
|
|
18544
18782
|
if (!channel) {
|
|
18545
|
-
|
|
18783
|
+
_context33.n = 4;
|
|
18546
18784
|
break;
|
|
18547
18785
|
}
|
|
18548
|
-
|
|
18786
|
+
_context33.n = 4;
|
|
18549
18787
|
return effects.call(channel.updateInviteKey, {
|
|
18550
18788
|
key: key,
|
|
18551
18789
|
channelId: channelId,
|
|
@@ -18554,88 +18792,88 @@ function updateChannelInviteKey(action) {
|
|
|
18554
18792
|
accessPriorHistory: accessPriorHistory
|
|
18555
18793
|
});
|
|
18556
18794
|
case 4:
|
|
18557
|
-
|
|
18795
|
+
_context33.n = 6;
|
|
18558
18796
|
break;
|
|
18559
18797
|
case 5:
|
|
18560
|
-
|
|
18561
|
-
|
|
18562
|
-
log.error('ERROR in update channel invite key',
|
|
18563
|
-
|
|
18798
|
+
_context33.p = 5;
|
|
18799
|
+
_t33 = _context33.v;
|
|
18800
|
+
log.error('ERROR in update channel invite key', _t33);
|
|
18801
|
+
_context33.n = 6;
|
|
18564
18802
|
return effects.put(setChannelInviteKeysAC(channelId, channelInviteKeys));
|
|
18565
18803
|
case 6:
|
|
18566
|
-
return
|
|
18804
|
+
return _context33.a(2);
|
|
18567
18805
|
}
|
|
18568
|
-
},
|
|
18806
|
+
}, _marked33, null, [[1, 5]]);
|
|
18569
18807
|
}
|
|
18570
18808
|
function getChannelByInviteKey(action) {
|
|
18571
|
-
var _channel$, _channel$2, payload, key, _SceytChatClient0, channel,
|
|
18572
|
-
return _regenerator().w(function (
|
|
18573
|
-
while (1) switch (
|
|
18809
|
+
var _channel$, _channel$2, payload, key, _SceytChatClient0, channel, _t34;
|
|
18810
|
+
return _regenerator().w(function (_context34) {
|
|
18811
|
+
while (1) switch (_context34.p = _context34.n) {
|
|
18574
18812
|
case 0:
|
|
18575
|
-
|
|
18813
|
+
_context34.p = 0;
|
|
18576
18814
|
payload = action.payload;
|
|
18577
18815
|
key = payload.key;
|
|
18578
18816
|
_SceytChatClient0 = getClient();
|
|
18579
|
-
|
|
18817
|
+
_context34.n = 1;
|
|
18580
18818
|
return effects.call(_SceytChatClient0.Channel.getChannelByInviteKey, key);
|
|
18581
18819
|
case 1:
|
|
18582
|
-
channel =
|
|
18820
|
+
channel = _context34.v;
|
|
18583
18821
|
if (!(channel && channel.length > 0 && !((_channel$ = channel[0]) !== null && _channel$ !== void 0 && _channel$.role))) {
|
|
18584
|
-
|
|
18822
|
+
_context34.n = 3;
|
|
18585
18823
|
break;
|
|
18586
18824
|
}
|
|
18587
|
-
|
|
18825
|
+
_context34.n = 2;
|
|
18588
18826
|
return effects.put(setJoinableChannelAC(JSON.parse(JSON.stringify(channel[0]))));
|
|
18589
18827
|
case 2:
|
|
18590
18828
|
window.history.pushState({}, '', window.location.pathname + '?join=' + key);
|
|
18591
|
-
|
|
18829
|
+
_context34.n = 5;
|
|
18592
18830
|
break;
|
|
18593
18831
|
case 3:
|
|
18594
18832
|
if (!(channel && channel.length > 0 && (_channel$2 = channel[0]) !== null && _channel$2 !== void 0 && _channel$2.role)) {
|
|
18595
|
-
|
|
18833
|
+
_context34.n = 5;
|
|
18596
18834
|
break;
|
|
18597
18835
|
}
|
|
18598
|
-
|
|
18836
|
+
_context34.n = 4;
|
|
18599
18837
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(channel[0]))));
|
|
18600
18838
|
case 4:
|
|
18601
18839
|
window.history.pushState({}, '', window.location.pathname);
|
|
18602
18840
|
case 5:
|
|
18603
|
-
|
|
18841
|
+
_context34.n = 8;
|
|
18604
18842
|
break;
|
|
18605
18843
|
case 6:
|
|
18606
|
-
|
|
18607
|
-
|
|
18608
|
-
if (!(
|
|
18609
|
-
|
|
18844
|
+
_context34.p = 6;
|
|
18845
|
+
_t34 = _context34.v;
|
|
18846
|
+
if (!(_t34.code === 1109)) {
|
|
18847
|
+
_context34.n = 7;
|
|
18610
18848
|
break;
|
|
18611
18849
|
}
|
|
18612
|
-
|
|
18850
|
+
_context34.n = 7;
|
|
18613
18851
|
return effects.put(setChannelInviteKeyAvailableAC(false));
|
|
18614
18852
|
case 7:
|
|
18615
|
-
log.error('ERROR in get channel by invite key',
|
|
18853
|
+
log.error('ERROR in get channel by invite key', _t34);
|
|
18616
18854
|
case 8:
|
|
18617
|
-
return
|
|
18855
|
+
return _context34.a(2);
|
|
18618
18856
|
}
|
|
18619
|
-
},
|
|
18857
|
+
}, _marked34, null, [[0, 6]]);
|
|
18620
18858
|
}
|
|
18621
18859
|
function joinChannelWithInviteKey(action) {
|
|
18622
|
-
var payload, key, _SceytChatClient1, user, channel, messageToSend,
|
|
18623
|
-
return _regenerator().w(function (
|
|
18624
|
-
while (1) switch (
|
|
18860
|
+
var payload, key, _SceytChatClient1, user, channel, messageToSend, _t35;
|
|
18861
|
+
return _regenerator().w(function (_context35) {
|
|
18862
|
+
while (1) switch (_context35.p = _context35.n) {
|
|
18625
18863
|
case 0:
|
|
18626
|
-
|
|
18864
|
+
_context35.p = 0;
|
|
18627
18865
|
payload = action.payload;
|
|
18628
18866
|
key = payload.key;
|
|
18629
18867
|
_SceytChatClient1 = getClient();
|
|
18630
18868
|
user = _SceytChatClient1.user;
|
|
18631
|
-
|
|
18869
|
+
_context35.n = 1;
|
|
18632
18870
|
return effects.call(_SceytChatClient1.Channel.joinChannelByInviteKey, key);
|
|
18633
18871
|
case 1:
|
|
18634
|
-
channel =
|
|
18635
|
-
|
|
18872
|
+
channel = _context35.v;
|
|
18873
|
+
_context35.n = 2;
|
|
18636
18874
|
return effects.put(setJoinableChannelAC(null));
|
|
18637
18875
|
case 2:
|
|
18638
|
-
|
|
18876
|
+
_context35.n = 3;
|
|
18639
18877
|
return effects.call(setChannelInMap, channel);
|
|
18640
18878
|
case 3:
|
|
18641
18879
|
messageToSend = {
|
|
@@ -18644,47 +18882,47 @@ function joinChannelWithInviteKey(action) {
|
|
|
18644
18882
|
attachments: [],
|
|
18645
18883
|
type: 'system'
|
|
18646
18884
|
};
|
|
18647
|
-
|
|
18885
|
+
_context35.n = 4;
|
|
18648
18886
|
return effects.put(sendTextMessageAC(messageToSend, channel === null || channel === void 0 ? void 0 : channel.id, CONNECTION_STATUS.CONNECTED));
|
|
18649
18887
|
case 4:
|
|
18650
|
-
|
|
18888
|
+
_context35.n = 5;
|
|
18651
18889
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(channel))));
|
|
18652
18890
|
case 5:
|
|
18653
18891
|
window.history.pushState({}, '', window.location.pathname);
|
|
18654
|
-
|
|
18892
|
+
_context35.n = 7;
|
|
18655
18893
|
break;
|
|
18656
18894
|
case 6:
|
|
18657
|
-
|
|
18658
|
-
|
|
18659
|
-
log.error('ERROR in join channel with invite key',
|
|
18895
|
+
_context35.p = 6;
|
|
18896
|
+
_t35 = _context35.v;
|
|
18897
|
+
log.error('ERROR in join channel with invite key', _t35);
|
|
18660
18898
|
case 7:
|
|
18661
|
-
return
|
|
18899
|
+
return _context35.a(2);
|
|
18662
18900
|
}
|
|
18663
|
-
},
|
|
18901
|
+
}, _marked35, null, [[0, 6]]);
|
|
18664
18902
|
}
|
|
18665
18903
|
function setMessageRetentionPeriod(action) {
|
|
18666
|
-
var payload, channelId, periodInMilliseconds, channel, messageToSend,
|
|
18667
|
-
return _regenerator().w(function (
|
|
18668
|
-
while (1) switch (
|
|
18904
|
+
var payload, channelId, periodInMilliseconds, channel, messageToSend, _t36;
|
|
18905
|
+
return _regenerator().w(function (_context36) {
|
|
18906
|
+
while (1) switch (_context36.p = _context36.n) {
|
|
18669
18907
|
case 0:
|
|
18670
|
-
|
|
18908
|
+
_context36.p = 0;
|
|
18671
18909
|
payload = action.payload;
|
|
18672
18910
|
channelId = payload.channelId, periodInMilliseconds = payload.periodInMilliseconds;
|
|
18673
|
-
|
|
18911
|
+
_context36.n = 1;
|
|
18674
18912
|
return effects.call(getChannelFromMap, channelId);
|
|
18675
18913
|
case 1:
|
|
18676
|
-
channel =
|
|
18914
|
+
channel = _context36.v;
|
|
18677
18915
|
if (!channel) {
|
|
18678
18916
|
channel = getChannelFromAllChannels(channelId);
|
|
18679
18917
|
}
|
|
18680
18918
|
if (!channel) {
|
|
18681
|
-
|
|
18919
|
+
_context36.n = 4;
|
|
18682
18920
|
break;
|
|
18683
18921
|
}
|
|
18684
|
-
|
|
18922
|
+
_context36.n = 2;
|
|
18685
18923
|
return effects.call(channel.setMessageRetentionPeriod, periodInMilliseconds);
|
|
18686
18924
|
case 2:
|
|
18687
|
-
|
|
18925
|
+
_context36.n = 3;
|
|
18688
18926
|
return effects.put(updateChannelDataAC(channelId, {
|
|
18689
18927
|
messageRetentionPeriod: periodInMilliseconds
|
|
18690
18928
|
}));
|
|
@@ -18701,32 +18939,32 @@ function setMessageRetentionPeriod(action) {
|
|
|
18701
18939
|
attachments: [],
|
|
18702
18940
|
type: 'system'
|
|
18703
18941
|
};
|
|
18704
|
-
|
|
18942
|
+
_context36.n = 4;
|
|
18705
18943
|
return effects.put(sendTextMessageAC(messageToSend, channelId, CONNECTION_STATUS.CONNECTED));
|
|
18706
18944
|
case 4:
|
|
18707
|
-
|
|
18945
|
+
_context36.n = 6;
|
|
18708
18946
|
break;
|
|
18709
18947
|
case 5:
|
|
18710
|
-
|
|
18711
|
-
|
|
18712
|
-
log.error('ERROR in set message retention period',
|
|
18948
|
+
_context36.p = 5;
|
|
18949
|
+
_t36 = _context36.v;
|
|
18950
|
+
log.error('ERROR in set message retention period', _t36);
|
|
18713
18951
|
case 6:
|
|
18714
|
-
return
|
|
18952
|
+
return _context36.a(2);
|
|
18715
18953
|
}
|
|
18716
|
-
},
|
|
18954
|
+
}, _marked36, null, [[0, 5]]);
|
|
18717
18955
|
}
|
|
18718
18956
|
function getChannelsWithUser(action) {
|
|
18719
|
-
var payload, userId, _SceytChatClient10, channelsQueryBuilder, channelsQuery, channelsData, channels,
|
|
18720
|
-
return _regenerator().w(function (
|
|
18721
|
-
while (1) switch (
|
|
18957
|
+
var payload, userId, _SceytChatClient10, channelsQueryBuilder, channelsQuery, channelsData, channels, _t37;
|
|
18958
|
+
return _regenerator().w(function (_context37) {
|
|
18959
|
+
while (1) switch (_context37.p = _context37.n) {
|
|
18722
18960
|
case 0:
|
|
18723
|
-
|
|
18961
|
+
_context37.n = 1;
|
|
18724
18962
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18725
18963
|
case 1:
|
|
18726
|
-
|
|
18964
|
+
_context37.n = 2;
|
|
18727
18965
|
return effects.put(setMutualChannelsAC([]));
|
|
18728
18966
|
case 2:
|
|
18729
|
-
|
|
18967
|
+
_context37.p = 2;
|
|
18730
18968
|
payload = action.payload;
|
|
18731
18969
|
userId = payload.userId;
|
|
18732
18970
|
_SceytChatClient10 = getClient();
|
|
@@ -18735,231 +18973,231 @@ function getChannelsWithUser(action) {
|
|
|
18735
18973
|
channelsQueryBuilder.setMutualWithUserId(userId);
|
|
18736
18974
|
channelsQueryBuilder.withExcludeTypes([DEFAULT_CHANNEL_TYPE.DIRECT]);
|
|
18737
18975
|
channelsQueryBuilder.limit(15);
|
|
18738
|
-
|
|
18976
|
+
_context37.n = 3;
|
|
18739
18977
|
return effects.call(channelsQueryBuilder.build);
|
|
18740
18978
|
case 3:
|
|
18741
|
-
channelsQuery =
|
|
18979
|
+
channelsQuery = _context37.v;
|
|
18742
18980
|
query.mutualChannelsQuery = channelsQuery;
|
|
18743
|
-
|
|
18981
|
+
_context37.n = 4;
|
|
18744
18982
|
return effects.call(channelsQuery.loadNextPage);
|
|
18745
18983
|
case 4:
|
|
18746
|
-
channelsData =
|
|
18984
|
+
channelsData = _context37.v;
|
|
18747
18985
|
channels = channelsData.channels;
|
|
18748
18986
|
if (!channelsData.hasNext) {
|
|
18749
|
-
|
|
18987
|
+
_context37.n = 6;
|
|
18750
18988
|
break;
|
|
18751
18989
|
}
|
|
18752
|
-
|
|
18990
|
+
_context37.n = 5;
|
|
18753
18991
|
return effects.put(setMutualChannelsHasNextAC(true));
|
|
18754
18992
|
case 5:
|
|
18755
|
-
|
|
18993
|
+
_context37.n = 7;
|
|
18756
18994
|
break;
|
|
18757
18995
|
case 6:
|
|
18758
|
-
|
|
18996
|
+
_context37.n = 7;
|
|
18759
18997
|
return effects.put(setMutualChannelsHasNextAC(false));
|
|
18760
18998
|
case 7:
|
|
18761
|
-
|
|
18999
|
+
_context37.n = 8;
|
|
18762
19000
|
return effects.put(setMutualChannelsAC(channels));
|
|
18763
19001
|
case 8:
|
|
18764
|
-
|
|
19002
|
+
_context37.n = 10;
|
|
18765
19003
|
break;
|
|
18766
19004
|
case 9:
|
|
18767
|
-
|
|
18768
|
-
|
|
18769
|
-
log.error('ERROR in get groups in common',
|
|
19005
|
+
_context37.p = 9;
|
|
19006
|
+
_t37 = _context37.v;
|
|
19007
|
+
log.error('ERROR in get groups in common', _t37);
|
|
18770
19008
|
case 10:
|
|
18771
|
-
|
|
18772
|
-
|
|
19009
|
+
_context37.p = 10;
|
|
19010
|
+
_context37.n = 11;
|
|
18773
19011
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18774
19012
|
case 11:
|
|
18775
|
-
return
|
|
19013
|
+
return _context37.f(10);
|
|
18776
19014
|
case 12:
|
|
18777
|
-
return
|
|
19015
|
+
return _context37.a(2);
|
|
18778
19016
|
}
|
|
18779
|
-
},
|
|
19017
|
+
}, _marked37, null, [[2, 9, 10, 12]]);
|
|
18780
19018
|
}
|
|
18781
19019
|
function loadMoreMutualChannels(action) {
|
|
18782
|
-
var payload, limit, mutualChannelsQuery, channelsData,
|
|
18783
|
-
return _regenerator().w(function (
|
|
18784
|
-
while (1) switch (
|
|
19020
|
+
var payload, limit, mutualChannelsQuery, channelsData, _t38;
|
|
19021
|
+
return _regenerator().w(function (_context38) {
|
|
19022
|
+
while (1) switch (_context38.p = _context38.n) {
|
|
18785
19023
|
case 0:
|
|
18786
|
-
|
|
19024
|
+
_context38.n = 1;
|
|
18787
19025
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18788
19026
|
case 1:
|
|
18789
|
-
|
|
19027
|
+
_context38.p = 1;
|
|
18790
19028
|
payload = action.payload;
|
|
18791
19029
|
limit = payload.limit;
|
|
18792
19030
|
mutualChannelsQuery = query.mutualChannelsQuery;
|
|
18793
19031
|
if (mutualChannelsQuery) {
|
|
18794
|
-
|
|
19032
|
+
_context38.n = 2;
|
|
18795
19033
|
break;
|
|
18796
19034
|
}
|
|
18797
|
-
return
|
|
19035
|
+
return _context38.a(2);
|
|
18798
19036
|
case 2:
|
|
18799
19037
|
if (limit) {
|
|
18800
19038
|
mutualChannelsQuery.limit = limit;
|
|
18801
19039
|
}
|
|
18802
|
-
|
|
19040
|
+
_context38.n = 3;
|
|
18803
19041
|
return effects.call(mutualChannelsQuery.loadNextPage);
|
|
18804
19042
|
case 3:
|
|
18805
|
-
channelsData =
|
|
19043
|
+
channelsData = _context38.v;
|
|
18806
19044
|
if (!channelsData.hasNext) {
|
|
18807
|
-
|
|
19045
|
+
_context38.n = 5;
|
|
18808
19046
|
break;
|
|
18809
19047
|
}
|
|
18810
|
-
|
|
19048
|
+
_context38.n = 4;
|
|
18811
19049
|
return effects.put(setMutualChannelsHasNextAC(true));
|
|
18812
19050
|
case 4:
|
|
18813
|
-
|
|
19051
|
+
_context38.n = 6;
|
|
18814
19052
|
break;
|
|
18815
19053
|
case 5:
|
|
18816
|
-
|
|
19054
|
+
_context38.n = 6;
|
|
18817
19055
|
return effects.put(setMutualChannelsHasNextAC(false));
|
|
18818
19056
|
case 6:
|
|
18819
|
-
|
|
19057
|
+
_context38.n = 7;
|
|
18820
19058
|
return effects.put(setMutualChannelsAC(channelsData.channels));
|
|
18821
19059
|
case 7:
|
|
18822
|
-
|
|
19060
|
+
_context38.n = 9;
|
|
18823
19061
|
break;
|
|
18824
19062
|
case 8:
|
|
18825
|
-
|
|
18826
|
-
|
|
18827
|
-
log.error('ERROR in load more mutual channels',
|
|
19063
|
+
_context38.p = 8;
|
|
19064
|
+
_t38 = _context38.v;
|
|
19065
|
+
log.error('ERROR in load more mutual channels', _t38);
|
|
18828
19066
|
case 9:
|
|
18829
|
-
|
|
18830
|
-
|
|
19067
|
+
_context38.p = 9;
|
|
19068
|
+
_context38.n = 10;
|
|
18831
19069
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18832
19070
|
case 10:
|
|
18833
|
-
return
|
|
19071
|
+
return _context38.f(9);
|
|
18834
19072
|
case 11:
|
|
18835
|
-
return
|
|
19073
|
+
return _context38.a(2);
|
|
18836
19074
|
}
|
|
18837
|
-
},
|
|
19075
|
+
}, _marked38, null, [[1, 8, 9, 11]]);
|
|
18838
19076
|
}
|
|
18839
19077
|
function ChannelsSaga() {
|
|
18840
|
-
return _regenerator().w(function (
|
|
18841
|
-
while (1) switch (
|
|
19078
|
+
return _regenerator().w(function (_context39) {
|
|
19079
|
+
while (1) switch (_context39.n) {
|
|
18842
19080
|
case 0:
|
|
18843
|
-
|
|
19081
|
+
_context39.n = 1;
|
|
18844
19082
|
return effects.takeLatest(CREATE_CHANNEL, createChannel);
|
|
18845
19083
|
case 1:
|
|
18846
|
-
|
|
19084
|
+
_context39.n = 2;
|
|
18847
19085
|
return effects.takeLatest(GET_CHANNELS, getChannels);
|
|
18848
19086
|
case 2:
|
|
18849
|
-
|
|
19087
|
+
_context39.n = 3;
|
|
18850
19088
|
return effects.takeLatest(SEARCH_CHANNELS, searchChannels);
|
|
18851
19089
|
case 3:
|
|
18852
|
-
|
|
19090
|
+
_context39.n = 4;
|
|
18853
19091
|
return effects.takeLatest(GET_CHANNELS_FOR_FORWARD, getChannelsForForward);
|
|
18854
19092
|
case 4:
|
|
18855
|
-
|
|
19093
|
+
_context39.n = 5;
|
|
18856
19094
|
return effects.takeLatest(SEARCH_CHANNELS_FOR_FORWARD, searchChannelsForForward);
|
|
18857
19095
|
case 5:
|
|
18858
|
-
|
|
19096
|
+
_context39.n = 6;
|
|
18859
19097
|
return effects.takeLatest(LOAD_MORE_CHANNEL, channelsLoadMore);
|
|
18860
19098
|
case 6:
|
|
18861
|
-
|
|
19099
|
+
_context39.n = 7;
|
|
18862
19100
|
return effects.takeLatest(LOAD_MORE_CHANNELS_FOR_FORWARD, channelsForForwardLoadMore);
|
|
18863
19101
|
case 7:
|
|
18864
|
-
|
|
19102
|
+
_context39.n = 8;
|
|
18865
19103
|
return effects.takeLatest(GET_CHANNELS_WITH_USER, getChannelsWithUser);
|
|
18866
19104
|
case 8:
|
|
18867
|
-
|
|
19105
|
+
_context39.n = 9;
|
|
18868
19106
|
return effects.takeLatest(LOAD_MORE_MUTUAL_CHANNELS, loadMoreMutualChannels);
|
|
18869
19107
|
case 9:
|
|
18870
|
-
|
|
19108
|
+
_context39.n = 10;
|
|
18871
19109
|
return effects.takeEvery(SWITCH_CHANNEL, switchChannel);
|
|
18872
19110
|
case 10:
|
|
18873
|
-
|
|
19111
|
+
_context39.n = 11;
|
|
18874
19112
|
return effects.takeLatest(LEAVE_CHANNEL, leaveChannel);
|
|
18875
19113
|
case 11:
|
|
18876
|
-
|
|
19114
|
+
_context39.n = 12;
|
|
18877
19115
|
return effects.takeLatest(DELETE_CHANNEL, deleteChannel);
|
|
18878
19116
|
case 12:
|
|
18879
|
-
|
|
19117
|
+
_context39.n = 13;
|
|
18880
19118
|
return effects.takeLatest(BLOCK_CHANNEL, blockChannel);
|
|
18881
19119
|
case 13:
|
|
18882
|
-
|
|
19120
|
+
_context39.n = 14;
|
|
18883
19121
|
return effects.takeLatest(UPDATE_CHANNEL, updateChannel);
|
|
18884
19122
|
case 14:
|
|
18885
|
-
|
|
19123
|
+
_context39.n = 15;
|
|
18886
19124
|
return effects.takeEvery(MARK_MESSAGES_AS_READ, markMessagesRead);
|
|
18887
19125
|
case 15:
|
|
18888
|
-
|
|
19126
|
+
_context39.n = 16;
|
|
18889
19127
|
return effects.takeLatest(MARK_MESSAGES_AS_DELIVERED, markMessagesDelivered);
|
|
18890
19128
|
case 16:
|
|
18891
|
-
|
|
19129
|
+
_context39.n = 17;
|
|
18892
19130
|
return effects.takeLatest(MARK_VOICE_MESSAGE_AS_PLAYED, markVoiceMessageAsPlayed);
|
|
18893
19131
|
case 17:
|
|
18894
|
-
|
|
19132
|
+
_context39.n = 18;
|
|
18895
19133
|
return effects.takeLatest(WATCH_FOR_EVENTS, watchForChannelEvents);
|
|
18896
19134
|
case 18:
|
|
18897
|
-
|
|
19135
|
+
_context39.n = 19;
|
|
18898
19136
|
return effects.takeLatest(TURN_OFF_NOTIFICATION, notificationsTurnOff);
|
|
18899
19137
|
case 19:
|
|
18900
|
-
|
|
19138
|
+
_context39.n = 20;
|
|
18901
19139
|
return effects.takeLatest(TURN_ON_NOTIFICATION, notificationsTurnOn);
|
|
18902
19140
|
case 20:
|
|
18903
|
-
|
|
19141
|
+
_context39.n = 21;
|
|
18904
19142
|
return effects.takeLatest(MARK_CHANNEL_AS_READ, markChannelAsRead);
|
|
18905
19143
|
case 21:
|
|
18906
|
-
|
|
19144
|
+
_context39.n = 22;
|
|
18907
19145
|
return effects.takeLatest(MARK_CHANNEL_AS_UNREAD, markChannelAsUnRead);
|
|
18908
19146
|
case 22:
|
|
18909
|
-
|
|
19147
|
+
_context39.n = 23;
|
|
18910
19148
|
return effects.takeLatest(CHECK_USER_STATUS, checkUsersStatus);
|
|
18911
19149
|
case 23:
|
|
18912
|
-
|
|
19150
|
+
_context39.n = 24;
|
|
18913
19151
|
return effects.takeLatest(SEND_TYPING, sendTyping);
|
|
18914
19152
|
case 24:
|
|
18915
|
-
|
|
19153
|
+
_context39.n = 25;
|
|
18916
19154
|
return effects.takeLatest(SEND_RECORDING, sendRecording);
|
|
18917
19155
|
case 25:
|
|
18918
|
-
|
|
19156
|
+
_context39.n = 26;
|
|
18919
19157
|
return effects.takeLatest(PIN_CHANNEL, pinChannel);
|
|
18920
19158
|
case 26:
|
|
18921
|
-
|
|
19159
|
+
_context39.n = 27;
|
|
18922
19160
|
return effects.takeLatest(UNPIN_CHANNEL, unpinChannel);
|
|
18923
19161
|
case 27:
|
|
18924
|
-
|
|
19162
|
+
_context39.n = 28;
|
|
18925
19163
|
return effects.takeLatest(CLEAR_HISTORY, clearHistory);
|
|
18926
19164
|
case 28:
|
|
18927
|
-
|
|
19165
|
+
_context39.n = 29;
|
|
18928
19166
|
return effects.takeLatest(JOIN_TO_CHANNEL, joinChannel);
|
|
18929
19167
|
case 29:
|
|
18930
|
-
|
|
19168
|
+
_context39.n = 30;
|
|
18931
19169
|
return effects.takeLatest(DELETE_ALL_MESSAGES, deleteAllMessages);
|
|
18932
19170
|
case 30:
|
|
18933
|
-
|
|
19171
|
+
_context39.n = 31;
|
|
18934
19172
|
return effects.takeLatest(REMOVE_CHANNEL_CACHES, removeChannelCaches);
|
|
18935
19173
|
case 31:
|
|
18936
|
-
|
|
19174
|
+
_context39.n = 32;
|
|
18937
19175
|
return effects.takeLatest(GET_CHANNEL_MENTIONS, getChannelMentions);
|
|
18938
19176
|
case 32:
|
|
18939
|
-
|
|
19177
|
+
_context39.n = 33;
|
|
18940
19178
|
return effects.takeLatest(CREATE_CHANNEL_INVITE_KEY, createChannelInviteKey);
|
|
18941
19179
|
case 33:
|
|
18942
|
-
|
|
19180
|
+
_context39.n = 34;
|
|
18943
19181
|
return effects.takeLatest(UPDATE_CHANNEL_INVITE_KEY, updateChannelInviteKey);
|
|
18944
19182
|
case 34:
|
|
18945
|
-
|
|
19183
|
+
_context39.n = 35;
|
|
18946
19184
|
return effects.takeLatest(REGENERATE_CHANNEL_INVITE_KEY, regenerateChannelInviteKey);
|
|
18947
19185
|
case 35:
|
|
18948
|
-
|
|
19186
|
+
_context39.n = 36;
|
|
18949
19187
|
return effects.takeLatest(GET_CHANNEL_INVITE_KEYS, getChannelInviteKeys);
|
|
18950
19188
|
case 36:
|
|
18951
|
-
|
|
19189
|
+
_context39.n = 37;
|
|
18952
19190
|
return effects.takeLatest(GET_CHANNEL_BY_INVITE_KEY, getChannelByInviteKey);
|
|
18953
19191
|
case 37:
|
|
18954
|
-
|
|
19192
|
+
_context39.n = 38;
|
|
18955
19193
|
return effects.takeLatest(JOIN_TO_CHANNEL_WITH_INVITE_KEY, joinChannelWithInviteKey);
|
|
18956
19194
|
case 38:
|
|
18957
|
-
|
|
19195
|
+
_context39.n = 39;
|
|
18958
19196
|
return effects.takeLatest(SET_MESSAGE_RETENTION_PERIOD, setMessageRetentionPeriod);
|
|
18959
19197
|
case 39:
|
|
18960
|
-
return
|
|
19198
|
+
return _context39.a(2);
|
|
18961
19199
|
}
|
|
18962
|
-
},
|
|
19200
|
+
}, _marked39);
|
|
18963
19201
|
}
|
|
18964
19202
|
|
|
18965
19203
|
function rgbaToThumbHash(w, h, rgba) {
|
|
@@ -19359,56 +19597,6 @@ var getFrame = function getFrame(videoSrc, time) {
|
|
|
19359
19597
|
}
|
|
19360
19598
|
};
|
|
19361
19599
|
|
|
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
19600
|
var _marked$3 = /*#__PURE__*/_regenerator().m(sendMessage),
|
|
19413
19601
|
_marked2$2 = /*#__PURE__*/_regenerator().m(sendTextMessage),
|
|
19414
19602
|
_marked3$1 = /*#__PURE__*/_regenerator().m(forwardMessage),
|
|
@@ -19604,7 +19792,7 @@ var updateMessage$1 = function updateMessage(actionType, pending, channelId, scr
|
|
|
19604
19792
|
break;
|
|
19605
19793
|
}
|
|
19606
19794
|
_context.n = 7;
|
|
19607
|
-
return effects.put(getMessagesAC(channel,
|
|
19795
|
+
return effects.put(getMessagesAC(channel, true, channel === null || channel === void 0 ? void 0 : (_channel$lastMessage3 = channel.lastMessage) === null || _channel$lastMessage3 === void 0 ? void 0 : _channel$lastMessage3.id, undefined, false, 'smooth', true));
|
|
19608
19796
|
case 7:
|
|
19609
19797
|
return _context.a(2);
|
|
19610
19798
|
}
|
|
@@ -19907,22 +20095,10 @@ function sendMessage(action) {
|
|
|
19907
20095
|
return attachment;
|
|
19908
20096
|
});
|
|
19909
20097
|
}
|
|
19910
|
-
messageUpdateData = {
|
|
19911
|
-
id: messageResponse.id,
|
|
19912
|
-
body: messageResponse.body,
|
|
19913
|
-
type: messageResponse.type,
|
|
19914
|
-
state: messageResponse.state,
|
|
19915
|
-
displayCount: messageResponse.displayCount,
|
|
19916
|
-
deliveryStatus: messageResponse.deliveryStatus,
|
|
20098
|
+
messageUpdateData = _extends({}, messageResponse, {
|
|
19917
20099
|
attachments: attachmentsToUpdate,
|
|
19918
|
-
mentionedUsers: messageResponse.mentionedUsers,
|
|
19919
|
-
bodyAttributes: messageResponse.bodyAttributes,
|
|
19920
|
-
metadata: messageResponse.metadata,
|
|
19921
|
-
parentMessage: messageResponse.parentMessage,
|
|
19922
|
-
repliedInThread: messageResponse.repliedInThread,
|
|
19923
|
-
createdAt: messageResponse.createdAt,
|
|
19924
20100
|
channelId: channel.id
|
|
19925
|
-
};
|
|
20101
|
+
});
|
|
19926
20102
|
stringifiedMessageUpdateData = JSON.parse(JSON.stringify(messageResponse));
|
|
19927
20103
|
activeChannelId = getActiveChannelId();
|
|
19928
20104
|
if (!(activeChannelId === channel.id)) {
|
|
@@ -20035,7 +20211,7 @@ function sendMessage(action) {
|
|
|
20035
20211
|
}, _marked$3, null, [[1, 16, 17, 19]]);
|
|
20036
20212
|
}
|
|
20037
20213
|
function sendTextMessage(action) {
|
|
20038
|
-
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend,
|
|
20214
|
+
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend, messageResponse, messageUpdateData, activeChannelId, stringifiedMessageUpdateData, messageToUpdate, channelUpdateParam, _channel3, _channel4, isErrorResendable, _activeChannelId, _t3;
|
|
20039
20215
|
return _regenerator().w(function (_context5) {
|
|
20040
20216
|
while (1) switch (_context5.p = _context5.n) {
|
|
20041
20217
|
case 0:
|
|
@@ -20145,23 +20321,9 @@ function sendTextMessage(action) {
|
|
|
20145
20321
|
case 11:
|
|
20146
20322
|
messageResponse = _context5.v;
|
|
20147
20323
|
case 12:
|
|
20148
|
-
messageUpdateData = {
|
|
20149
|
-
id: messageResponse.id,
|
|
20150
|
-
body: messageResponse.body,
|
|
20151
|
-
type: messageResponse.type,
|
|
20152
|
-
state: messageResponse.state,
|
|
20153
|
-
bodyAttributes: messageResponse.bodyAttributes,
|
|
20154
|
-
displayCount: messageResponse.displayCount,
|
|
20155
|
-
deliveryStatus: messageResponse.deliveryStatus,
|
|
20156
|
-
attachments: messageResponse.attachments,
|
|
20157
|
-
mentionedUsers: messageResponse.mentionedUsers,
|
|
20158
|
-
metadata: messageResponse.metadata,
|
|
20159
|
-
parentMessage: messageResponse.parentMessage,
|
|
20160
|
-
repliedInThread: messageResponse.repliedInThread,
|
|
20161
|
-
createdAt: messageResponse.createdAt,
|
|
20162
|
-
pollDetails: (_messageResponse = messageResponse) === null || _messageResponse === void 0 ? void 0 : _messageResponse.pollDetails,
|
|
20324
|
+
messageUpdateData = _extends({}, messageResponse, {
|
|
20163
20325
|
channelId: channel.id
|
|
20164
|
-
};
|
|
20326
|
+
});
|
|
20165
20327
|
activeChannelId = getActiveChannelId();
|
|
20166
20328
|
if (!(activeChannelId === channel.id)) {
|
|
20167
20329
|
_context5.n = 13;
|
|
@@ -20384,20 +20546,9 @@ function forwardMessage(action) {
|
|
|
20384
20546
|
return effects.call(channel.sendMessage, messageToSend);
|
|
20385
20547
|
case 10:
|
|
20386
20548
|
messageResponse = _context6.v;
|
|
20387
|
-
messageUpdateData = {
|
|
20388
|
-
id: messageResponse.id,
|
|
20389
|
-
type: messageResponse.type,
|
|
20390
|
-
state: messageResponse.state,
|
|
20391
|
-
displayCount: messageResponse.displayCount,
|
|
20392
|
-
deliveryStatus: messageResponse.deliveryStatus,
|
|
20393
|
-
attachments: messageResponse.attachments,
|
|
20394
|
-
mentionedUsers: messageResponse.mentionedUsers,
|
|
20395
|
-
metadata: messageResponse.metadata,
|
|
20396
|
-
parentMessage: messageResponse.parentMessage,
|
|
20397
|
-
repliedInThread: messageResponse.repliedInThread,
|
|
20398
|
-
createdAt: messageResponse.createdAt,
|
|
20549
|
+
messageUpdateData = _extends({}, messageResponse, {
|
|
20399
20550
|
channelId: channel.id
|
|
20400
|
-
};
|
|
20551
|
+
});
|
|
20401
20552
|
if (!(channelId === activeChannelId)) {
|
|
20402
20553
|
_context6.n = 12;
|
|
20403
20554
|
break;
|
|
@@ -20799,7 +20950,7 @@ var getFilteredPendingMessages = function getFilteredPendingMessages(messages) {
|
|
|
20799
20950
|
return filteredPendingMessages;
|
|
20800
20951
|
};
|
|
20801
20952
|
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,
|
|
20953
|
+
var _action$payload, channel, loadWithLastMessage, messageId, limit, highlight, behavior, scrollToMessage, networkChanged, channelNewMessageCount, connectionState, SceytChatClient, _updatedChannel, messageQueryBuilder, messageQuery, cachedMessages, result, _result$messages$, _result$messages, _result$messages$2, _result$messages2, messages, loadNextMessageId, loadPreviousMessageId, nextLoadLimit, previousLoadLimit, centerMessageIndex, firstResult, secondResult, _result$messages$3, _result$messages3, _channel$lastMessage4, _channel$lastMessage5, _channel$lastMessage6, _result$messages4, _messages, _filteredPendingMessages, updatedMessages, messageIdForLoad, _updatedMessages$, filteredPendingMessages, waitToSendPendingMessages, updatedChannel, _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16, _t17, _t18;
|
|
20803
20954
|
return _regenerator().w(function (_context10) {
|
|
20804
20955
|
while (1) switch (_context10.p = _context10.n) {
|
|
20805
20956
|
case 0:
|
|
@@ -20808,29 +20959,69 @@ function getMessagesQuery(action) {
|
|
|
20808
20959
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
20809
20960
|
case 1:
|
|
20810
20961
|
_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;
|
|
20962
|
+
channelNewMessageCount = (channel === null || channel === void 0 ? void 0 : channel.newMessageCount) || 0;
|
|
20811
20963
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
20812
20964
|
if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
|
|
20813
|
-
_context10.n =
|
|
20965
|
+
_context10.n = 77;
|
|
20814
20966
|
break;
|
|
20815
20967
|
}
|
|
20816
20968
|
SceytChatClient = getClient();
|
|
20969
|
+
if (!networkChanged) {
|
|
20970
|
+
_context10.n = 8;
|
|
20971
|
+
break;
|
|
20972
|
+
}
|
|
20973
|
+
_context10.p = 2;
|
|
20974
|
+
_context10.n = 3;
|
|
20975
|
+
return effects.call(SceytChatClient.getChannel, channel.id, true);
|
|
20976
|
+
case 3:
|
|
20977
|
+
_updatedChannel = _context10.v;
|
|
20978
|
+
if (!(_updatedChannel && _updatedChannel !== null && _updatedChannel !== void 0 && _updatedChannel.id)) {
|
|
20979
|
+
_context10.n = 6;
|
|
20980
|
+
break;
|
|
20981
|
+
}
|
|
20982
|
+
_context10.n = 4;
|
|
20983
|
+
return effects.put(updateChannelDataAC(channel.id, _extends({}, _updatedChannel)));
|
|
20984
|
+
case 4:
|
|
20985
|
+
channelNewMessageCount = (_updatedChannel === null || _updatedChannel === void 0 ? void 0 : _updatedChannel.newMessageCount) || 0;
|
|
20986
|
+
if (!(channelNewMessageCount !== channel.newMessageCount)) {
|
|
20987
|
+
_context10.n = 6;
|
|
20988
|
+
break;
|
|
20989
|
+
}
|
|
20990
|
+
_context10.n = 5;
|
|
20991
|
+
return effects.put(updateChannelDataAC(channel.id, {
|
|
20992
|
+
newMessageCount: channelNewMessageCount
|
|
20993
|
+
}));
|
|
20994
|
+
case 5:
|
|
20995
|
+
updateChannelOnAllChannels(channel.id, {
|
|
20996
|
+
newMessageCount: channelNewMessageCount
|
|
20997
|
+
});
|
|
20998
|
+
_context10.n = 6;
|
|
20999
|
+
return effects.put(setUnreadMessageIdAC(channel.lastDisplayedMessageId));
|
|
21000
|
+
case 6:
|
|
21001
|
+
_context10.n = 8;
|
|
21002
|
+
break;
|
|
21003
|
+
case 7:
|
|
21004
|
+
_context10.p = 7;
|
|
21005
|
+
_t0 = _context10.v;
|
|
21006
|
+
log.error('error to get updated channel in get messages query', _t0);
|
|
21007
|
+
case 8:
|
|
20817
21008
|
messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channel.id);
|
|
20818
21009
|
messageQueryBuilder.limit(limit || MESSAGES_MAX_LENGTH);
|
|
20819
21010
|
messageQueryBuilder.reverse(true);
|
|
20820
21011
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20821
|
-
_context10.n =
|
|
21012
|
+
_context10.n = 10;
|
|
20822
21013
|
break;
|
|
20823
21014
|
}
|
|
20824
|
-
_context10.n =
|
|
21015
|
+
_context10.n = 9;
|
|
20825
21016
|
return effects.call(messageQueryBuilder.build);
|
|
20826
|
-
case
|
|
20827
|
-
|
|
20828
|
-
_context10.n =
|
|
21017
|
+
case 9:
|
|
21018
|
+
_t1 = _context10.v;
|
|
21019
|
+
_context10.n = 11;
|
|
20829
21020
|
break;
|
|
20830
|
-
case
|
|
20831
|
-
|
|
20832
|
-
case
|
|
20833
|
-
messageQuery =
|
|
21021
|
+
case 10:
|
|
21022
|
+
_t1 = null;
|
|
21023
|
+
case 11:
|
|
21024
|
+
messageQuery = _t1;
|
|
20834
21025
|
query.messageQuery = messageQuery;
|
|
20835
21026
|
cachedMessages = Object.values(getMessagesFromMap(channel.id) || {}).sort(function (a, b) {
|
|
20836
21027
|
return Number(a.id) - Number(b.id);
|
|
@@ -20840,161 +21031,126 @@ function getMessagesQuery(action) {
|
|
|
20840
21031
|
hasNext: false
|
|
20841
21032
|
};
|
|
20842
21033
|
if (!loadWithLastMessage) {
|
|
20843
|
-
_context10.n =
|
|
21034
|
+
_context10.n = 29;
|
|
20844
21035
|
break;
|
|
20845
21036
|
}
|
|
20846
|
-
if (!(
|
|
20847
|
-
_context10.n =
|
|
21037
|
+
if (!(channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
21038
|
+
_context10.n = 22;
|
|
20848
21039
|
break;
|
|
20849
21040
|
}
|
|
20850
21041
|
setHasPrevCached(false);
|
|
20851
21042
|
setAllMessages([]);
|
|
20852
21043
|
messageQuery.limit = MESSAGES_MAX_LENGTH;
|
|
20853
21044
|
if (!Number(channel.lastDisplayedMessageId)) {
|
|
20854
|
-
_context10.n =
|
|
21045
|
+
_context10.n = 15;
|
|
20855
21046
|
break;
|
|
20856
21047
|
}
|
|
20857
21048
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20858
|
-
_context10.n =
|
|
21049
|
+
_context10.n = 13;
|
|
20859
21050
|
break;
|
|
20860
21051
|
}
|
|
20861
|
-
_context10.n =
|
|
21052
|
+
_context10.n = 12;
|
|
20862
21053
|
return effects.call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
|
|
20863
|
-
case
|
|
20864
|
-
|
|
20865
|
-
_context10.n =
|
|
21054
|
+
case 12:
|
|
21055
|
+
_t10 = _context10.v;
|
|
21056
|
+
_context10.n = 14;
|
|
20866
21057
|
break;
|
|
20867
|
-
case
|
|
20868
|
-
|
|
21058
|
+
case 13:
|
|
21059
|
+
_t10 = {
|
|
20869
21060
|
messages: [],
|
|
20870
21061
|
hasNext: false
|
|
20871
21062
|
};
|
|
20872
|
-
case
|
|
20873
|
-
result =
|
|
20874
|
-
_context10.n =
|
|
21063
|
+
case 14:
|
|
21064
|
+
result = _t10;
|
|
21065
|
+
_context10.n = 19;
|
|
20875
21066
|
break;
|
|
20876
|
-
case
|
|
21067
|
+
case 15:
|
|
20877
21068
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20878
|
-
_context10.n =
|
|
21069
|
+
_context10.n = 17;
|
|
20879
21070
|
break;
|
|
20880
21071
|
}
|
|
20881
|
-
_context10.n =
|
|
21072
|
+
_context10.n = 16;
|
|
20882
21073
|
return effects.call(messageQuery.loadPrevious);
|
|
20883
|
-
case
|
|
20884
|
-
|
|
20885
|
-
_context10.n =
|
|
21074
|
+
case 16:
|
|
21075
|
+
_t11 = _context10.v;
|
|
21076
|
+
_context10.n = 18;
|
|
20886
21077
|
break;
|
|
20887
|
-
case
|
|
20888
|
-
|
|
21078
|
+
case 17:
|
|
21079
|
+
_t11 = {
|
|
20889
21080
|
messages: [],
|
|
20890
21081
|
hasNext: false
|
|
20891
21082
|
};
|
|
20892
|
-
case 11:
|
|
20893
|
-
result = _t10;
|
|
20894
|
-
case 12:
|
|
20895
|
-
_context10.n = 13;
|
|
20896
|
-
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20897
|
-
case 13:
|
|
20898
|
-
setMessagesToMap(channel.id, result.messages, (_result$messages$ = result.messages[0]) === null || _result$messages$ === void 0 ? void 0 : _result$messages$.id, (_result$messages = result.messages[result.messages.length - 1]) === null || _result$messages === void 0 ? void 0 : _result$messages.id);
|
|
20899
|
-
setAllMessages(result.messages);
|
|
20900
|
-
_context10.n = 14;
|
|
20901
|
-
return effects.put(setMessagesHasPrevAC(true));
|
|
20902
|
-
case 14:
|
|
20903
|
-
_context10.n = 17;
|
|
20904
|
-
break;
|
|
20905
|
-
case 15:
|
|
20906
|
-
result.messages = getFromAllMessagesByMessageId('', '', true);
|
|
20907
|
-
_context10.n = 16;
|
|
20908
|
-
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20909
|
-
case 16:
|
|
20910
|
-
_context10.n = 17;
|
|
20911
|
-
return effects.put(setMessagesHasPrevAC(true));
|
|
20912
|
-
case 17:
|
|
20913
|
-
_context10.n = 18;
|
|
20914
|
-
return effects.put(setMessagesHasNextAC(false));
|
|
20915
21083
|
case 18:
|
|
20916
|
-
|
|
20917
|
-
if (!(messageId && scrollToMessage)) {
|
|
20918
|
-
_context10.n = 21;
|
|
20919
|
-
break;
|
|
20920
|
-
}
|
|
20921
|
-
if (!(channel.newMessageCount && channel.newMessageCount > 0)) {
|
|
20922
|
-
_context10.n = 20;
|
|
20923
|
-
break;
|
|
20924
|
-
}
|
|
20925
|
-
_context10.n = 19;
|
|
20926
|
-
return effects.put(setScrollToMessagesAC(channel.lastDisplayedMessageId, highlight, behavior));
|
|
21084
|
+
result = _t11;
|
|
20927
21085
|
case 19:
|
|
20928
|
-
_context10.n =
|
|
20929
|
-
|
|
21086
|
+
_context10.n = 20;
|
|
21087
|
+
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20930
21088
|
case 20:
|
|
21089
|
+
setMessagesToMap(channel.id, result.messages, (_result$messages$ = result.messages[0]) === null || _result$messages$ === void 0 ? void 0 : _result$messages$.id, (_result$messages = result.messages[result.messages.length - 1]) === null || _result$messages === void 0 ? void 0 : _result$messages.id);
|
|
21090
|
+
setAllMessages(result.messages);
|
|
20931
21091
|
_context10.n = 21;
|
|
20932
|
-
return effects.put(
|
|
21092
|
+
return effects.put(setMessagesHasPrevAC(true));
|
|
20933
21093
|
case 21:
|
|
20934
|
-
_context10.n =
|
|
21094
|
+
_context10.n = 24;
|
|
20935
21095
|
break;
|
|
20936
21096
|
case 22:
|
|
20937
|
-
|
|
20938
|
-
_context10.n = 52;
|
|
20939
|
-
break;
|
|
20940
|
-
}
|
|
20941
|
-
messages = store.getState().MessageReducer.activeChannelMessages;
|
|
20942
|
-
centerMessageId = (_messages$Math$floor = messages[Math.floor(messages.length / 2)]) === null || _messages$Math$floor === void 0 ? void 0 : _messages$Math$floor.id;
|
|
20943
|
-
loadWithMessageId = networkChanged && (messages === null || messages === void 0 ? void 0 : messages.length) > 0 ? centerMessageId : messageId;
|
|
20944
|
-
allMessages = getAllMessages();
|
|
20945
|
-
messageIndex = allMessages.findIndex(function (msg) {
|
|
20946
|
-
return msg.id === loadWithMessageId;
|
|
20947
|
-
});
|
|
20948
|
-
maxLengthPart = MESSAGES_MAX_LENGTH / 2;
|
|
20949
|
-
if (!(messageIndex >= maxLengthPart)) {
|
|
20950
|
-
_context10.n = 25;
|
|
20951
|
-
break;
|
|
20952
|
-
}
|
|
20953
|
-
result.messages = allMessages.slice(messageIndex - maxLengthPart, messageIndex + maxLengthPart);
|
|
21097
|
+
result.messages = getFromAllMessagesByMessageId('', '', true);
|
|
20954
21098
|
_context10.n = 23;
|
|
20955
21099
|
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20956
21100
|
case 23:
|
|
20957
|
-
setHasPrevCached(messageIndex > maxLengthPart);
|
|
20958
|
-
setHasNextCached(allMessages.length > maxLengthPart);
|
|
20959
21101
|
_context10.n = 24;
|
|
20960
21102
|
return effects.put(setMessagesHasPrevAC(true));
|
|
20961
21103
|
case 24:
|
|
20962
|
-
_context10.n =
|
|
20963
|
-
|
|
21104
|
+
_context10.n = 25;
|
|
21105
|
+
return effects.put(setMessagesHasNextAC(false));
|
|
20964
21106
|
case 25:
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
21107
|
+
setHasNextCached(false);
|
|
21108
|
+
if (!(messageId && scrollToMessage)) {
|
|
21109
|
+
_context10.n = 28;
|
|
21110
|
+
break;
|
|
21111
|
+
}
|
|
21112
|
+
if (!(channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
20968
21113
|
_context10.n = 27;
|
|
20969
21114
|
break;
|
|
20970
21115
|
}
|
|
20971
21116
|
_context10.n = 26;
|
|
20972
|
-
return effects.
|
|
21117
|
+
return effects.put(setScrollToMessagesAC(channel.lastDisplayedMessageId, highlight, behavior));
|
|
20973
21118
|
case 26:
|
|
20974
|
-
_t11 = _context10.v;
|
|
20975
21119
|
_context10.n = 28;
|
|
20976
21120
|
break;
|
|
20977
21121
|
case 27:
|
|
20978
|
-
|
|
20979
|
-
|
|
20980
|
-
hasNext: false
|
|
20981
|
-
};
|
|
21122
|
+
_context10.n = 28;
|
|
21123
|
+
return effects.put(scrollToNewMessageAC(true));
|
|
20982
21124
|
case 28:
|
|
20983
|
-
|
|
20984
|
-
|
|
20985
|
-
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
21125
|
+
_context10.n = 70;
|
|
21126
|
+
break;
|
|
20986
21127
|
case 29:
|
|
20987
|
-
if (!
|
|
20988
|
-
_context10.n =
|
|
21128
|
+
if (!messageId) {
|
|
21129
|
+
_context10.n = 40;
|
|
20989
21130
|
break;
|
|
20990
21131
|
}
|
|
20991
|
-
|
|
21132
|
+
messages = store.getState().MessageReducer.activeChannelMessages;
|
|
21133
|
+
loadNextMessageId = '';
|
|
21134
|
+
loadPreviousMessageId = '';
|
|
21135
|
+
nextLoadLimit = MESSAGES_MAX_PAGE_COUNT / 2;
|
|
21136
|
+
previousLoadLimit = MESSAGES_MAX_PAGE_COUNT / 2;
|
|
21137
|
+
if (networkChanged) {
|
|
21138
|
+
centerMessageIndex = getCenterTwoMessages(messages);
|
|
21139
|
+
loadPreviousMessageId = centerMessageIndex.mid2.messageId;
|
|
21140
|
+
loadNextMessageId = centerMessageIndex.mid1.messageId;
|
|
21141
|
+
previousLoadLimit = centerMessageIndex.mid2.index;
|
|
21142
|
+
nextLoadLimit = messages.length - centerMessageIndex.mid1.index - 1;
|
|
21143
|
+
} else if (messageId) {
|
|
21144
|
+
loadPreviousMessageId = messageId;
|
|
21145
|
+
}
|
|
21146
|
+
messageQuery.limit = previousLoadLimit;
|
|
21147
|
+
log.info('load by message id from server ...............', messageId);
|
|
20992
21148
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20993
21149
|
_context10.n = 31;
|
|
20994
21150
|
break;
|
|
20995
21151
|
}
|
|
20996
21152
|
_context10.n = 30;
|
|
20997
|
-
return effects.call(messageQuery.loadPreviousMessageId,
|
|
21153
|
+
return effects.call(messageQuery.loadPreviousMessageId, loadPreviousMessageId);
|
|
20998
21154
|
case 30:
|
|
20999
21155
|
_t12 = _context10.v;
|
|
21000
21156
|
_context10.n = 32;
|
|
@@ -21005,235 +21161,185 @@ function getMessagesQuery(action) {
|
|
|
21005
21161
|
hasNext: false
|
|
21006
21162
|
};
|
|
21007
21163
|
case 32:
|
|
21008
|
-
|
|
21009
|
-
|
|
21010
|
-
|
|
21011
|
-
|
|
21012
|
-
|
|
21013
|
-
|
|
21164
|
+
firstResult = _t12;
|
|
21165
|
+
if (!networkChanged && firstResult.messages.length > 0) {
|
|
21166
|
+
loadNextMessageId = firstResult.messages[firstResult.messages.length - 1].id;
|
|
21167
|
+
} else if (!networkChanged && !firstResult.messages.length) {
|
|
21168
|
+
loadNextMessageId = '0';
|
|
21169
|
+
}
|
|
21014
21170
|
messageQuery.reverse = false;
|
|
21171
|
+
messageQuery.limit = nextLoadLimit;
|
|
21015
21172
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21016
|
-
_context10.n =
|
|
21173
|
+
_context10.n = 34;
|
|
21017
21174
|
break;
|
|
21018
21175
|
}
|
|
21019
|
-
_context10.n =
|
|
21020
|
-
return effects.call(messageQuery.loadNextMessageId,
|
|
21021
|
-
case
|
|
21176
|
+
_context10.n = 33;
|
|
21177
|
+
return effects.call(messageQuery.loadNextMessageId, loadNextMessageId);
|
|
21178
|
+
case 33:
|
|
21022
21179
|
_t13 = _context10.v;
|
|
21023
|
-
_context10.n =
|
|
21180
|
+
_context10.n = 35;
|
|
21024
21181
|
break;
|
|
21025
|
-
case
|
|
21182
|
+
case 34:
|
|
21026
21183
|
_t13 = {
|
|
21027
21184
|
messages: [],
|
|
21028
21185
|
hasNext: false
|
|
21029
21186
|
};
|
|
21187
|
+
case 35:
|
|
21188
|
+
secondResult = _t13;
|
|
21189
|
+
result.messages = [].concat(firstResult.messages, secondResult.messages);
|
|
21190
|
+
_context10.n = 36;
|
|
21191
|
+
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
21030
21192
|
case 36:
|
|
21031
|
-
thirdResult = _t13;
|
|
21032
|
-
result.messages = [].concat(result.messages, thirdResult.messages);
|
|
21033
|
-
_context10.n = 37;
|
|
21034
|
-
return effects.put(addMessagesAC(JSON.parse(JSON.stringify(thirdResult.messages)), MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21035
|
-
case 37:
|
|
21036
|
-
if (!(secondResult.hasNext && !thirdResult.hasNext)) {
|
|
21037
|
-
_context10.n = 42;
|
|
21038
|
-
break;
|
|
21039
|
-
}
|
|
21040
|
-
messageQuery.limit = MESSAGES_MAX_PAGE_COUNT - 50 - secondResult.messages.length - result.messages.length;
|
|
21041
|
-
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21042
|
-
_context10.n = 39;
|
|
21043
|
-
break;
|
|
21044
|
-
}
|
|
21045
|
-
_context10.n = 38;
|
|
21046
|
-
return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
21047
|
-
case 38:
|
|
21048
|
-
_t14 = _context10.v;
|
|
21049
|
-
_context10.n = 40;
|
|
21050
|
-
break;
|
|
21051
|
-
case 39:
|
|
21052
|
-
_t14 = {
|
|
21053
|
-
messages: [],
|
|
21054
|
-
hasNext: false
|
|
21055
|
-
};
|
|
21056
|
-
case 40:
|
|
21057
|
-
fourthResult = _t14;
|
|
21058
|
-
result.messages = [].concat(fourthResult.messages, result.messages);
|
|
21059
|
-
_context10.n = 41;
|
|
21060
|
-
return effects.put(addMessagesAC(JSON.parse(JSON.stringify(fourthResult.messages)), MESSAGE_LOAD_DIRECTION.PREV));
|
|
21061
|
-
case 41:
|
|
21062
|
-
_context10.n = 46;
|
|
21063
|
-
break;
|
|
21064
|
-
case 42:
|
|
21065
|
-
if (!(!secondResult.hasNext && thirdResult.hasNext)) {
|
|
21066
|
-
_context10.n = 46;
|
|
21067
|
-
break;
|
|
21068
|
-
}
|
|
21069
|
-
messageQuery.limit = MESSAGES_MAX_PAGE_COUNT - 50 - secondResult.messages.length - result.messages.length;
|
|
21070
|
-
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21071
|
-
_context10.n = 44;
|
|
21072
|
-
break;
|
|
21073
|
-
}
|
|
21074
|
-
_context10.n = 43;
|
|
21075
|
-
return effects.call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
|
|
21076
|
-
case 43:
|
|
21077
|
-
_t15 = _context10.v;
|
|
21078
|
-
_context10.n = 45;
|
|
21079
|
-
break;
|
|
21080
|
-
case 44:
|
|
21081
|
-
_t15 = {
|
|
21082
|
-
messages: [],
|
|
21083
|
-
hasNext: false
|
|
21084
|
-
};
|
|
21085
|
-
case 45:
|
|
21086
|
-
_fourthResult = _t15;
|
|
21087
|
-
result.messages = [].concat(result.messages, _fourthResult.messages);
|
|
21088
|
-
_context10.n = 46;
|
|
21089
|
-
return effects.put(addMessagesAC(JSON.parse(JSON.stringify(_fourthResult.messages)), MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21090
|
-
case 46:
|
|
21091
|
-
messageQuery.reverse = true;
|
|
21092
|
-
case 47:
|
|
21093
21193
|
setMessagesToMap(channel.id, result.messages, (_result$messages$2 = result.messages[0]) === null || _result$messages$2 === void 0 ? void 0 : _result$messages$2.id, (_result$messages2 = result.messages[result.messages.length - 1]) === null || _result$messages2 === void 0 ? void 0 : _result$messages2.id);
|
|
21094
21194
|
setAllMessages([].concat(result.messages));
|
|
21095
21195
|
setHasPrevCached(false);
|
|
21096
21196
|
setHasNextCached(false);
|
|
21097
|
-
|
|
21098
|
-
_context10.n = 49;
|
|
21197
|
+
_context10.n = 37;
|
|
21099
21198
|
return effects.put(setMessagesHasNextAC(true));
|
|
21100
|
-
case
|
|
21101
|
-
if (!scrollToMessage) {
|
|
21102
|
-
_context10.n =
|
|
21199
|
+
case 37:
|
|
21200
|
+
if (!(scrollToMessage && !networkChanged)) {
|
|
21201
|
+
_context10.n = 38;
|
|
21103
21202
|
break;
|
|
21104
21203
|
}
|
|
21105
|
-
_context10.n =
|
|
21106
|
-
return effects.put(setScrollToMessagesAC(
|
|
21107
|
-
case
|
|
21108
|
-
_context10.n =
|
|
21204
|
+
_context10.n = 38;
|
|
21205
|
+
return effects.put(setScrollToMessagesAC(messageId, highlight, behavior));
|
|
21206
|
+
case 38:
|
|
21207
|
+
_context10.n = 39;
|
|
21109
21208
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
21110
|
-
case
|
|
21111
|
-
_context10.n =
|
|
21209
|
+
case 39:
|
|
21210
|
+
_context10.n = 70;
|
|
21112
21211
|
break;
|
|
21113
|
-
case
|
|
21114
|
-
if (!(
|
|
21115
|
-
_context10.n =
|
|
21212
|
+
case 40:
|
|
21213
|
+
if (!(channelNewMessageCount && channel.lastDisplayedMessageId)) {
|
|
21214
|
+
_context10.n = 54;
|
|
21116
21215
|
break;
|
|
21117
21216
|
}
|
|
21118
21217
|
setAllMessages([]);
|
|
21119
21218
|
messageQuery.limit = MESSAGES_MAX_LENGTH;
|
|
21120
21219
|
if (!Number(channel.lastDisplayedMessageId)) {
|
|
21121
|
-
_context10.n =
|
|
21220
|
+
_context10.n = 44;
|
|
21122
21221
|
break;
|
|
21123
21222
|
}
|
|
21124
21223
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21125
|
-
_context10.n =
|
|
21224
|
+
_context10.n = 42;
|
|
21126
21225
|
break;
|
|
21127
21226
|
}
|
|
21128
|
-
_context10.n =
|
|
21227
|
+
_context10.n = 41;
|
|
21129
21228
|
return effects.call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
|
|
21130
|
-
case
|
|
21131
|
-
|
|
21132
|
-
_context10.n =
|
|
21229
|
+
case 41:
|
|
21230
|
+
_t14 = _context10.v;
|
|
21231
|
+
_context10.n = 43;
|
|
21133
21232
|
break;
|
|
21134
|
-
case
|
|
21135
|
-
|
|
21233
|
+
case 42:
|
|
21234
|
+
_t14 = {
|
|
21136
21235
|
messages: [],
|
|
21137
21236
|
hasNext: false
|
|
21138
21237
|
};
|
|
21139
|
-
case
|
|
21140
|
-
result =
|
|
21141
|
-
_context10.n =
|
|
21238
|
+
case 43:
|
|
21239
|
+
result = _t14;
|
|
21240
|
+
_context10.n = 48;
|
|
21142
21241
|
break;
|
|
21143
|
-
case
|
|
21242
|
+
case 44:
|
|
21144
21243
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21145
|
-
_context10.n =
|
|
21244
|
+
_context10.n = 46;
|
|
21146
21245
|
break;
|
|
21147
21246
|
}
|
|
21148
|
-
_context10.n =
|
|
21247
|
+
_context10.n = 45;
|
|
21149
21248
|
return effects.call(messageQuery.loadPrevious);
|
|
21150
|
-
case
|
|
21151
|
-
|
|
21152
|
-
_context10.n =
|
|
21249
|
+
case 45:
|
|
21250
|
+
_t15 = _context10.v;
|
|
21251
|
+
_context10.n = 47;
|
|
21153
21252
|
break;
|
|
21154
|
-
case
|
|
21155
|
-
|
|
21253
|
+
case 46:
|
|
21254
|
+
_t15 = {
|
|
21156
21255
|
messages: [],
|
|
21157
21256
|
hasNext: false
|
|
21158
21257
|
};
|
|
21159
|
-
case
|
|
21160
|
-
result =
|
|
21161
|
-
case
|
|
21162
|
-
_context10.n =
|
|
21258
|
+
case 47:
|
|
21259
|
+
result = _t15;
|
|
21260
|
+
case 48:
|
|
21261
|
+
_context10.n = 49;
|
|
21163
21262
|
return effects.put(setMessagesHasPrevAC(true));
|
|
21164
|
-
case
|
|
21165
|
-
_context10.n =
|
|
21263
|
+
case 49:
|
|
21264
|
+
_context10.n = 50;
|
|
21166
21265
|
return effects.put(setMessagesHasNextAC(channel.lastMessage && result.messages.length > 0 && channel.lastMessage.id !== result.messages[result.messages.length - 1].id));
|
|
21167
|
-
case
|
|
21266
|
+
case 50:
|
|
21168
21267
|
setMessagesToMap(channel.id, result.messages, (_result$messages$3 = result.messages[0]) === null || _result$messages$3 === void 0 ? void 0 : _result$messages$3.id, (_result$messages3 = result.messages[result.messages.length - 1]) === null || _result$messages3 === void 0 ? void 0 : _result$messages3.id);
|
|
21169
21268
|
setAllMessages([].concat(result.messages));
|
|
21170
|
-
_context10.n =
|
|
21269
|
+
_context10.n = 51;
|
|
21171
21270
|
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
21172
|
-
case
|
|
21173
|
-
_context10.n =
|
|
21271
|
+
case 51:
|
|
21272
|
+
_context10.n = 52;
|
|
21273
|
+
return effects.put(scrollToNewMessageAC(false));
|
|
21274
|
+
case 52:
|
|
21275
|
+
_context10.n = 53;
|
|
21276
|
+
return effects.put(setUnreadScrollToAC(true));
|
|
21277
|
+
case 53:
|
|
21278
|
+
_context10.n = 70;
|
|
21174
21279
|
break;
|
|
21175
|
-
case
|
|
21280
|
+
case 54:
|
|
21176
21281
|
if (!(cachedMessages && cachedMessages.length)) {
|
|
21177
|
-
_context10.n =
|
|
21282
|
+
_context10.n = 57;
|
|
21178
21283
|
break;
|
|
21179
21284
|
}
|
|
21180
|
-
|
|
21181
|
-
|
|
21182
|
-
|
|
21183
|
-
|
|
21285
|
+
_messages = getFromAllMessagesByMessageId('', '', true);
|
|
21286
|
+
_context10.n = 55;
|
|
21287
|
+
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(_messages))));
|
|
21288
|
+
case 55:
|
|
21289
|
+
_context10.n = 56;
|
|
21184
21290
|
return effects.delay(0);
|
|
21185
|
-
case
|
|
21186
|
-
_filteredPendingMessages = getFilteredPendingMessages(
|
|
21187
|
-
_context10.n =
|
|
21291
|
+
case 56:
|
|
21292
|
+
_filteredPendingMessages = getFilteredPendingMessages(_messages);
|
|
21293
|
+
_context10.n = 57;
|
|
21188
21294
|
return effects.put(addMessagesAC(_filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21189
|
-
case
|
|
21295
|
+
case 57:
|
|
21190
21296
|
log.info('load message from server');
|
|
21191
21297
|
result = {
|
|
21192
21298
|
messages: [],
|
|
21193
21299
|
hasNext: false
|
|
21194
21300
|
};
|
|
21195
21301
|
if (!((channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId) > (channel === null || channel === void 0 ? void 0 : (_channel$lastMessage4 = channel.lastMessage) === null || _channel$lastMessage4 === void 0 ? void 0 : _channel$lastMessage4.id))) {
|
|
21196
|
-
_context10.n =
|
|
21302
|
+
_context10.n = 61;
|
|
21197
21303
|
break;
|
|
21198
21304
|
}
|
|
21199
21305
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21200
|
-
_context10.n =
|
|
21306
|
+
_context10.n = 59;
|
|
21201
21307
|
break;
|
|
21202
21308
|
}
|
|
21203
|
-
_context10.n =
|
|
21309
|
+
_context10.n = 58;
|
|
21204
21310
|
return effects.call(messageQuery.loadPreviousMessageId, channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId);
|
|
21205
|
-
case
|
|
21206
|
-
|
|
21207
|
-
_context10.n =
|
|
21311
|
+
case 58:
|
|
21312
|
+
_t16 = _context10.v;
|
|
21313
|
+
_context10.n = 60;
|
|
21208
21314
|
break;
|
|
21209
|
-
case
|
|
21210
|
-
|
|
21315
|
+
case 59:
|
|
21316
|
+
_t16 = {
|
|
21211
21317
|
messages: [],
|
|
21212
21318
|
hasNext: false
|
|
21213
21319
|
};
|
|
21214
|
-
case
|
|
21215
|
-
result =
|
|
21216
|
-
_context10.n =
|
|
21320
|
+
case 60:
|
|
21321
|
+
result = _t16;
|
|
21322
|
+
_context10.n = 65;
|
|
21217
21323
|
break;
|
|
21218
|
-
case
|
|
21324
|
+
case 61:
|
|
21219
21325
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21220
|
-
_context10.n =
|
|
21326
|
+
_context10.n = 63;
|
|
21221
21327
|
break;
|
|
21222
21328
|
}
|
|
21223
|
-
_context10.n =
|
|
21329
|
+
_context10.n = 62;
|
|
21224
21330
|
return effects.call(messageQuery.loadPrevious);
|
|
21225
|
-
case
|
|
21226
|
-
|
|
21227
|
-
_context10.n =
|
|
21331
|
+
case 62:
|
|
21332
|
+
_t17 = _context10.v;
|
|
21333
|
+
_context10.n = 64;
|
|
21228
21334
|
break;
|
|
21229
|
-
case
|
|
21230
|
-
|
|
21335
|
+
case 63:
|
|
21336
|
+
_t17 = {
|
|
21231
21337
|
messages: [],
|
|
21232
21338
|
hasNext: false
|
|
21233
21339
|
};
|
|
21234
|
-
case
|
|
21235
|
-
result =
|
|
21236
|
-
case
|
|
21340
|
+
case 64:
|
|
21341
|
+
result = _t17;
|
|
21342
|
+
case 65:
|
|
21237
21343
|
updatedMessages = [];
|
|
21238
21344
|
result.messages.forEach(function (msg) {
|
|
21239
21345
|
var updatedMessage = updateMessageOnMap(channel.id, {
|
|
@@ -21245,75 +21351,85 @@ function getMessagesQuery(action) {
|
|
|
21245
21351
|
});
|
|
21246
21352
|
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
21353
|
if (!updatedMessages.length) {
|
|
21248
|
-
_context10.n =
|
|
21354
|
+
_context10.n = 69;
|
|
21249
21355
|
break;
|
|
21250
21356
|
}
|
|
21251
|
-
_context10.n =
|
|
21357
|
+
_context10.n = 66;
|
|
21252
21358
|
return effects.call(updateMessages, channel, updatedMessages, (_updatedMessages$ = updatedMessages[0]) === null || _updatedMessages$ === void 0 ? void 0 : _updatedMessages$.id, messageIdForLoad);
|
|
21253
|
-
case
|
|
21254
|
-
_context10.n =
|
|
21359
|
+
case 66:
|
|
21360
|
+
_context10.n = 67;
|
|
21255
21361
|
return effects.put(setMessagesHasPrevAC(true));
|
|
21256
|
-
case
|
|
21257
|
-
_context10.n =
|
|
21362
|
+
case 67:
|
|
21363
|
+
_context10.n = 68;
|
|
21258
21364
|
return effects.put(setMessagesHasNextAC(false));
|
|
21259
|
-
case
|
|
21365
|
+
case 68:
|
|
21366
|
+
_context10.n = 70;
|
|
21367
|
+
break;
|
|
21368
|
+
case 69:
|
|
21369
|
+
if (!(!(cachedMessages !== null && cachedMessages !== void 0 && cachedMessages.length) && !((_result$messages4 = result.messages) !== null && _result$messages4 !== void 0 && _result$messages4.length))) {
|
|
21370
|
+
_context10.n = 70;
|
|
21371
|
+
break;
|
|
21372
|
+
}
|
|
21373
|
+
_context10.n = 70;
|
|
21374
|
+
return effects.put(setMessagesAC([]));
|
|
21375
|
+
case 70:
|
|
21260
21376
|
filteredPendingMessages = getFilteredPendingMessages(result.messages);
|
|
21261
|
-
_context10.n =
|
|
21377
|
+
_context10.n = 71;
|
|
21262
21378
|
return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21263
|
-
case
|
|
21379
|
+
case 71:
|
|
21264
21380
|
waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
|
|
21265
21381
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED && waitToSendPendingMessages)) {
|
|
21266
|
-
_context10.n =
|
|
21382
|
+
_context10.n = 73;
|
|
21267
21383
|
break;
|
|
21268
21384
|
}
|
|
21269
|
-
_context10.n =
|
|
21385
|
+
_context10.n = 72;
|
|
21270
21386
|
return effects.put(setWaitToSendPendingMessagesAC(false));
|
|
21271
|
-
case
|
|
21272
|
-
_context10.n =
|
|
21387
|
+
case 72:
|
|
21388
|
+
_context10.n = 73;
|
|
21273
21389
|
return effects.spawn(sendPendingMessages, connectionState);
|
|
21274
|
-
case
|
|
21275
|
-
_context10.n =
|
|
21390
|
+
case 73:
|
|
21391
|
+
_context10.n = 74;
|
|
21276
21392
|
return effects.call(SceytChatClient.getChannel, channel.id, true);
|
|
21277
|
-
case
|
|
21393
|
+
case 74:
|
|
21278
21394
|
updatedChannel = _context10.v;
|
|
21279
21395
|
if (!(updatedChannel && updatedChannel !== null && updatedChannel !== void 0 && updatedChannel.lastMessage)) {
|
|
21280
|
-
_context10.n =
|
|
21396
|
+
_context10.n = 76;
|
|
21281
21397
|
break;
|
|
21282
21398
|
}
|
|
21283
|
-
_context10.n =
|
|
21399
|
+
_context10.n = 75;
|
|
21284
21400
|
return effects.put(updateChannelLastMessageAC(updatedChannel.lastMessage, updatedChannel));
|
|
21285
|
-
case
|
|
21401
|
+
case 75:
|
|
21286
21402
|
updateChannelLastMessageOnAllChannels(channel.id, updatedChannel.lastMessage);
|
|
21287
|
-
case
|
|
21288
|
-
_context10.n =
|
|
21403
|
+
case 76:
|
|
21404
|
+
_context10.n = 78;
|
|
21289
21405
|
break;
|
|
21290
|
-
case
|
|
21406
|
+
case 77:
|
|
21291
21407
|
if (!(channel !== null && channel !== void 0 && channel.isMockChannel)) {
|
|
21292
|
-
_context10.n =
|
|
21408
|
+
_context10.n = 78;
|
|
21293
21409
|
break;
|
|
21294
21410
|
}
|
|
21295
|
-
_context10.n =
|
|
21411
|
+
_context10.n = 78;
|
|
21296
21412
|
return effects.put(setMessagesAC([]));
|
|
21297
|
-
case
|
|
21298
|
-
_context10.n =
|
|
21413
|
+
case 78:
|
|
21414
|
+
_context10.n = 80;
|
|
21299
21415
|
break;
|
|
21300
|
-
case
|
|
21301
|
-
_context10.p =
|
|
21302
|
-
|
|
21303
|
-
log.error('error in message query',
|
|
21304
|
-
case
|
|
21305
|
-
_context10.p =
|
|
21306
|
-
_context10.n =
|
|
21416
|
+
case 79:
|
|
21417
|
+
_context10.p = 79;
|
|
21418
|
+
_t18 = _context10.v;
|
|
21419
|
+
log.error('error in message query', _t18);
|
|
21420
|
+
case 80:
|
|
21421
|
+
_context10.p = 80;
|
|
21422
|
+
_context10.n = 81;
|
|
21307
21423
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
21308
|
-
case
|
|
21309
|
-
return _context10.f(
|
|
21310
|
-
case
|
|
21424
|
+
case 81:
|
|
21425
|
+
return _context10.f(80);
|
|
21426
|
+
case 82:
|
|
21311
21427
|
return _context10.a(2);
|
|
21312
21428
|
}
|
|
21313
|
-
}, _marked7$1, null, [[0,
|
|
21429
|
+
}, _marked7$1, null, [[2, 7], [0, 79, 80, 82]]);
|
|
21314
21430
|
}
|
|
21315
21431
|
function getMessageQuery(action) {
|
|
21316
|
-
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage,
|
|
21432
|
+
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage, _t19;
|
|
21317
21433
|
return _regenerator().w(function (_context11) {
|
|
21318
21434
|
while (1) switch (_context11.p = _context11.n) {
|
|
21319
21435
|
case 0:
|
|
@@ -21363,15 +21479,15 @@ function getMessageQuery(action) {
|
|
|
21363
21479
|
break;
|
|
21364
21480
|
case 7:
|
|
21365
21481
|
_context11.p = 7;
|
|
21366
|
-
|
|
21367
|
-
log.error('error in message query',
|
|
21482
|
+
_t19 = _context11.v;
|
|
21483
|
+
log.error('error in message query', _t19);
|
|
21368
21484
|
case 8:
|
|
21369
21485
|
return _context11.a(2);
|
|
21370
21486
|
}
|
|
21371
21487
|
}, _marked8$1, null, [[0, 7]]);
|
|
21372
21488
|
}
|
|
21373
21489
|
function loadMoreMessages(action) {
|
|
21374
|
-
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _result$messages$4, _result$
|
|
21490
|
+
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _result$messages$4, _result$messages5, _result$messages$5, _result$messages6, _t20;
|
|
21375
21491
|
return _regenerator().w(function (_context12) {
|
|
21376
21492
|
while (1) switch (_context12.p = _context12.n) {
|
|
21377
21493
|
case 0:
|
|
@@ -21415,7 +21531,7 @@ function loadMoreMessages(action) {
|
|
|
21415
21531
|
result = _context12.v;
|
|
21416
21532
|
if (result.messages.length) {
|
|
21417
21533
|
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$
|
|
21534
|
+
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
21535
|
}
|
|
21420
21536
|
_context12.n = 5;
|
|
21421
21537
|
return effects.put(setMessagesHasPrevAC(result.hasNext));
|
|
@@ -21443,7 +21559,7 @@ function loadMoreMessages(action) {
|
|
|
21443
21559
|
result = _context12.v;
|
|
21444
21560
|
if (result.messages.length) {
|
|
21445
21561
|
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$
|
|
21562
|
+
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
21563
|
}
|
|
21448
21564
|
_context12.n = 9;
|
|
21449
21565
|
return effects.put(setMessagesHasNextAC(result.hasNext));
|
|
@@ -21484,15 +21600,15 @@ function loadMoreMessages(action) {
|
|
|
21484
21600
|
break;
|
|
21485
21601
|
case 18:
|
|
21486
21602
|
_context12.p = 18;
|
|
21487
|
-
|
|
21488
|
-
log.error('error in load more messages',
|
|
21603
|
+
_t20 = _context12.v;
|
|
21604
|
+
log.error('error in load more messages', _t20);
|
|
21489
21605
|
case 19:
|
|
21490
21606
|
return _context12.a(2);
|
|
21491
21607
|
}
|
|
21492
21608
|
}, _marked9$1, null, [[0, 18]]);
|
|
21493
21609
|
}
|
|
21494
21610
|
function addReaction(action) {
|
|
21495
|
-
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam,
|
|
21611
|
+
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam, _t21;
|
|
21496
21612
|
return _regenerator().w(function (_context13) {
|
|
21497
21613
|
while (1) switch (_context13.p = _context13.n) {
|
|
21498
21614
|
case 0:
|
|
@@ -21545,15 +21661,15 @@ function addReaction(action) {
|
|
|
21545
21661
|
break;
|
|
21546
21662
|
case 8:
|
|
21547
21663
|
_context13.p = 8;
|
|
21548
|
-
|
|
21549
|
-
log.error('ERROR in add reaction',
|
|
21664
|
+
_t21 = _context13.v;
|
|
21665
|
+
log.error('ERROR in add reaction', _t21.message);
|
|
21550
21666
|
case 9:
|
|
21551
21667
|
return _context13.a(2);
|
|
21552
21668
|
}
|
|
21553
21669
|
}, _marked0$1, null, [[0, 8]]);
|
|
21554
21670
|
}
|
|
21555
21671
|
function deleteReaction(action) {
|
|
21556
|
-
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam,
|
|
21672
|
+
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam, _t22;
|
|
21557
21673
|
return _regenerator().w(function (_context14) {
|
|
21558
21674
|
while (1) switch (_context14.p = _context14.n) {
|
|
21559
21675
|
case 0:
|
|
@@ -21601,15 +21717,15 @@ function deleteReaction(action) {
|
|
|
21601
21717
|
break;
|
|
21602
21718
|
case 7:
|
|
21603
21719
|
_context14.p = 7;
|
|
21604
|
-
|
|
21605
|
-
log.error('ERROR in delete reaction',
|
|
21720
|
+
_t22 = _context14.v;
|
|
21721
|
+
log.error('ERROR in delete reaction', _t22.message);
|
|
21606
21722
|
case 8:
|
|
21607
21723
|
return _context14.a(2);
|
|
21608
21724
|
}
|
|
21609
21725
|
}, _marked1$1, null, [[0, 7]]);
|
|
21610
21726
|
}
|
|
21611
21727
|
function getReactions(action) {
|
|
21612
|
-
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result,
|
|
21728
|
+
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result, _t23;
|
|
21613
21729
|
return _regenerator().w(function (_context15) {
|
|
21614
21730
|
while (1) switch (_context15.p = _context15.n) {
|
|
21615
21731
|
case 0:
|
|
@@ -21644,15 +21760,15 @@ function getReactions(action) {
|
|
|
21644
21760
|
break;
|
|
21645
21761
|
case 6:
|
|
21646
21762
|
_context15.p = 6;
|
|
21647
|
-
|
|
21648
|
-
log.error('ERROR in get reactions',
|
|
21763
|
+
_t23 = _context15.v;
|
|
21764
|
+
log.error('ERROR in get reactions', _t23.message);
|
|
21649
21765
|
case 7:
|
|
21650
21766
|
return _context15.a(2);
|
|
21651
21767
|
}
|
|
21652
21768
|
}, _marked10$1, null, [[0, 6]]);
|
|
21653
21769
|
}
|
|
21654
21770
|
function loadMoreReactions(action) {
|
|
21655
|
-
var payload, limit, ReactionQuery, result,
|
|
21771
|
+
var payload, limit, ReactionQuery, result, _t24;
|
|
21656
21772
|
return _regenerator().w(function (_context16) {
|
|
21657
21773
|
while (1) switch (_context16.p = _context16.n) {
|
|
21658
21774
|
case 0:
|
|
@@ -21680,15 +21796,15 @@ function loadMoreReactions(action) {
|
|
|
21680
21796
|
break;
|
|
21681
21797
|
case 5:
|
|
21682
21798
|
_context16.p = 5;
|
|
21683
|
-
|
|
21684
|
-
log.error('ERROR in load more reactions',
|
|
21799
|
+
_t24 = _context16.v;
|
|
21800
|
+
log.error('ERROR in load more reactions', _t24.message);
|
|
21685
21801
|
case 6:
|
|
21686
21802
|
return _context16.a(2);
|
|
21687
21803
|
}
|
|
21688
21804
|
}, _marked11$1, null, [[0, 5]]);
|
|
21689
21805
|
}
|
|
21690
21806
|
function getMessageAttachments(action) {
|
|
21691
|
-
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result,
|
|
21807
|
+
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, _t25;
|
|
21692
21808
|
return _regenerator().w(function (_context17) {
|
|
21693
21809
|
while (1) switch (_context17.p = _context17.n) {
|
|
21694
21810
|
case 0:
|
|
@@ -21766,15 +21882,15 @@ function getMessageAttachments(action) {
|
|
|
21766
21882
|
break;
|
|
21767
21883
|
case 13:
|
|
21768
21884
|
_context17.p = 13;
|
|
21769
|
-
|
|
21770
|
-
log.error('error in message attachment query',
|
|
21885
|
+
_t25 = _context17.v;
|
|
21886
|
+
log.error('error in message attachment query', _t25);
|
|
21771
21887
|
case 14:
|
|
21772
21888
|
return _context17.a(2);
|
|
21773
21889
|
}
|
|
21774
21890
|
}, _marked12$1, null, [[0, 13]]);
|
|
21775
21891
|
}
|
|
21776
21892
|
function loadMoreMessageAttachments(action) {
|
|
21777
|
-
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext,
|
|
21893
|
+
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext, _t26;
|
|
21778
21894
|
return _regenerator().w(function (_context18) {
|
|
21779
21895
|
while (1) switch (_context18.p = _context18.n) {
|
|
21780
21896
|
case 0:
|
|
@@ -21818,15 +21934,15 @@ function loadMoreMessageAttachments(action) {
|
|
|
21818
21934
|
break;
|
|
21819
21935
|
case 8:
|
|
21820
21936
|
_context18.p = 8;
|
|
21821
|
-
|
|
21822
|
-
log.error('error in message attachment query',
|
|
21937
|
+
_t26 = _context18.v;
|
|
21938
|
+
log.error('error in message attachment query', _t26);
|
|
21823
21939
|
case 9:
|
|
21824
21940
|
return _context18.a(2);
|
|
21825
21941
|
}
|
|
21826
21942
|
}, _marked13$1, null, [[0, 8]]);
|
|
21827
21943
|
}
|
|
21828
21944
|
function pauseAttachmentUploading(action) {
|
|
21829
|
-
var attachmentId, isPaused,
|
|
21945
|
+
var attachmentId, isPaused, _t27;
|
|
21830
21946
|
return _regenerator().w(function (_context19) {
|
|
21831
21947
|
while (1) switch (_context19.p = _context19.n) {
|
|
21832
21948
|
case 0:
|
|
@@ -21848,15 +21964,15 @@ function pauseAttachmentUploading(action) {
|
|
|
21848
21964
|
break;
|
|
21849
21965
|
case 2:
|
|
21850
21966
|
_context19.p = 2;
|
|
21851
|
-
|
|
21852
|
-
log.error('error in pause attachment uploading',
|
|
21967
|
+
_t27 = _context19.v;
|
|
21968
|
+
log.error('error in pause attachment uploading', _t27);
|
|
21853
21969
|
case 3:
|
|
21854
21970
|
return _context19.a(2);
|
|
21855
21971
|
}
|
|
21856
21972
|
}, _marked14$1, null, [[0, 2]]);
|
|
21857
21973
|
}
|
|
21858
21974
|
function resumeAttachmentUploading(action) {
|
|
21859
|
-
var attachmentId, isResumed,
|
|
21975
|
+
var attachmentId, isResumed, _t28;
|
|
21860
21976
|
return _regenerator().w(function (_context20) {
|
|
21861
21977
|
while (1) switch (_context20.p = _context20.n) {
|
|
21862
21978
|
case 0:
|
|
@@ -21879,15 +21995,15 @@ function resumeAttachmentUploading(action) {
|
|
|
21879
21995
|
break;
|
|
21880
21996
|
case 2:
|
|
21881
21997
|
_context20.p = 2;
|
|
21882
|
-
|
|
21883
|
-
log.error('error in resume attachment uploading',
|
|
21998
|
+
_t28 = _context20.v;
|
|
21999
|
+
log.error('error in resume attachment uploading', _t28);
|
|
21884
22000
|
case 3:
|
|
21885
22001
|
return _context20.a(2);
|
|
21886
22002
|
}
|
|
21887
22003
|
}, _marked15$1, null, [[0, 2]]);
|
|
21888
22004
|
}
|
|
21889
22005
|
function getMessageMarkers(action) {
|
|
21890
|
-
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers,
|
|
22006
|
+
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers, _t29;
|
|
21891
22007
|
return _regenerator().w(function (_context21) {
|
|
21892
22008
|
while (1) switch (_context21.p = _context21.n) {
|
|
21893
22009
|
case 0:
|
|
@@ -21917,8 +22033,8 @@ function getMessageMarkers(action) {
|
|
|
21917
22033
|
break;
|
|
21918
22034
|
case 5:
|
|
21919
22035
|
_context21.p = 5;
|
|
21920
|
-
|
|
21921
|
-
log.error('error in get message markers',
|
|
22036
|
+
_t29 = _context21.v;
|
|
22037
|
+
log.error('error in get message markers', _t29);
|
|
21922
22038
|
case 6:
|
|
21923
22039
|
_context21.p = 6;
|
|
21924
22040
|
_context21.n = 7;
|
|
@@ -22034,7 +22150,7 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
|
22034
22150
|
}, _marked18$1);
|
|
22035
22151
|
}
|
|
22036
22152
|
function addPollVote(action) {
|
|
22037
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence2, user, vote, pendingAction, conflictCheck, channel, _Object$values, _store$getState$Messa, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj,
|
|
22153
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence2, user, vote, pendingAction, conflictCheck, channel, _Object$values, _store$getState$Messa, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj, _t30;
|
|
22038
22154
|
return _regenerator().w(function (_context24) {
|
|
22039
22155
|
while (1) switch (_context24.p = _context24.n) {
|
|
22040
22156
|
case 0:
|
|
@@ -22126,8 +22242,8 @@ function addPollVote(action) {
|
|
|
22126
22242
|
break;
|
|
22127
22243
|
case 7:
|
|
22128
22244
|
_context24.p = 7;
|
|
22129
|
-
|
|
22130
|
-
log.error('error in add poll vote',
|
|
22245
|
+
_t30 = _context24.v;
|
|
22246
|
+
log.error('error in add poll vote', _t30);
|
|
22131
22247
|
case 8:
|
|
22132
22248
|
return _context24.a(2);
|
|
22133
22249
|
}
|
|
@@ -22211,7 +22327,7 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
|
|
|
22211
22327
|
}, _marked21$1);
|
|
22212
22328
|
}
|
|
22213
22329
|
function deletePollVote(action) {
|
|
22214
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11, vote, pendingAction, conflictCheck, channel, _Object$values2, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj,
|
|
22330
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11, vote, pendingAction, conflictCheck, channel, _Object$values2, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj, _t31;
|
|
22215
22331
|
return _regenerator().w(function (_context27) {
|
|
22216
22332
|
while (1) switch (_context27.p = _context27.n) {
|
|
22217
22333
|
case 0:
|
|
@@ -22289,8 +22405,8 @@ function deletePollVote(action) {
|
|
|
22289
22405
|
break;
|
|
22290
22406
|
case 8:
|
|
22291
22407
|
_context27.p = 8;
|
|
22292
|
-
|
|
22293
|
-
log.error('error in delete poll vote',
|
|
22408
|
+
_t31 = _context27.v;
|
|
22409
|
+
log.error('error in delete poll vote', _t31);
|
|
22294
22410
|
case 9:
|
|
22295
22411
|
return _context27.a(2);
|
|
22296
22412
|
}
|
|
@@ -22368,7 +22484,7 @@ function updateMessageOptimisticallyForClosePoll(channelId, message) {
|
|
|
22368
22484
|
}, _marked24$1);
|
|
22369
22485
|
}
|
|
22370
22486
|
function closePoll(action) {
|
|
22371
|
-
var payload, channelId, pollId, message, sceytChatClient, connectionState,
|
|
22487
|
+
var payload, channelId, pollId, message, sceytChatClient, connectionState, _t32;
|
|
22372
22488
|
return _regenerator().w(function (_context30) {
|
|
22373
22489
|
while (1) switch (_context30.p = _context30.n) {
|
|
22374
22490
|
case 0:
|
|
@@ -22401,8 +22517,8 @@ function closePoll(action) {
|
|
|
22401
22517
|
break;
|
|
22402
22518
|
case 4:
|
|
22403
22519
|
_context30.p = 4;
|
|
22404
|
-
|
|
22405
|
-
log.error('error in close poll',
|
|
22520
|
+
_t32 = _context30.v;
|
|
22521
|
+
log.error('error in close poll', _t32);
|
|
22406
22522
|
case 5:
|
|
22407
22523
|
return _context30.a(2);
|
|
22408
22524
|
}
|
|
@@ -22491,7 +22607,7 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
|
|
|
22491
22607
|
}, _marked27$1);
|
|
22492
22608
|
}
|
|
22493
22609
|
function retractPollVote(action) {
|
|
22494
|
-
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator4, _step4, _message$pollDetails12, _message$pollDetails13, vote,
|
|
22610
|
+
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator4, _step4, _message$pollDetails12, _message$pollDetails13, vote, _t33;
|
|
22495
22611
|
return _regenerator().w(function (_context33) {
|
|
22496
22612
|
while (1) switch (_context33.p = _context33.n) {
|
|
22497
22613
|
case 0:
|
|
@@ -22533,15 +22649,15 @@ function retractPollVote(action) {
|
|
|
22533
22649
|
break;
|
|
22534
22650
|
case 4:
|
|
22535
22651
|
_context33.p = 4;
|
|
22536
|
-
|
|
22537
|
-
log.error('error in retract poll vote',
|
|
22652
|
+
_t33 = _context33.v;
|
|
22653
|
+
log.error('error in retract poll vote', _t33);
|
|
22538
22654
|
case 5:
|
|
22539
22655
|
return _context33.a(2);
|
|
22540
22656
|
}
|
|
22541
22657
|
}, _marked28$1, null, [[0, 4]]);
|
|
22542
22658
|
}
|
|
22543
22659
|
function resendPendingPollActions(action) {
|
|
22544
|
-
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy,
|
|
22660
|
+
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy, _t34;
|
|
22545
22661
|
return _regenerator().w(function (_context34) {
|
|
22546
22662
|
while (1) switch (_context34.p = _context34.n) {
|
|
22547
22663
|
case 0:
|
|
@@ -22590,15 +22706,15 @@ function resendPendingPollActions(action) {
|
|
|
22590
22706
|
break;
|
|
22591
22707
|
case 2:
|
|
22592
22708
|
_context34.p = 2;
|
|
22593
|
-
|
|
22594
|
-
log.error('error in resend pending poll actions',
|
|
22709
|
+
_t34 = _context34.v;
|
|
22710
|
+
log.error('error in resend pending poll actions', _t34);
|
|
22595
22711
|
case 3:
|
|
22596
22712
|
return _context34.a(2);
|
|
22597
22713
|
}
|
|
22598
22714
|
}, _marked29$1, null, [[0, 2]]);
|
|
22599
22715
|
}
|
|
22600
22716
|
function getPollVotes(action) {
|
|
22601
|
-
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes,
|
|
22717
|
+
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes, _t35;
|
|
22602
22718
|
return _regenerator().w(function (_context35) {
|
|
22603
22719
|
while (1) switch (_context35.p = _context35.n) {
|
|
22604
22720
|
case 0:
|
|
@@ -22664,8 +22780,8 @@ function getPollVotes(action) {
|
|
|
22664
22780
|
break;
|
|
22665
22781
|
case 7:
|
|
22666
22782
|
_context35.p = 7;
|
|
22667
|
-
|
|
22668
|
-
log.error('ERROR in get poll votes',
|
|
22783
|
+
_t35 = _context35.v;
|
|
22784
|
+
log.error('ERROR in get poll votes', _t35);
|
|
22669
22785
|
_context35.n = 8;
|
|
22670
22786
|
return effects.put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
22671
22787
|
case 8:
|
|
@@ -22674,7 +22790,7 @@ function getPollVotes(action) {
|
|
|
22674
22790
|
}, _marked30$1, null, [[0, 7]]);
|
|
22675
22791
|
}
|
|
22676
22792
|
function loadMorePollVotes(action) {
|
|
22677
|
-
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes,
|
|
22793
|
+
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes, _t36;
|
|
22678
22794
|
return _regenerator().w(function (_context36) {
|
|
22679
22795
|
while (1) switch (_context36.p = _context36.n) {
|
|
22680
22796
|
case 0:
|
|
@@ -22732,8 +22848,8 @@ function loadMorePollVotes(action) {
|
|
|
22732
22848
|
break;
|
|
22733
22849
|
case 6:
|
|
22734
22850
|
_context36.p = 6;
|
|
22735
|
-
|
|
22736
|
-
log.error('ERROR in load more poll votes',
|
|
22851
|
+
_t36 = _context36.v;
|
|
22852
|
+
log.error('ERROR in load more poll votes', _t36);
|
|
22737
22853
|
_context36.n = 7;
|
|
22738
22854
|
return effects.put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
22739
22855
|
case 7:
|
|
@@ -27875,7 +27991,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
27875
27991
|
loadMoreChannels: handleLoadMoreChannels,
|
|
27876
27992
|
searchValue: searchValue
|
|
27877
27993
|
}, !searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, channels.map(function (channel) {
|
|
27878
|
-
return ListItem ? (/*#__PURE__*/React__default.createElement(ListItem, {
|
|
27994
|
+
return !getPendingDeleteChannel(channel.id) && (ListItem ? (/*#__PURE__*/React__default.createElement(ListItem, {
|
|
27879
27995
|
channel: channel,
|
|
27880
27996
|
setSelectedChannel: setSelectedChannel,
|
|
27881
27997
|
key: channel.id
|
|
@@ -27908,7 +28024,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
27908
28024
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
27909
28025
|
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
27910
28026
|
showPhoneNumber: showPhoneNumber
|
|
27911
|
-
}));
|
|
28027
|
+
})));
|
|
27912
28028
|
}))) : 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
28029
|
color: textSecondary,
|
|
27914
28030
|
fontSize: searchedChannelsTitleFontSize
|
|
@@ -28592,6 +28708,9 @@ var pollVotesLoadingStateSelector = function pollVotesLoadingStateSelector(store
|
|
|
28592
28708
|
var unreadScrollToSelector = function unreadScrollToSelector(store) {
|
|
28593
28709
|
return store.MessageReducer.unreadScrollTo;
|
|
28594
28710
|
};
|
|
28711
|
+
var unreadMessageIdSelector = function unreadMessageIdSelector(store) {
|
|
28712
|
+
return store.MessageReducer.unreadMessageId;
|
|
28713
|
+
};
|
|
28595
28714
|
|
|
28596
28715
|
var _path$v;
|
|
28597
28716
|
function _extends$w() {
|
|
@@ -39146,42 +39265,40 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39146
39265
|
var showScrollToNewMessageButton = useSelector(showScrollToNewMessageButtonSelector, reactRedux.shallowEqual);
|
|
39147
39266
|
var unreadScrollTo = useSelector(unreadScrollToSelector, reactRedux.shallowEqual);
|
|
39148
39267
|
var messages = useSelector(activeChannelMessagesSelector, reactRedux.shallowEqual) || [];
|
|
39149
|
-
var
|
|
39150
|
-
|
|
39151
|
-
|
|
39268
|
+
var unreadMessageId = useSelector(unreadMessageIdSelector, reactRedux.shallowEqual);
|
|
39269
|
+
var _useState2 = React.useState(null),
|
|
39270
|
+
mediaFile = _useState2[0],
|
|
39271
|
+
setMediaFile = _useState2[1];
|
|
39152
39272
|
var _useState3 = React.useState(null),
|
|
39153
|
-
|
|
39154
|
-
|
|
39273
|
+
isDragging = _useState3[0],
|
|
39274
|
+
setIsDragging = _useState3[1];
|
|
39155
39275
|
var _useState4 = React.useState(null),
|
|
39156
|
-
|
|
39157
|
-
|
|
39158
|
-
var _useState5 = React.useState(
|
|
39159
|
-
|
|
39160
|
-
|
|
39276
|
+
showTopDate = _useState4[0],
|
|
39277
|
+
setShowTopDate = _useState4[1];
|
|
39278
|
+
var _useState5 = React.useState(false),
|
|
39279
|
+
stopScrolling = _useState5[0],
|
|
39280
|
+
setStopScrolling = _useState5[1];
|
|
39161
39281
|
var _useState6 = React.useState(false),
|
|
39162
|
-
|
|
39163
|
-
|
|
39164
|
-
var _useState7 = React.useState(false),
|
|
39165
|
-
isScrolling = _useState7[0],
|
|
39166
|
-
setIsScrolling = _useState7[1];
|
|
39282
|
+
isScrolling = _useState6[0],
|
|
39283
|
+
setIsScrolling = _useState6[1];
|
|
39167
39284
|
var hideTopDateTimeout = React.useRef(null);
|
|
39168
|
-
var
|
|
39169
|
-
lastVisibleMessageId =
|
|
39170
|
-
_setLastVisibleMessageId =
|
|
39171
|
-
var
|
|
39172
|
-
scrollToReply =
|
|
39173
|
-
setScrollToReply =
|
|
39174
|
-
var
|
|
39175
|
-
previousScrollTop =
|
|
39176
|
-
setPreviousScrollTop =
|
|
39177
|
-
var
|
|
39178
|
-
shouldPreserveScroll =
|
|
39179
|
-
setShouldPreserveScroll =
|
|
39285
|
+
var _useState7 = React.useState(''),
|
|
39286
|
+
lastVisibleMessageId = _useState7[0],
|
|
39287
|
+
_setLastVisibleMessageId = _useState7[1];
|
|
39288
|
+
var _useState8 = React.useState(null),
|
|
39289
|
+
scrollToReply = _useState8[0],
|
|
39290
|
+
setScrollToReply = _useState8[1];
|
|
39291
|
+
var _useState9 = React.useState(0),
|
|
39292
|
+
previousScrollTop = _useState9[0],
|
|
39293
|
+
setPreviousScrollTop = _useState9[1];
|
|
39294
|
+
var _useState0 = React.useState(false),
|
|
39295
|
+
shouldPreserveScroll = _useState0[0],
|
|
39296
|
+
setShouldPreserveScroll = _useState0[1];
|
|
39180
39297
|
var messageForReply = {};
|
|
39181
39298
|
var attachmentsSelected = false;
|
|
39182
|
-
var
|
|
39183
|
-
topDateLabel =
|
|
39184
|
-
setTopDateLabel =
|
|
39299
|
+
var _useState1 = React.useState(''),
|
|
39300
|
+
topDateLabel = _useState1[0],
|
|
39301
|
+
setTopDateLabel = _useState1[1];
|
|
39185
39302
|
var scrollRef = React.useRef(null);
|
|
39186
39303
|
var loadFromServerRef = React.useRef(false);
|
|
39187
39304
|
var loadDirectionRef = React.useRef('');
|
|
@@ -39516,7 +39633,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39516
39633
|
var visibleMessagesIds = Object.keys(visibleMessages);
|
|
39517
39634
|
var messageId = visibleMessagesIds[visibleMessagesIds.length - 1];
|
|
39518
39635
|
dispatch(getMessagesAC(channel, undefined, messageId, undefined, undefined, 'instant'));
|
|
39519
|
-
|
|
39636
|
+
dispatch(setUnreadMessageIdAC(messageId));
|
|
39520
39637
|
} else {
|
|
39521
39638
|
if (!channel.isLinkedChannel) {
|
|
39522
39639
|
clearVisibleMessagesMap();
|
|
@@ -39526,9 +39643,9 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39526
39643
|
}
|
|
39527
39644
|
if (channel.id) {
|
|
39528
39645
|
if (channel.newMessageCount && channel.newMessageCount > 0) {
|
|
39529
|
-
|
|
39646
|
+
dispatch(setUnreadMessageIdAC(channel.lastDisplayedMessageId));
|
|
39530
39647
|
} else {
|
|
39531
|
-
|
|
39648
|
+
dispatch(setUnreadMessageIdAC(''));
|
|
39532
39649
|
}
|
|
39533
39650
|
}
|
|
39534
39651
|
}
|
|
@@ -39552,7 +39669,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39552
39669
|
if (messages.length > 0 && hiddenMessagesProperties !== null && hiddenMessagesProperties !== void 0 && hiddenMessagesProperties.includes(HiddenMessageProperty.hideAfterSendMessage)) {
|
|
39553
39670
|
var lastMessage = messages[messages.length - 1];
|
|
39554
39671
|
if (lastMessage.user.id === user.id) {
|
|
39555
|
-
|
|
39672
|
+
dispatch(setUnreadMessageIdAC(''));
|
|
39556
39673
|
}
|
|
39557
39674
|
}
|
|
39558
39675
|
}, [messages, hiddenMessagesProperties, user === null || user === void 0 ? void 0 : user.id]);
|
|
@@ -39673,12 +39790,14 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39673
39790
|
React.useEffect(function () {
|
|
39674
39791
|
log.info('connection status is changed.. .... ', connectionStatus, 'channel ... ', channel);
|
|
39675
39792
|
if (connectionStatus === CONNECTION_STATUS.CONNECTED && channel !== null && channel !== void 0 && channel.id) {
|
|
39793
|
+
var _channel$lastMessage4;
|
|
39676
39794
|
loadingRef.current = false;
|
|
39677
39795
|
prevDisableRef.current = false;
|
|
39678
39796
|
nextDisableRef.current = false;
|
|
39679
39797
|
clearMessagesMap();
|
|
39680
39798
|
removeAllMessages();
|
|
39681
|
-
|
|
39799
|
+
var isWithLastVisibleMessageId = lastVisibleMessageId !== ((_channel$lastMessage4 = channel.lastMessage) === null || _channel$lastMessage4 === void 0 ? void 0 : _channel$lastMessage4.id) && lastVisibleMessageId ? lastVisibleMessageId : '';
|
|
39800
|
+
dispatch(getMessagesAC(channel, false, isWithLastVisibleMessageId, 0, false, 'instant', false, true));
|
|
39682
39801
|
}
|
|
39683
39802
|
}, [connectionStatus]);
|
|
39684
39803
|
React.useEffect(function () {
|