sceyt-chat-react-uikit 1.7.8 → 1.7.9-beta.10
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/components/Message/MessageActions/index.d.ts +1 -1
- package/index.js +1393 -1191
- package/index.modern.js +1394 -1192
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -8990,11 +8990,11 @@ var handleVoteDetails = function handleVoteDetails(voteDetails, message) {
|
|
|
8990
8990
|
return undefined;
|
|
8991
8991
|
}
|
|
8992
8992
|
var existingPollDetails = message.pollDetails;
|
|
8993
|
-
var existingVoteDetails = existingPollDetails.voteDetails || {
|
|
8993
|
+
var existingVoteDetails = JSON.parse(JSON.stringify(existingPollDetails.voteDetails || {
|
|
8994
8994
|
votesPerOption: {},
|
|
8995
8995
|
votes: [],
|
|
8996
8996
|
ownVotes: []
|
|
8997
|
-
};
|
|
8997
|
+
}));
|
|
8998
8998
|
if (voteDetails.type === 'close') {
|
|
8999
8999
|
return _extends({}, existingPollDetails, {
|
|
9000
9000
|
closed: true
|
|
@@ -9006,19 +9006,32 @@ var handleVoteDetails = function handleVoteDetails(voteDetails, message) {
|
|
|
9006
9006
|
var vote = voteDetails.vote;
|
|
9007
9007
|
var optionId = vote.optionId;
|
|
9008
9008
|
var currentVotesPerOption = existingVoteDetails.votesPerOption || {};
|
|
9009
|
-
var optionVotesCount =
|
|
9010
|
-
var newVotesPerOption = _extends({}, currentVotesPerOption, (_extends2 = {}, _extends2[optionId] = optionVotesCount >= 0 ? optionVotesCount : 0, _extends2));
|
|
9009
|
+
var optionVotesCount = currentVotesPerOption[optionId] || 0;
|
|
9011
9010
|
var newVotes = existingVoteDetails.votes || [];
|
|
9012
9011
|
var newOwnVotes = existingVoteDetails.ownVotes || [];
|
|
9013
9012
|
if (voteDetails.type === 'add') {
|
|
9014
9013
|
newVotes = [].concat(newVotes, [vote]);
|
|
9014
|
+
optionVotesCount++;
|
|
9015
9015
|
} else if (voteDetails.type === 'delete') {
|
|
9016
9016
|
newVotes = deleteVoteFromPollDetails(newVotes, vote);
|
|
9017
|
+
optionVotesCount--;
|
|
9017
9018
|
} else if (voteDetails.type === 'addOwn') {
|
|
9018
|
-
|
|
9019
|
+
var existingOwnVote = existingVoteDetails.ownVotes.find(function (v) {
|
|
9020
|
+
return v.optionId === vote.optionId && v.user.id === vote.user.id;
|
|
9021
|
+
});
|
|
9022
|
+
if (!existingOwnVote) {
|
|
9023
|
+
optionVotesCount++;
|
|
9024
|
+
if (existingPollDetails.allowMultipleVotes) {
|
|
9025
|
+
newOwnVotes = [].concat(newOwnVotes, [vote]);
|
|
9026
|
+
} else {
|
|
9027
|
+
newOwnVotes = [vote];
|
|
9028
|
+
}
|
|
9029
|
+
}
|
|
9019
9030
|
} else if (voteDetails.type === 'deleteOwn') {
|
|
9020
9031
|
newOwnVotes = deleteVoteFromPollDetails(newOwnVotes, vote);
|
|
9032
|
+
optionVotesCount--;
|
|
9021
9033
|
}
|
|
9034
|
+
var newVotesPerOption = _extends({}, currentVotesPerOption, (_extends2 = {}, _extends2[optionId] = optionVotesCount >= 0 ? optionVotesCount : 0, _extends2));
|
|
9022
9035
|
var newVoteDetails = {
|
|
9023
9036
|
votesPerOption: newVotesPerOption,
|
|
9024
9037
|
votes: newVotes,
|
|
@@ -9059,6 +9072,8 @@ var baseUrlForInviteMembers = '';
|
|
|
9059
9072
|
var autoSelectFitsChannel = false;
|
|
9060
9073
|
var allChannels = [];
|
|
9061
9074
|
var channelsMap = {};
|
|
9075
|
+
var allChannelsMap = {};
|
|
9076
|
+
var pendingDeleteChannelMap = {};
|
|
9062
9077
|
var channelTypesMemberDisplayTextMap;
|
|
9063
9078
|
var defaultRolesByChannelTypesMap;
|
|
9064
9079
|
var activeChannelId = '';
|
|
@@ -9091,6 +9106,7 @@ function getInviteLinkOptions() {
|
|
|
9091
9106
|
}
|
|
9092
9107
|
function setChannelInMap(channel) {
|
|
9093
9108
|
channelsMap[channel.id] = _extends({}, channel);
|
|
9109
|
+
allChannelsMap[channel.id] = _extends({}, channel);
|
|
9094
9110
|
}
|
|
9095
9111
|
function setActiveChannelId(id) {
|
|
9096
9112
|
activeChannelId = id;
|
|
@@ -9106,6 +9122,7 @@ function setChannelsInMap(channels) {
|
|
|
9106
9122
|
channelsForUpdateLastReactionMessage.push(channel);
|
|
9107
9123
|
}
|
|
9108
9124
|
channelsMap[channel.id] = _extends({}, channel);
|
|
9125
|
+
allChannelsMap[channel.id] = _extends({}, channel);
|
|
9109
9126
|
return channel;
|
|
9110
9127
|
});
|
|
9111
9128
|
return {
|
|
@@ -9116,11 +9133,24 @@ function setChannelsInMap(channels) {
|
|
|
9116
9133
|
function getChannelFromMap(channelId) {
|
|
9117
9134
|
return channelsMap[channelId];
|
|
9118
9135
|
}
|
|
9119
|
-
function getLastChannelFromMap() {
|
|
9120
|
-
|
|
9136
|
+
function getLastChannelFromMap(deletePending) {
|
|
9137
|
+
if (deletePending === void 0) {
|
|
9138
|
+
deletePending = false;
|
|
9139
|
+
}
|
|
9140
|
+
var channels = Object.values(channelsMap);
|
|
9141
|
+
if (deletePending) {
|
|
9142
|
+
for (var _iterator = _createForOfIteratorHelperLoose(channels), _step; !(_step = _iterator()).done;) {
|
|
9143
|
+
var channel = _step.value;
|
|
9144
|
+
if (!getPendingDeleteChannel(channel.id)) {
|
|
9145
|
+
return channel;
|
|
9146
|
+
}
|
|
9147
|
+
}
|
|
9148
|
+
}
|
|
9149
|
+
return channels[0];
|
|
9121
9150
|
}
|
|
9122
9151
|
function removeChannelFromMap(channelId) {
|
|
9123
9152
|
delete channelsMap[channelId];
|
|
9153
|
+
delete allChannelsMap[channelId];
|
|
9124
9154
|
}
|
|
9125
9155
|
function checkChannelExists(channelId) {
|
|
9126
9156
|
return !!channelsMap[channelId];
|
|
@@ -9207,6 +9237,9 @@ function getChannelFromAllChannels(channelId) {
|
|
|
9207
9237
|
return channel.id === channelId;
|
|
9208
9238
|
});
|
|
9209
9239
|
}
|
|
9240
|
+
function getChannelFromAllChannelsMap(channelId) {
|
|
9241
|
+
return allChannelsMap[channelId];
|
|
9242
|
+
}
|
|
9210
9243
|
function deleteChannelFromAllChannels(channelId) {
|
|
9211
9244
|
allChannels = allChannels.filter(function (channel) {
|
|
9212
9245
|
return channel.id !== channelId;
|
|
@@ -9224,6 +9257,9 @@ function updateChannelLastMessageOnAllChannels(channelId, message) {
|
|
|
9224
9257
|
channelsMap[channelId] = _extends({}, chan, {
|
|
9225
9258
|
lastMessage: message
|
|
9226
9259
|
});
|
|
9260
|
+
allChannelsMap[channelId] = _extends({}, chan, {
|
|
9261
|
+
lastMessage: message
|
|
9262
|
+
});
|
|
9227
9263
|
return _extends({}, chan, {
|
|
9228
9264
|
lastMessage: message
|
|
9229
9265
|
});
|
|
@@ -9246,6 +9282,7 @@ function updateChannelLastMessageOnAllChannels(channelId, message) {
|
|
|
9246
9282
|
lastMessage: updateMessage
|
|
9247
9283
|
});
|
|
9248
9284
|
channelsMap[channelId] = updateChannel;
|
|
9285
|
+
allChannelsMap[channelId] = updateChannel;
|
|
9249
9286
|
allChannels = [updateChannel].concat(updatedChannels);
|
|
9250
9287
|
}
|
|
9251
9288
|
}
|
|
@@ -9268,6 +9305,7 @@ function updateChannelOnAllChannels(channelId, config, messageUpdateData) {
|
|
|
9268
9305
|
});
|
|
9269
9306
|
if (channelsMap[channelId]) {
|
|
9270
9307
|
channelsMap[channelId] = _extends({}, channelsMap[channelId], config);
|
|
9308
|
+
allChannelsMap[channelId] = _extends({}, channelsMap[channelId], config);
|
|
9271
9309
|
}
|
|
9272
9310
|
}
|
|
9273
9311
|
var getChannelGroupName = function getChannelGroupName(channel) {
|
|
@@ -9316,6 +9354,18 @@ var sortChannelByLastMessage = function sortChannelByLastMessage(channels) {
|
|
|
9316
9354
|
}
|
|
9317
9355
|
});
|
|
9318
9356
|
};
|
|
9357
|
+
var setPendingDeleteChannel = function setPendingDeleteChannel(channel) {
|
|
9358
|
+
pendingDeleteChannelMap[channel === null || channel === void 0 ? void 0 : channel.id] = channel;
|
|
9359
|
+
};
|
|
9360
|
+
var getPendingDeleteChannel = function getPendingDeleteChannel(channelId) {
|
|
9361
|
+
return pendingDeleteChannelMap[channelId];
|
|
9362
|
+
};
|
|
9363
|
+
var getPendingDeleteChannels = function getPendingDeleteChannels() {
|
|
9364
|
+
return Object.values(pendingDeleteChannelMap);
|
|
9365
|
+
};
|
|
9366
|
+
var removePendingDeleteChannel = function removePendingDeleteChannel(channelId) {
|
|
9367
|
+
delete pendingDeleteChannelMap[channelId];
|
|
9368
|
+
};
|
|
9319
9369
|
|
|
9320
9370
|
var initialState = {
|
|
9321
9371
|
channelsLoadingState: null,
|
|
@@ -9374,7 +9424,7 @@ var channelSlice = createSlice({
|
|
|
9374
9424
|
}
|
|
9375
9425
|
},
|
|
9376
9426
|
setChannels: function setChannels(state, action) {
|
|
9377
|
-
state.channels = [].concat(action.payload.channels);
|
|
9427
|
+
state.channels = sortChannelByLastMessage([].concat(action.payload.channels));
|
|
9378
9428
|
},
|
|
9379
9429
|
setSearchedChannels: function setSearchedChannels(state, action) {
|
|
9380
9430
|
state.searchedChannels = action.payload.searchedChannels;
|
|
@@ -9547,7 +9597,7 @@ var channelSlice = createSlice({
|
|
|
9547
9597
|
})
|
|
9548
9598
|
});
|
|
9549
9599
|
}
|
|
9550
|
-
state.channels = [].concat(updatedChannels);
|
|
9600
|
+
state.channels = sortChannelByLastMessage([].concat(updatedChannels));
|
|
9551
9601
|
},
|
|
9552
9602
|
updateChannelLastMessage: function updateChannelLastMessage(state, action) {
|
|
9553
9603
|
var _action$payload5 = action.payload,
|
|
@@ -9567,6 +9617,7 @@ var channelSlice = createSlice({
|
|
|
9567
9617
|
}
|
|
9568
9618
|
return chan;
|
|
9569
9619
|
});
|
|
9620
|
+
state.channels = sortChannelByLastMessage(state.channels);
|
|
9570
9621
|
}
|
|
9571
9622
|
} else {
|
|
9572
9623
|
var updatedChannels = state.channels.filter(function (chan) {
|
|
@@ -9596,6 +9647,7 @@ var channelSlice = createSlice({
|
|
|
9596
9647
|
}
|
|
9597
9648
|
return chan;
|
|
9598
9649
|
});
|
|
9650
|
+
state.channels = sortChannelByLastMessage(state.channels);
|
|
9599
9651
|
},
|
|
9600
9652
|
setChannelInfoOpenClose: function setChannelInfoOpenClose(state, action) {
|
|
9601
9653
|
state.channelInfoIsOpen = action.payload.open;
|
|
@@ -10810,6 +10862,11 @@ function updatePendingMessageAC(channelId, messageId, updatedMessage) {
|
|
|
10810
10862
|
updatedMessage: updatedMessage
|
|
10811
10863
|
});
|
|
10812
10864
|
}
|
|
10865
|
+
function setUnreadMessageIdAC(messageId) {
|
|
10866
|
+
return setUnreadMessageId({
|
|
10867
|
+
messageId: messageId
|
|
10868
|
+
});
|
|
10869
|
+
}
|
|
10813
10870
|
|
|
10814
10871
|
var MESSAGES_MAX_PAGE_COUNT = 80;
|
|
10815
10872
|
var MESSAGES_MAX_LENGTH = 50;
|
|
@@ -11000,6 +11057,9 @@ function setMessagesToMap(channelId, messages, firstMessageId, lastMessageId) {
|
|
|
11000
11057
|
}
|
|
11001
11058
|
}
|
|
11002
11059
|
messages.forEach(function (msg) {
|
|
11060
|
+
if (msg.tid && messagesMap[channelId][msg.tid]) {
|
|
11061
|
+
delete messagesMap[channelId][msg.tid];
|
|
11062
|
+
}
|
|
11003
11063
|
messagesMap[channelId][msg.id || msg.tid] = msg;
|
|
11004
11064
|
});
|
|
11005
11065
|
}
|
|
@@ -11327,6 +11387,31 @@ var setPendingPollAction = function setPendingPollAction(action) {
|
|
|
11327
11387
|
}
|
|
11328
11388
|
store.dispatch(setPendingPollActionsMapAC(messageId, action));
|
|
11329
11389
|
};
|
|
11390
|
+
var getCenterTwoMessages = function getCenterTwoMessages(messages) {
|
|
11391
|
+
var mid = Math.floor(messages.length / 2);
|
|
11392
|
+
if (messages.length % 2 === 0) {
|
|
11393
|
+
return {
|
|
11394
|
+
mid1: {
|
|
11395
|
+
messageId: messages[mid - 1].id,
|
|
11396
|
+
index: mid - 1
|
|
11397
|
+
},
|
|
11398
|
+
mid2: {
|
|
11399
|
+
messageId: messages[mid].id,
|
|
11400
|
+
index: mid
|
|
11401
|
+
}
|
|
11402
|
+
};
|
|
11403
|
+
}
|
|
11404
|
+
return {
|
|
11405
|
+
mid1: {
|
|
11406
|
+
messageId: messages[mid - 1].id,
|
|
11407
|
+
index: mid - 1
|
|
11408
|
+
},
|
|
11409
|
+
mid2: {
|
|
11410
|
+
messageId: messages[mid + 1].id,
|
|
11411
|
+
index: mid + 1
|
|
11412
|
+
}
|
|
11413
|
+
};
|
|
11414
|
+
};
|
|
11330
11415
|
|
|
11331
11416
|
var initialState$1 = {
|
|
11332
11417
|
messagesLoadingState: null,
|
|
@@ -11373,7 +11458,8 @@ var initialState$1 = {
|
|
|
11373
11458
|
pollVotesInitialCount: null,
|
|
11374
11459
|
pendingPollActions: {},
|
|
11375
11460
|
pendingMessagesMap: {},
|
|
11376
|
-
unreadScrollTo: true
|
|
11461
|
+
unreadScrollTo: true,
|
|
11462
|
+
unreadMessageId: ''
|
|
11377
11463
|
};
|
|
11378
11464
|
var messageSlice = createSlice({
|
|
11379
11465
|
name: 'messages',
|
|
@@ -11949,6 +12035,9 @@ var messageSlice = createSlice({
|
|
|
11949
12035
|
},
|
|
11950
12036
|
clearPendingMessagesMap: function clearPendingMessagesMap(state) {
|
|
11951
12037
|
state.pendingMessagesMap = {};
|
|
12038
|
+
},
|
|
12039
|
+
setUnreadMessageId: function setUnreadMessageId(state, action) {
|
|
12040
|
+
state.unreadMessageId = action.payload.messageId;
|
|
11952
12041
|
}
|
|
11953
12042
|
},
|
|
11954
12043
|
extraReducers: function extraReducers(builder) {
|
|
@@ -12013,7 +12102,8 @@ var _messageSlice$actions = messageSlice.actions,
|
|
|
12013
12102
|
setPendingMessage$1 = _messageSlice$actions.setPendingMessage,
|
|
12014
12103
|
removePendingMessage = _messageSlice$actions.removePendingMessage,
|
|
12015
12104
|
updatePendingMessage = _messageSlice$actions.updatePendingMessage,
|
|
12016
|
-
updatePendingPollAction = _messageSlice$actions.updatePendingPollAction
|
|
12105
|
+
updatePendingPollAction = _messageSlice$actions.updatePendingPollAction,
|
|
12106
|
+
setUnreadMessageId = _messageSlice$actions.setUnreadMessageId;
|
|
12017
12107
|
var MessageReducer = messageSlice.reducer;
|
|
12018
12108
|
|
|
12019
12109
|
var initialState$2 = {
|
|
@@ -15727,16 +15817,14 @@ function watchForEvents() {
|
|
|
15727
15817
|
vote = _step2.value;
|
|
15728
15818
|
objs.push({
|
|
15729
15819
|
type: vote.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15730
|
-
vote: vote
|
|
15731
|
-
incrementVotesPerOptionCount: -1
|
|
15820
|
+
vote: vote
|
|
15732
15821
|
});
|
|
15733
15822
|
}
|
|
15734
15823
|
for (_iterator3 = _createForOfIteratorHelperLoose(addedVotes); !(_step3 = _iterator3()).done;) {
|
|
15735
15824
|
_vote = _step3.value;
|
|
15736
15825
|
objs.push({
|
|
15737
15826
|
type: _vote.user.id === SceytChatClient.user.id ? 'addOwn' : 'add',
|
|
15738
|
-
vote: _vote
|
|
15739
|
-
incrementVotesPerOptionCount: 1
|
|
15827
|
+
vote: _vote
|
|
15740
15828
|
});
|
|
15741
15829
|
}
|
|
15742
15830
|
_i = 0, _objs = objs;
|
|
@@ -15781,8 +15869,7 @@ function watchForEvents() {
|
|
|
15781
15869
|
params: {}
|
|
15782
15870
|
}, {
|
|
15783
15871
|
type: _obj.type,
|
|
15784
|
-
vote: _obj.vote
|
|
15785
|
-
incrementVotesPerOptionCount: _obj.incrementVotesPerOptionCount
|
|
15872
|
+
vote: _obj.vote
|
|
15786
15873
|
});
|
|
15787
15874
|
if (!(_channel10.id === _activeChannelId0)) {
|
|
15788
15875
|
_context.n = 107;
|
|
@@ -15811,8 +15898,7 @@ function watchForEvents() {
|
|
|
15811
15898
|
_vote2 = _step4.value;
|
|
15812
15899
|
_objs3.push({
|
|
15813
15900
|
type: _vote2.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15814
|
-
vote: _vote2
|
|
15815
|
-
incrementVotesPerOptionCount: -1
|
|
15901
|
+
vote: _vote2
|
|
15816
15902
|
});
|
|
15817
15903
|
}
|
|
15818
15904
|
_i3 = 0, _objs4 = _objs3;
|
|
@@ -15871,8 +15957,7 @@ function watchForEvents() {
|
|
|
15871
15957
|
_vote4 = _step5.value;
|
|
15872
15958
|
_objs6.push({
|
|
15873
15959
|
type: _vote4.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15874
|
-
vote: _vote4
|
|
15875
|
-
incrementVotesPerOptionCount: -1
|
|
15960
|
+
vote: _vote4
|
|
15876
15961
|
});
|
|
15877
15962
|
}
|
|
15878
15963
|
_i5 = 0, _objs7 = _objs6;
|
|
@@ -15924,8 +16009,7 @@ function watchForEvents() {
|
|
|
15924
16009
|
case 126:
|
|
15925
16010
|
_activeChannelId11 = _context.v;
|
|
15926
16011
|
_obj5 = {
|
|
15927
|
-
type: 'close'
|
|
15928
|
-
incrementVotesPerOptionCount: 0
|
|
16012
|
+
type: 'close'
|
|
15929
16013
|
};
|
|
15930
16014
|
updateMessageOnMap(_channel13.id, {
|
|
15931
16015
|
messageId: _messageId4,
|
|
@@ -16303,6 +16387,56 @@ function watchForEvents() {
|
|
|
16303
16387
|
}, _marked$1);
|
|
16304
16388
|
}
|
|
16305
16389
|
|
|
16390
|
+
var SDKErrorTypeEnum = {
|
|
16391
|
+
BadRequest: {
|
|
16392
|
+
value: 'BadRequest',
|
|
16393
|
+
isResendable: false
|
|
16394
|
+
},
|
|
16395
|
+
BadParam: {
|
|
16396
|
+
value: 'BadParam',
|
|
16397
|
+
isResendable: false
|
|
16398
|
+
},
|
|
16399
|
+
NotFound: {
|
|
16400
|
+
value: 'NotFound',
|
|
16401
|
+
isResendable: false
|
|
16402
|
+
},
|
|
16403
|
+
NotAllowed: {
|
|
16404
|
+
value: 'NotAllowed',
|
|
16405
|
+
isResendable: false
|
|
16406
|
+
},
|
|
16407
|
+
TooLargeRequest: {
|
|
16408
|
+
value: 'TooLargeRequest',
|
|
16409
|
+
isResendable: false
|
|
16410
|
+
},
|
|
16411
|
+
InternalError: {
|
|
16412
|
+
value: 'InternalError',
|
|
16413
|
+
isResendable: true
|
|
16414
|
+
},
|
|
16415
|
+
TooManyRequests: {
|
|
16416
|
+
value: 'TooManyRequests',
|
|
16417
|
+
isResendable: true
|
|
16418
|
+
},
|
|
16419
|
+
Authentication: {
|
|
16420
|
+
value: 'Authentication',
|
|
16421
|
+
isResendable: true
|
|
16422
|
+
}
|
|
16423
|
+
};
|
|
16424
|
+
var fromValue = function fromValue(value) {
|
|
16425
|
+
if (!value) return null;
|
|
16426
|
+
var entries = Object.values(SDKErrorTypeEnum);
|
|
16427
|
+
return entries.find(function (entry) {
|
|
16428
|
+
return entry.value === value;
|
|
16429
|
+
}) || null;
|
|
16430
|
+
};
|
|
16431
|
+
var isResendableError = function isResendableError(value) {
|
|
16432
|
+
var _errorType$isResendab;
|
|
16433
|
+
if (!value) {
|
|
16434
|
+
return true;
|
|
16435
|
+
}
|
|
16436
|
+
var errorType = fromValue(value);
|
|
16437
|
+
return (_errorType$isResendab = errorType === null || errorType === void 0 ? void 0 : errorType.isResendable) != null ? _errorType$isResendab : true;
|
|
16438
|
+
};
|
|
16439
|
+
|
|
16306
16440
|
var _marked$2 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
16307
16441
|
_marked2$1 = /*#__PURE__*/_regenerator().m(getChannels),
|
|
16308
16442
|
_marked3 = /*#__PURE__*/_regenerator().m(searchChannels),
|
|
@@ -16323,28 +16457,29 @@ var _marked$2 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
|
16323
16457
|
_marked16 = /*#__PURE__*/_regenerator().m(unpinChannel),
|
|
16324
16458
|
_marked17 = /*#__PURE__*/_regenerator().m(removeChannelCaches),
|
|
16325
16459
|
_marked18 = /*#__PURE__*/_regenerator().m(leaveChannel),
|
|
16326
|
-
_marked19 = /*#__PURE__*/_regenerator().m(
|
|
16327
|
-
_marked20 = /*#__PURE__*/_regenerator().m(
|
|
16328
|
-
_marked21 = /*#__PURE__*/_regenerator().m(
|
|
16329
|
-
_marked22 = /*#__PURE__*/_regenerator().m(
|
|
16330
|
-
_marked23 = /*#__PURE__*/_regenerator().m(
|
|
16331
|
-
_marked24 = /*#__PURE__*/_regenerator().m(
|
|
16332
|
-
_marked25 = /*#__PURE__*/_regenerator().m(
|
|
16333
|
-
_marked26 = /*#__PURE__*/_regenerator().m(
|
|
16334
|
-
_marked27 = /*#__PURE__*/_regenerator().m(
|
|
16335
|
-
_marked28 = /*#__PURE__*/_regenerator().m(
|
|
16336
|
-
_marked29 = /*#__PURE__*/_regenerator().m(
|
|
16337
|
-
_marked30 = /*#__PURE__*/_regenerator().m(
|
|
16338
|
-
_marked31 = /*#__PURE__*/_regenerator().m(
|
|
16339
|
-
_marked32 = /*#__PURE__*/_regenerator().m(
|
|
16340
|
-
_marked33 = /*#__PURE__*/_regenerator().m(
|
|
16341
|
-
_marked34 = /*#__PURE__*/_regenerator().m(
|
|
16342
|
-
_marked35 = /*#__PURE__*/_regenerator().m(
|
|
16343
|
-
_marked36 = /*#__PURE__*/_regenerator().m(
|
|
16344
|
-
_marked37 = /*#__PURE__*/_regenerator().m(
|
|
16345
|
-
_marked38 = /*#__PURE__*/_regenerator().m(
|
|
16460
|
+
_marked19 = /*#__PURE__*/_regenerator().m(deletePendingDeleteChannels),
|
|
16461
|
+
_marked20 = /*#__PURE__*/_regenerator().m(deleteChannel),
|
|
16462
|
+
_marked21 = /*#__PURE__*/_regenerator().m(blockChannel),
|
|
16463
|
+
_marked22 = /*#__PURE__*/_regenerator().m(updateChannel),
|
|
16464
|
+
_marked23 = /*#__PURE__*/_regenerator().m(checkUsersStatus),
|
|
16465
|
+
_marked24 = /*#__PURE__*/_regenerator().m(sendTyping),
|
|
16466
|
+
_marked25 = /*#__PURE__*/_regenerator().m(sendRecording),
|
|
16467
|
+
_marked26 = /*#__PURE__*/_regenerator().m(clearHistory),
|
|
16468
|
+
_marked27 = /*#__PURE__*/_regenerator().m(deleteAllMessages),
|
|
16469
|
+
_marked28 = /*#__PURE__*/_regenerator().m(joinChannel),
|
|
16470
|
+
_marked29 = /*#__PURE__*/_regenerator().m(watchForChannelEvents),
|
|
16471
|
+
_marked30 = /*#__PURE__*/_regenerator().m(createChannelInviteKey),
|
|
16472
|
+
_marked31 = /*#__PURE__*/_regenerator().m(getChannelInviteKeys),
|
|
16473
|
+
_marked32 = /*#__PURE__*/_regenerator().m(regenerateChannelInviteKey),
|
|
16474
|
+
_marked33 = /*#__PURE__*/_regenerator().m(updateChannelInviteKey),
|
|
16475
|
+
_marked34 = /*#__PURE__*/_regenerator().m(getChannelByInviteKey),
|
|
16476
|
+
_marked35 = /*#__PURE__*/_regenerator().m(joinChannelWithInviteKey),
|
|
16477
|
+
_marked36 = /*#__PURE__*/_regenerator().m(setMessageRetentionPeriod),
|
|
16478
|
+
_marked37 = /*#__PURE__*/_regenerator().m(getChannelsWithUser),
|
|
16479
|
+
_marked38 = /*#__PURE__*/_regenerator().m(loadMoreMutualChannels),
|
|
16480
|
+
_marked39 = /*#__PURE__*/_regenerator().m(ChannelsSaga);
|
|
16346
16481
|
function createChannel(action) {
|
|
16347
|
-
var payload, channelData, dontCreateIfNotExists, callback, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, checkChannelExist, messageToSend, _allChannels, _memberId, _t;
|
|
16482
|
+
var payload, channelData, dontCreateIfNotExists, callback, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, whoDoesNotAdded, checkChannelExist, messageToSend, _allChannels, _memberId, _t;
|
|
16348
16483
|
return _regenerator().w(function (_context) {
|
|
16349
16484
|
while (1) switch (_context.p = _context.n) {
|
|
16350
16485
|
case 0:
|
|
@@ -16436,26 +16571,38 @@ function createChannel(action) {
|
|
|
16436
16571
|
case 7:
|
|
16437
16572
|
createdChannel = _context.v;
|
|
16438
16573
|
case 8:
|
|
16574
|
+
whoDoesNotAdded = channelData.members.filter(function (mem) {
|
|
16575
|
+
return !createdChannel.members.some(function (addedMem) {
|
|
16576
|
+
return addedMem.id === mem.id;
|
|
16577
|
+
});
|
|
16578
|
+
});
|
|
16579
|
+
if (!whoDoesNotAdded.length) {
|
|
16580
|
+
_context.n = 9;
|
|
16581
|
+
break;
|
|
16582
|
+
}
|
|
16583
|
+
_context.n = 9;
|
|
16584
|
+
return effects.put(setActionIsRestrictedAC(true, false, whoDoesNotAdded));
|
|
16585
|
+
case 9:
|
|
16439
16586
|
checkChannelExist = false;
|
|
16440
16587
|
if (!(createdChannel.type === DEFAULT_CHANNEL_TYPE.DIRECT)) {
|
|
16441
|
-
_context.n =
|
|
16588
|
+
_context.n = 11;
|
|
16442
16589
|
break;
|
|
16443
16590
|
}
|
|
16444
|
-
_context.n =
|
|
16591
|
+
_context.n = 10;
|
|
16445
16592
|
return effects.call(checkChannelExists, createdChannel.id);
|
|
16446
|
-
case 9:
|
|
16447
|
-
checkChannelExist = _context.v;
|
|
16448
16593
|
case 10:
|
|
16594
|
+
checkChannelExist = _context.v;
|
|
16595
|
+
case 11:
|
|
16449
16596
|
createdChannel.metadata = isJSON(createdChannel.metadata) ? JSON.parse(createdChannel.metadata) : createdChannel.metadata;
|
|
16450
16597
|
if (checkChannelExist) {
|
|
16451
|
-
_context.n =
|
|
16598
|
+
_context.n = 14;
|
|
16452
16599
|
break;
|
|
16453
16600
|
}
|
|
16454
|
-
_context.n =
|
|
16601
|
+
_context.n = 12;
|
|
16455
16602
|
return effects.call(setChannelInMap, createdChannel);
|
|
16456
|
-
case
|
|
16603
|
+
case 12:
|
|
16457
16604
|
if (!(createdChannel.type !== DEFAULT_CHANNEL_TYPE.DIRECT)) {
|
|
16458
|
-
_context.n =
|
|
16605
|
+
_context.n = 13;
|
|
16459
16606
|
break;
|
|
16460
16607
|
}
|
|
16461
16608
|
messageToSend = {
|
|
@@ -16464,21 +16611,21 @@ function createChannel(action) {
|
|
|
16464
16611
|
attachments: [],
|
|
16465
16612
|
type: 'system'
|
|
16466
16613
|
};
|
|
16467
|
-
_context.n =
|
|
16614
|
+
_context.n = 13;
|
|
16468
16615
|
return effects.put(sendTextMessageAC(messageToSend, createdChannel.id, CONNECTION_STATUS.CONNECTED));
|
|
16469
|
-
case
|
|
16616
|
+
case 13:
|
|
16470
16617
|
if (!(!dontCreateIfNotExists || channelIsExistOnAllChannels)) {
|
|
16471
|
-
_context.n =
|
|
16618
|
+
_context.n = 14;
|
|
16472
16619
|
break;
|
|
16473
16620
|
}
|
|
16474
|
-
_context.n = 13;
|
|
16475
|
-
return effects.put(setChannelToAddAC(JSON.parse(JSON.stringify(createdChannel))));
|
|
16476
|
-
case 13:
|
|
16477
16621
|
_context.n = 14;
|
|
16622
|
+
return effects.put(setChannelToAddAC(JSON.parse(JSON.stringify(createdChannel))));
|
|
16623
|
+
case 14:
|
|
16624
|
+
_context.n = 15;
|
|
16478
16625
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(_extends({}, createdChannel, {
|
|
16479
16626
|
isLinkedChannel: dontCreateIfNotExists
|
|
16480
16627
|
}))), !callback));
|
|
16481
|
-
case
|
|
16628
|
+
case 15:
|
|
16482
16629
|
if (dontCreateIfNotExists) {
|
|
16483
16630
|
if (!channelIsExistOnAllChannels) {
|
|
16484
16631
|
addChannelToAllChannels(createdChannel);
|
|
@@ -16508,60 +16655,56 @@ function createChannel(action) {
|
|
|
16508
16655
|
}
|
|
16509
16656
|
}
|
|
16510
16657
|
if (!callback) {
|
|
16511
|
-
_context.n =
|
|
16658
|
+
_context.n = 16;
|
|
16512
16659
|
break;
|
|
16513
16660
|
}
|
|
16514
16661
|
callback(createdChannel);
|
|
16515
|
-
_context.n =
|
|
16662
|
+
_context.n = 17;
|
|
16516
16663
|
break;
|
|
16517
|
-
case 15:
|
|
16518
|
-
_context.n = 16;
|
|
16519
|
-
return effects.call(setActiveChannelId, createdChannel.id);
|
|
16520
16664
|
case 16:
|
|
16665
|
+
_context.n = 17;
|
|
16666
|
+
return effects.call(setActiveChannelId, createdChannel.id);
|
|
16667
|
+
case 17:
|
|
16521
16668
|
_context.n = 19;
|
|
16522
16669
|
break;
|
|
16523
|
-
case 17:
|
|
16524
|
-
_context.p = 17;
|
|
16525
|
-
_t = _context.v;
|
|
16526
|
-
if (!(_t.code === 1041)) {
|
|
16527
|
-
_context.n = 18;
|
|
16528
|
-
break;
|
|
16529
|
-
}
|
|
16530
|
-
_context.n = 18;
|
|
16531
|
-
return effects.put(setActionIsRestrictedAC(true, false, null));
|
|
16532
16670
|
case 18:
|
|
16671
|
+
_context.p = 18;
|
|
16672
|
+
_t = _context.v;
|
|
16533
16673
|
log.error(_t, 'Error on create channel');
|
|
16534
16674
|
case 19:
|
|
16535
16675
|
return _context.a(2);
|
|
16536
16676
|
}
|
|
16537
|
-
}, _marked$2, null, [[0,
|
|
16677
|
+
}, _marked$2, null, [[0, 18]]);
|
|
16538
16678
|
}
|
|
16539
16679
|
function getChannels(action) {
|
|
16540
|
-
var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys, _mappedChannels2, channelMessageMap, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, _connectionStatus, allChannelsData, allChannelList, _t2, _t3, _t4;
|
|
16680
|
+
var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys, _Object$keys2, _mappedChannels2, channelMessageMap, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, _connectionStatus, allChannelsData, allChannelList, _t2, _t3, _t4;
|
|
16541
16681
|
return _regenerator().w(function (_context2) {
|
|
16542
16682
|
while (1) switch (_context2.p = _context2.n) {
|
|
16543
16683
|
case 0:
|
|
16544
|
-
log.info(
|
|
16684
|
+
log.info(new Date().toISOString() + " [getChannels] start get channels");
|
|
16545
16685
|
_context2.p = 1;
|
|
16546
16686
|
payload = action.payload;
|
|
16547
16687
|
params = payload.params;
|
|
16548
|
-
|
|
16688
|
+
_context2.n = 2;
|
|
16689
|
+
return effects.call(deletePendingDeleteChannels);
|
|
16690
|
+
case 2:
|
|
16691
|
+
log.info(new Date().toISOString() + " [getChannels] input params: " + JSON.stringify(params));
|
|
16549
16692
|
SceytChatClient = getClient();
|
|
16550
16693
|
connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
16551
|
-
log.info(
|
|
16694
|
+
log.info(new Date().toISOString() + " [getChannels] connection status: " + connectionStatus);
|
|
16552
16695
|
if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
16553
|
-
_context2.n =
|
|
16696
|
+
_context2.n = 3;
|
|
16554
16697
|
break;
|
|
16555
16698
|
}
|
|
16556
|
-
log.warn(
|
|
16699
|
+
log.warn(new Date().toISOString() + " [getChannels] connection not ready, aborting. Status: " + connectionStatus);
|
|
16557
16700
|
return _context2.a(2);
|
|
16558
|
-
case 2:
|
|
16559
|
-
_context2.n = 3;
|
|
16560
|
-
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
16561
16701
|
case 3:
|
|
16702
|
+
_context2.n = 4;
|
|
16703
|
+
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
16704
|
+
case 4:
|
|
16562
16705
|
channelQueryBuilder = new SceytChatClient.ChannelListQueryBuilder();
|
|
16563
16706
|
channelTypesFilter = getChannelTypesFilter();
|
|
16564
|
-
log.info(
|
|
16707
|
+
log.info(new Date().toISOString() + " [getChannels] channelTypesFilter: " + JSON.stringify(channelTypesFilter));
|
|
16565
16708
|
types = [];
|
|
16566
16709
|
if (channelTypesFilter !== null && channelTypesFilter !== void 0 && channelTypesFilter.length) {
|
|
16567
16710
|
types = channelTypesFilter;
|
|
@@ -16569,77 +16712,77 @@ function getChannels(action) {
|
|
|
16569
16712
|
if (params !== null && params !== void 0 && (_params$filter = params.filter) !== null && _params$filter !== void 0 && _params$filter.channelType) {
|
|
16570
16713
|
types.push(params.filter.channelType);
|
|
16571
16714
|
}
|
|
16572
|
-
log.info(
|
|
16715
|
+
log.info(new Date().toISOString() + " [getChannels] final types array: " + JSON.stringify(types));
|
|
16573
16716
|
if ((_types = types) !== null && _types !== void 0 && _types.length) {
|
|
16574
16717
|
channelQueryBuilder.types(types);
|
|
16575
16718
|
}
|
|
16576
16719
|
if (params.memberCount) {
|
|
16577
|
-
log.info(
|
|
16720
|
+
log.info(new Date().toISOString() + " [getChannels] setting memberCount filter: " + (params === null || params === void 0 ? void 0 : params.memberCount));
|
|
16578
16721
|
channelQueryBuilder.memberCount(params.memberCount);
|
|
16579
16722
|
}
|
|
16580
16723
|
channelQueryBuilder.order('lastMessage');
|
|
16581
16724
|
limit = params.limit || 50;
|
|
16582
|
-
log.info(
|
|
16725
|
+
log.info(new Date().toISOString() + " [getChannels] query limit: " + limit);
|
|
16583
16726
|
channelQueryBuilder.limit(limit);
|
|
16584
|
-
_context2.n =
|
|
16727
|
+
_context2.n = 5;
|
|
16585
16728
|
return effects.call(channelQueryBuilder.build);
|
|
16586
|
-
case
|
|
16729
|
+
case 5:
|
|
16587
16730
|
channelQuery = _context2.v;
|
|
16588
|
-
log.info(
|
|
16589
|
-
_context2.n =
|
|
16731
|
+
log.info(new Date().toISOString() + " [getChannels] query built successfully");
|
|
16732
|
+
_context2.n = 6;
|
|
16590
16733
|
return effects.call(channelQuery.loadNextPage);
|
|
16591
|
-
case
|
|
16734
|
+
case 6:
|
|
16592
16735
|
channelsData = _context2.v;
|
|
16593
16736
|
channelList = channelsData.channels;
|
|
16594
|
-
log.info(
|
|
16737
|
+
log.info(new Date().toISOString() + " [getChannels] channelsData received: " + JSON.stringify({
|
|
16595
16738
|
channelsCount: (channelList === null || channelList === void 0 ? void 0 : channelList.length) || 0,
|
|
16596
16739
|
hasNext: channelsData.hasNext
|
|
16597
16740
|
}));
|
|
16598
|
-
_context2.n = 6;
|
|
16599
|
-
return effects.put(channelHasNextAC(channelsData.hasNext));
|
|
16600
|
-
case 6:
|
|
16601
16741
|
_context2.n = 7;
|
|
16602
|
-
return effects.
|
|
16742
|
+
return effects.put(channelHasNextAC(channelsData.hasNext));
|
|
16603
16743
|
case 7:
|
|
16744
|
+
_context2.n = 8;
|
|
16745
|
+
return effects.call(getActiveChannelId);
|
|
16746
|
+
case 8:
|
|
16604
16747
|
channelId = _context2.v;
|
|
16605
|
-
log.info(
|
|
16748
|
+
log.info(new Date().toISOString() + " [getChannels] active channelId: " + channelId);
|
|
16606
16749
|
if (!channelId) {
|
|
16607
|
-
_context2.n =
|
|
16750
|
+
_context2.n = 10;
|
|
16608
16751
|
break;
|
|
16609
16752
|
}
|
|
16610
|
-
_context2.n =
|
|
16753
|
+
_context2.n = 9;
|
|
16611
16754
|
return effects.call(getChannelFromMap, channelId);
|
|
16612
|
-
case
|
|
16755
|
+
case 9:
|
|
16613
16756
|
_t2 = _context2.v;
|
|
16614
|
-
_context2.n =
|
|
16757
|
+
_context2.n = 11;
|
|
16615
16758
|
break;
|
|
16616
|
-
case 9:
|
|
16617
|
-
_t2 = null;
|
|
16618
16759
|
case 10:
|
|
16619
|
-
|
|
16620
|
-
log.info('[getChannels] activeChannel from map:', activeChannel ? (_activeChannel = activeChannel) === null || _activeChannel === void 0 ? void 0 : _activeChannel.id : 'null');
|
|
16621
|
-
_context2.n = 11;
|
|
16622
|
-
return effects.call(destroyChannelsMap);
|
|
16760
|
+
_t2 = null;
|
|
16623
16761
|
case 11:
|
|
16624
|
-
|
|
16762
|
+
activeChannel = _t2;
|
|
16763
|
+
log.info(new Date().toISOString() + " [getChannels] activeChannel from map: " + (activeChannel ? (_activeChannel = activeChannel) === null || _activeChannel === void 0 ? void 0 : _activeChannel.id : 'null'));
|
|
16625
16764
|
_context2.n = 12;
|
|
16626
|
-
return effects.call(
|
|
16765
|
+
return effects.call(destroyChannelsMap);
|
|
16627
16766
|
case 12:
|
|
16767
|
+
log.info(new Date().toISOString() + " [getChannels] channels map destroyed");
|
|
16768
|
+
_context2.n = 13;
|
|
16769
|
+
return effects.call(setChannelsInMap, channelList);
|
|
16770
|
+
case 13:
|
|
16628
16771
|
_yield$call = _context2.v;
|
|
16629
16772
|
mappedChannels = _yield$call.channels;
|
|
16630
16773
|
channelsForUpdateLastReactionMessage = _yield$call.channelsForUpdateLastReactionMessage;
|
|
16631
|
-
log.info(
|
|
16774
|
+
log.info(new Date().toISOString() + " [getChannels] setChannelsInMap result: " + JSON.stringify({
|
|
16632
16775
|
mappedChannelsCount: ((_mappedChannels = mappedChannels) === null || _mappedChannels === void 0 ? void 0 : _mappedChannels.length) || 0,
|
|
16633
16776
|
channelsForUpdateLastReactionMessageCount: (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length) || 0
|
|
16634
16777
|
}));
|
|
16635
|
-
log.info(
|
|
16778
|
+
log.info(new Date().toISOString() + " channelsForUpdateLastReactionMessage: " + (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length));
|
|
16636
16779
|
if (!(channelsForUpdateLastReactionMessage !== null && channelsForUpdateLastReactionMessage !== void 0 && channelsForUpdateLastReactionMessage.length)) {
|
|
16637
|
-
_context2.n =
|
|
16780
|
+
_context2.n = 15;
|
|
16638
16781
|
break;
|
|
16639
16782
|
}
|
|
16640
|
-
log.info(
|
|
16783
|
+
log.info(new Date().toISOString() + " [getChannels] processing channels for\n reaction message update: " + (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length));
|
|
16641
16784
|
channelMessageMap = {};
|
|
16642
|
-
_context2.n =
|
|
16785
|
+
_context2.n = 14;
|
|
16643
16786
|
return effects.call(function () {
|
|
16644
16787
|
try {
|
|
16645
16788
|
return Promise.resolve(Promise.all(channelsForUpdateLastReactionMessage.map(function (channel) {
|
|
@@ -16647,10 +16790,10 @@ function getChannels(action) {
|
|
|
16647
16790
|
return Promise.resolve(new Promise(function (resolve) {
|
|
16648
16791
|
channel.getMessagesById([channel.newReactions[0].messageId]).then(function (messages) {
|
|
16649
16792
|
channelMessageMap[channel === null || channel === void 0 ? void 0 : channel.id] = messages[0];
|
|
16650
|
-
log.info(
|
|
16793
|
+
log.info(new Date().toISOString() + " [getChannels] successfully fetched reaction message for channel: " + (channel === null || channel === void 0 ? void 0 : channel.id));
|
|
16651
16794
|
resolve(true);
|
|
16652
16795
|
})["catch"](function (e) {
|
|
16653
|
-
log.error(e,
|
|
16796
|
+
log.error(e, "Error on getMessagesById for channel: " + (channel === null || channel === void 0 ? void 0 : channel.id));
|
|
16654
16797
|
resolve(true);
|
|
16655
16798
|
});
|
|
16656
16799
|
}));
|
|
@@ -16662,133 +16805,133 @@ function getChannels(action) {
|
|
|
16662
16805
|
return Promise.reject(e);
|
|
16663
16806
|
}
|
|
16664
16807
|
});
|
|
16665
|
-
case
|
|
16666
|
-
log.info(
|
|
16808
|
+
case 14:
|
|
16809
|
+
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);
|
|
16667
16810
|
mappedChannels = mappedChannels.map(function (channel) {
|
|
16668
16811
|
if (channelMessageMap[channel === null || channel === void 0 ? void 0 : channel.id]) {
|
|
16669
16812
|
channel.lastReactedMessage = channelMessageMap[channel === null || channel === void 0 ? void 0 : channel.id];
|
|
16670
16813
|
}
|
|
16671
16814
|
return channel;
|
|
16672
16815
|
});
|
|
16673
|
-
log.info(
|
|
16674
|
-
case 14:
|
|
16675
|
-
log.info('[getChannels] setting channels in state, count:', ((_mappedChannels3 = mappedChannels) === null || _mappedChannels3 === void 0 ? void 0 : _mappedChannels3.length) || 0);
|
|
16676
|
-
_context2.n = 15;
|
|
16677
|
-
return effects.put(setChannelsAC(mappedChannels));
|
|
16816
|
+
log.info(new Date().toISOString() + " [getChannels] mappedChannels updated with reaction messages, final count: " + (((_mappedChannels2 = mappedChannels) === null || _mappedChannels2 === void 0 ? void 0 : _mappedChannels2.length) || 0));
|
|
16678
16817
|
case 15:
|
|
16818
|
+
log.info(new Date().toISOString() + " [getChannels] setting channels in state, count: " + (((_mappedChannels3 = mappedChannels) === null || _mappedChannels3 === void 0 ? void 0 : _mappedChannels3.length) || 0));
|
|
16819
|
+
_context2.n = 16;
|
|
16820
|
+
return effects.put(setChannelsAC(mappedChannels));
|
|
16821
|
+
case 16:
|
|
16679
16822
|
if (!channelId) {
|
|
16680
16823
|
activeChannel = channelList[0];
|
|
16681
|
-
log.info(
|
|
16824
|
+
log.info(new Date().toISOString() + " [getChannels] no active channelId, setting first channel as active: " + ((_activeChannel2 = activeChannel) === null || _activeChannel2 === void 0 ? void 0 : _activeChannel2.id));
|
|
16682
16825
|
}
|
|
16683
16826
|
query.channelQuery = channelQuery;
|
|
16684
16827
|
if (!(activeChannel && getAutoSelectFitsChannel())) {
|
|
16685
|
-
_context2.n =
|
|
16828
|
+
_context2.n = 17;
|
|
16686
16829
|
break;
|
|
16687
16830
|
}
|
|
16688
|
-
log.info(
|
|
16689
|
-
_context2.n = 16;
|
|
16690
|
-
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
16691
|
-
case 16:
|
|
16831
|
+
log.info(new Date().toISOString() + " [getChannels] auto-selecting channel: " + ((_activeChannel3 = activeChannel) === null || _activeChannel3 === void 0 ? void 0 : _activeChannel3.id));
|
|
16692
16832
|
_context2.n = 17;
|
|
16693
|
-
return effects.put(
|
|
16833
|
+
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(activeChannel))));
|
|
16694
16834
|
case 17:
|
|
16835
|
+
_context2.n = 18;
|
|
16836
|
+
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
16837
|
+
case 18:
|
|
16695
16838
|
hiddenList = store.getState().ChannelReducer.hideChannelList;
|
|
16696
|
-
log.info(
|
|
16839
|
+
log.info(new Date().toISOString() + " [getChannels] hiddenList state: " + hiddenList);
|
|
16697
16840
|
if (hiddenList) {
|
|
16698
|
-
_context2.n =
|
|
16841
|
+
_context2.n = 29;
|
|
16699
16842
|
break;
|
|
16700
16843
|
}
|
|
16701
|
-
log.info(
|
|
16844
|
+
log.info(new Date().toISOString() + " [getChannels] starting all channels query (hiddenList is false)");
|
|
16702
16845
|
allChannelsQueryBuilder = new SceytChatClient.ChannelListQueryBuilder();
|
|
16703
16846
|
allChannelsQueryBuilder.order('lastMessage');
|
|
16704
16847
|
if (channelTypesFilter !== null && channelTypesFilter !== void 0 && channelTypesFilter.length) {
|
|
16705
16848
|
allChannelsQueryBuilder.types(channelTypesFilter);
|
|
16706
|
-
log.info(
|
|
16849
|
+
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery types: " + JSON.stringify(channelTypesFilter));
|
|
16707
16850
|
}
|
|
16708
16851
|
if (params !== null && params !== void 0 && params.memberCount) {
|
|
16709
16852
|
allChannelsQueryBuilder.memberCount(params.memberCount);
|
|
16710
|
-
log.info(
|
|
16853
|
+
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery memberCount: " + (params === null || params === void 0 ? void 0 : params.memberCount));
|
|
16711
16854
|
}
|
|
16712
16855
|
allChannelsQueryBuilder.limit(50);
|
|
16713
|
-
_context2.n =
|
|
16856
|
+
_context2.n = 19;
|
|
16714
16857
|
return effects.call(allChannelsQueryBuilder.build);
|
|
16715
|
-
case
|
|
16858
|
+
case 19:
|
|
16716
16859
|
allChannelsQuery = _context2.v;
|
|
16717
|
-
log.info(
|
|
16860
|
+
log.info(new Date().toISOString() + " [getChannels] allChannelsQuery built");
|
|
16718
16861
|
hasNext = true;
|
|
16719
16862
|
totalAllChannelsAdded = 0;
|
|
16720
16863
|
i = 0;
|
|
16721
|
-
case
|
|
16864
|
+
case 20:
|
|
16722
16865
|
if (!(i <= 4)) {
|
|
16723
|
-
_context2.n =
|
|
16866
|
+
_context2.n = 28;
|
|
16724
16867
|
break;
|
|
16725
16868
|
}
|
|
16726
16869
|
if (!hasNext) {
|
|
16727
|
-
_context2.n =
|
|
16870
|
+
_context2.n = 26;
|
|
16728
16871
|
break;
|
|
16729
16872
|
}
|
|
16730
|
-
_context2.p =
|
|
16873
|
+
_context2.p = 21;
|
|
16731
16874
|
_connectionStatus = store.getState().UserReducer.connectionStatus;
|
|
16732
16875
|
if (!(_connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
16733
|
-
_context2.n =
|
|
16876
|
+
_context2.n = 22;
|
|
16734
16877
|
break;
|
|
16735
16878
|
}
|
|
16736
|
-
log.warn(
|
|
16737
|
-
return _context2.a(3,
|
|
16738
|
-
case 21:
|
|
16739
|
-
log.info('[getChannels] loading all channels page:', i + 1);
|
|
16740
|
-
_context2.n = 22;
|
|
16741
|
-
return effects.call(allChannelsQuery.loadNextPage);
|
|
16879
|
+
log.warn(new Date().toISOString() + " [getChannels] connection not ready, aborting. Status: " + _connectionStatus);
|
|
16880
|
+
return _context2.a(3, 28);
|
|
16742
16881
|
case 22:
|
|
16882
|
+
log.info(new Date().toISOString() + " [getChannels] loading all channels page: " + (i + 1));
|
|
16883
|
+
_context2.n = 23;
|
|
16884
|
+
return effects.call(allChannelsQuery.loadNextPage);
|
|
16885
|
+
case 23:
|
|
16743
16886
|
allChannelsData = _context2.v;
|
|
16744
16887
|
hasNext = allChannelsData.hasNext;
|
|
16745
16888
|
allChannelList = allChannelsData.channels;
|
|
16746
|
-
log.info(
|
|
16889
|
+
log.info(new Date().toISOString() + " [getChannels] all channels page: " + (i + 1), i + 1, 'loaded:', JSON.stringify({
|
|
16747
16890
|
channelsCount: (allChannelList === null || allChannelList === void 0 ? void 0 : allChannelList.length) || 0,
|
|
16748
16891
|
hasNext: hasNext
|
|
16749
16892
|
}));
|
|
16750
16893
|
addChannelsToAllChannels(allChannelList);
|
|
16751
16894
|
totalAllChannelsAdded += (allChannelList === null || allChannelList === void 0 ? void 0 : allChannelList.length) || 0;
|
|
16752
|
-
log.info(
|
|
16753
|
-
_context2.n =
|
|
16895
|
+
log.info(new Date().toISOString() + " [getChannels] total all channels added so far: " + totalAllChannelsAdded);
|
|
16896
|
+
_context2.n = 25;
|
|
16754
16897
|
break;
|
|
16755
|
-
case 23:
|
|
16756
|
-
_context2.p = 23;
|
|
16757
|
-
_t3 = _context2.v;
|
|
16758
|
-
log.error(_t3, 'Error on get all channels page:', i + 1);
|
|
16759
|
-
return _context2.a(3, 27);
|
|
16760
16898
|
case 24:
|
|
16761
|
-
_context2.
|
|
16762
|
-
|
|
16899
|
+
_context2.p = 24;
|
|
16900
|
+
_t3 = _context2.v;
|
|
16901
|
+
log.error(_t3, "Error on get all channels page: " + (i + 1));
|
|
16902
|
+
return _context2.a(3, 28);
|
|
16763
16903
|
case 25:
|
|
16764
|
-
|
|
16765
|
-
case 26:
|
|
16766
|
-
i++;
|
|
16767
|
-
_context2.n = 19;
|
|
16904
|
+
_context2.n = 27;
|
|
16768
16905
|
break;
|
|
16906
|
+
case 26:
|
|
16907
|
+
log.info(new Date().toISOString() + " [getChannels] no more pages available, stopping at iteration: " + i);
|
|
16769
16908
|
case 27:
|
|
16770
|
-
|
|
16771
|
-
_context2.n =
|
|
16909
|
+
i++;
|
|
16910
|
+
_context2.n = 20;
|
|
16772
16911
|
break;
|
|
16773
16912
|
case 28:
|
|
16774
|
-
log.info(
|
|
16775
|
-
|
|
16776
|
-
log.info('[getChannels] completed successfully. Final mapped channels count:', ((_mappedChannels4 = mappedChannels) === null || _mappedChannels4 === void 0 ? void 0 : _mappedChannels4.length) || 0);
|
|
16777
|
-
_context2.n = 31;
|
|
16913
|
+
log.info(new Date().toISOString() + " [getChannels] all channels query completed, total channels added: " + totalAllChannelsAdded);
|
|
16914
|
+
_context2.n = 30;
|
|
16778
16915
|
break;
|
|
16916
|
+
case 29:
|
|
16917
|
+
log.info(new Date().toISOString() + " [getChannels] skipping all channels query (hiddenList is true)");
|
|
16779
16918
|
case 30:
|
|
16780
|
-
|
|
16919
|
+
log.info(new Date().toISOString() + " [getChannels] completed successfully. Final mapped channels count: " + (((_mappedChannels4 = mappedChannels) === null || _mappedChannels4 === void 0 ? void 0 : _mappedChannels4.length) || 0));
|
|
16920
|
+
_context2.n = 32;
|
|
16921
|
+
break;
|
|
16922
|
+
case 31:
|
|
16923
|
+
_context2.p = 31;
|
|
16781
16924
|
_t4 = _context2.v;
|
|
16782
|
-
log.error(
|
|
16783
|
-
log.error(
|
|
16925
|
+
log.error(new Date().toISOString() + " [getChannels] error occurred: " + JSON.stringify(_t4), 'Error on get channels');
|
|
16926
|
+
log.error(new Date().toISOString() + " [getChannels] error details: " + JSON.stringify({
|
|
16784
16927
|
message: _t4.message,
|
|
16785
16928
|
code: _t4.code,
|
|
16786
16929
|
stack: _t4.stack
|
|
16787
|
-
});
|
|
16788
|
-
case
|
|
16930
|
+
}));
|
|
16931
|
+
case 32:
|
|
16789
16932
|
return _context2.a(2);
|
|
16790
16933
|
}
|
|
16791
|
-
}, _marked2$1, null, [[
|
|
16934
|
+
}, _marked2$1, null, [[21, 24], [1, 31]]);
|
|
16792
16935
|
}
|
|
16793
16936
|
function searchChannels(action) {
|
|
16794
16937
|
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;
|
|
@@ -17111,56 +17254,56 @@ function searchChannelsForForward(action) {
|
|
|
17111
17254
|
}, _marked5, null, [[0, 7]]);
|
|
17112
17255
|
}
|
|
17113
17256
|
function channelsLoadMore(action) {
|
|
17114
|
-
var _mappedChannels5, _mappedChannels7, _mappedChannels8, payload, limit, channelQuery, channelsData, channelList, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, _Object$
|
|
17257
|
+
var _mappedChannels5, _mappedChannels7, _mappedChannels8, payload, limit, channelQuery, channelsData, channelList, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys3, _mappedChannels6, channelMessageMap, _t8;
|
|
17115
17258
|
return _regenerator().w(function (_context6) {
|
|
17116
17259
|
while (1) switch (_context6.p = _context6.n) {
|
|
17117
17260
|
case 0:
|
|
17118
|
-
log.info(
|
|
17261
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] start load more channels");
|
|
17119
17262
|
_context6.p = 1;
|
|
17120
17263
|
payload = action.payload;
|
|
17121
17264
|
limit = payload.limit;
|
|
17122
|
-
log.info(
|
|
17265
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] input payload:", JSON.stringify({
|
|
17123
17266
|
limit: limit
|
|
17124
17267
|
}));
|
|
17125
17268
|
channelQuery = query.channelQuery;
|
|
17126
|
-
log.info(
|
|
17269
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] channelQuery exists:", !!channelQuery);
|
|
17127
17270
|
if (channelQuery) {
|
|
17128
17271
|
_context6.n = 2;
|
|
17129
17272
|
break;
|
|
17130
17273
|
}
|
|
17131
|
-
log.error(
|
|
17274
|
+
log.error(new Date().toISOString() + " [channelsLoadMore] channelQuery is null or undefined, cannot load more");
|
|
17132
17275
|
return _context6.a(2);
|
|
17133
17276
|
case 2:
|
|
17134
17277
|
if (limit) {
|
|
17135
|
-
log.info(
|
|
17278
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] setting query limit to:", limit);
|
|
17136
17279
|
channelQuery.limit = limit;
|
|
17137
17280
|
} else {
|
|
17138
|
-
log.info(
|
|
17281
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] no limit provided, using existing query limit");
|
|
17139
17282
|
}
|
|
17140
17283
|
_context6.n = 3;
|
|
17141
17284
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
17142
17285
|
case 3:
|
|
17143
|
-
log.info(
|
|
17286
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] loading next page...");
|
|
17144
17287
|
_context6.n = 4;
|
|
17145
17288
|
return effects.call(channelQuery.loadNextPage);
|
|
17146
17289
|
case 4:
|
|
17147
17290
|
channelsData = _context6.v;
|
|
17148
17291
|
channelList = channelsData.channels;
|
|
17149
|
-
log.info(
|
|
17292
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] channelsData received:", JSON.stringify({
|
|
17150
17293
|
channelsCount: (channelList === null || channelList === void 0 ? void 0 : channelList.length) || 0,
|
|
17151
17294
|
hasNext: channelsData.hasNext
|
|
17152
17295
|
}));
|
|
17153
17296
|
_context6.n = 5;
|
|
17154
17297
|
return effects.put(channelHasNextAC(channelsData.hasNext));
|
|
17155
17298
|
case 5:
|
|
17156
|
-
log.info(
|
|
17299
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] hasNext set to:", channelsData.hasNext);
|
|
17157
17300
|
_context6.n = 6;
|
|
17158
17301
|
return effects.call(setChannelsInMap, channelsData.channels);
|
|
17159
17302
|
case 6:
|
|
17160
17303
|
_yield$call3 = _context6.v;
|
|
17161
17304
|
mappedChannels = _yield$call3.channels;
|
|
17162
17305
|
channelsForUpdateLastReactionMessage = _yield$call3.channelsForUpdateLastReactionMessage;
|
|
17163
|
-
log.info(
|
|
17306
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] setChannelsInMap result:", JSON.stringify({
|
|
17164
17307
|
mappedChannelsCount: ((_mappedChannels5 = mappedChannels) === null || _mappedChannels5 === void 0 ? void 0 : _mappedChannels5.length) || 0,
|
|
17165
17308
|
channelsForUpdateLastReactionMessageCount: (channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length) || 0
|
|
17166
17309
|
}));
|
|
@@ -17168,7 +17311,7 @@ function channelsLoadMore(action) {
|
|
|
17168
17311
|
_context6.n = 8;
|
|
17169
17312
|
break;
|
|
17170
17313
|
}
|
|
17171
|
-
log.info(
|
|
17314
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] processing channels for reaction message update:", channelsForUpdateLastReactionMessage === null || channelsForUpdateLastReactionMessage === void 0 ? void 0 : channelsForUpdateLastReactionMessage.length);
|
|
17172
17315
|
channelMessageMap = {};
|
|
17173
17316
|
_context6.n = 7;
|
|
17174
17317
|
return effects.call(function () {
|
|
@@ -17178,7 +17321,7 @@ function channelsLoadMore(action) {
|
|
|
17178
17321
|
return Promise.resolve(new Promise(function (resolve) {
|
|
17179
17322
|
channel.getMessagesById([channel.newReactions[0].messageId]).then(function (messages) {
|
|
17180
17323
|
channelMessageMap[channel.id] = messages[0];
|
|
17181
|
-
log.info(
|
|
17324
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] successfully fetched reaction message for channel:", channel === null || channel === void 0 ? void 0 : channel.id);
|
|
17182
17325
|
resolve(true);
|
|
17183
17326
|
})["catch"](function (e) {
|
|
17184
17327
|
log.error(e, 'Error on getMessagesById for channel:', channel === null || channel === void 0 ? void 0 : channel.id);
|
|
@@ -17194,34 +17337,34 @@ function channelsLoadMore(action) {
|
|
|
17194
17337
|
}
|
|
17195
17338
|
});
|
|
17196
17339
|
case 7:
|
|
17197
|
-
log.info(
|
|
17340
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] reaction messages fetched:", channelMessageMap ? (_Object$keys3 = Object.keys(channelMessageMap)) === null || _Object$keys3 === void 0 ? void 0 : _Object$keys3.length : 0);
|
|
17198
17341
|
mappedChannels = mappedChannels.map(function (channel) {
|
|
17199
17342
|
if (channelMessageMap[channel.id]) {
|
|
17200
17343
|
channel.lastReactedMessage = channelMessageMap[channel.id];
|
|
17201
17344
|
}
|
|
17202
17345
|
return channel;
|
|
17203
17346
|
});
|
|
17204
|
-
log.info(
|
|
17347
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] mappedChannels updated with reaction messages, final count:", ((_mappedChannels6 = mappedChannels) === null || _mappedChannels6 === void 0 ? void 0 : _mappedChannels6.length) || 0);
|
|
17205
17348
|
_context6.n = 9;
|
|
17206
17349
|
break;
|
|
17207
17350
|
case 8:
|
|
17208
|
-
log.info(
|
|
17351
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] no channels need reaction message update");
|
|
17209
17352
|
case 9:
|
|
17210
|
-
log.info(
|
|
17353
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] adding channels to state, count:", ((_mappedChannels7 = mappedChannels) === null || _mappedChannels7 === void 0 ? void 0 : _mappedChannels7.length) || 0);
|
|
17211
17354
|
_context6.n = 10;
|
|
17212
17355
|
return effects.put(addChannelsAC(mappedChannels));
|
|
17213
17356
|
case 10:
|
|
17214
17357
|
_context6.n = 11;
|
|
17215
17358
|
return effects.put(setChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
17216
17359
|
case 11:
|
|
17217
|
-
log.info(
|
|
17360
|
+
log.info(new Date().toISOString() + " [channelsLoadMore] completed successfully. Total channels added:", ((_mappedChannels8 = mappedChannels) === null || _mappedChannels8 === void 0 ? void 0 : _mappedChannels8.length) || 0);
|
|
17218
17361
|
_context6.n = 13;
|
|
17219
17362
|
break;
|
|
17220
17363
|
case 12:
|
|
17221
17364
|
_context6.p = 12;
|
|
17222
17365
|
_t8 = _context6.v;
|
|
17223
|
-
log.error(
|
|
17224
|
-
log.error(
|
|
17366
|
+
log.error(new Date().toISOString() + " [channelsLoadMore] error occurred:", _t8);
|
|
17367
|
+
log.error(new Date().toISOString() + " [channelsLoadMore] error details:", JSON.stringify({
|
|
17225
17368
|
message: _t8 === null || _t8 === void 0 ? void 0 : _t8.message,
|
|
17226
17369
|
code: _t8 === null || _t8 === void 0 ? void 0 : _t8.code,
|
|
17227
17370
|
stack: _t8 === null || _t8 === void 0 ? void 0 : _t8.stack
|
|
@@ -17392,7 +17535,7 @@ function markMessagesRead(action) {
|
|
|
17392
17535
|
}, _marked9, null, [[2, 9]]);
|
|
17393
17536
|
}
|
|
17394
17537
|
function markVoiceMessageAsPlayed(action) {
|
|
17395
|
-
var payload, channelId, messageIds, channel, _t10;
|
|
17538
|
+
var payload, channelId, messageIds, channel, messageListMarker, _iterator6, _step6, messageId, updateParams, _t10;
|
|
17396
17539
|
return _regenerator().w(function (_context0) {
|
|
17397
17540
|
while (1) switch (_context0.p = _context0.n) {
|
|
17398
17541
|
case 0:
|
|
@@ -17410,25 +17553,54 @@ function markVoiceMessageAsPlayed(action) {
|
|
|
17410
17553
|
}
|
|
17411
17554
|
}
|
|
17412
17555
|
if (!channel) {
|
|
17413
|
-
_context0.n =
|
|
17556
|
+
_context0.n = 7;
|
|
17414
17557
|
break;
|
|
17415
17558
|
}
|
|
17416
17559
|
_context0.n = 3;
|
|
17417
17560
|
return effects.call(channel.markVoiceMessagesAsPlayed, messageIds);
|
|
17418
17561
|
case 3:
|
|
17562
|
+
messageListMarker = _context0.v;
|
|
17563
|
+
_iterator6 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
17564
|
+
case 4:
|
|
17565
|
+
if ((_step6 = _iterator6()).done) {
|
|
17566
|
+
_context0.n = 7;
|
|
17567
|
+
break;
|
|
17568
|
+
}
|
|
17569
|
+
messageId = _step6.value;
|
|
17570
|
+
updateParams = {
|
|
17571
|
+
deliveryStatus: MESSAGE_DELIVERY_STATUS.PLAYED,
|
|
17572
|
+
userMarkers: [{
|
|
17573
|
+
user: messageListMarker.user,
|
|
17574
|
+
createdAt: messageListMarker.createdAt,
|
|
17575
|
+
messageId: messageId,
|
|
17576
|
+
name: MESSAGE_DELIVERY_STATUS.READ
|
|
17577
|
+
}]
|
|
17578
|
+
};
|
|
17419
17579
|
_context0.n = 5;
|
|
17580
|
+
return effects.put(updateMessageAC(messageId, updateParams));
|
|
17581
|
+
case 5:
|
|
17582
|
+
updateMessageOnMap(channel.id, {
|
|
17583
|
+
messageId: messageId,
|
|
17584
|
+
params: updateParams
|
|
17585
|
+
});
|
|
17586
|
+
updateMessageOnAllMessages(messageId, updateParams);
|
|
17587
|
+
case 6:
|
|
17588
|
+
_context0.n = 4;
|
|
17420
17589
|
break;
|
|
17421
|
-
case
|
|
17422
|
-
_context0.
|
|
17590
|
+
case 7:
|
|
17591
|
+
_context0.n = 9;
|
|
17592
|
+
break;
|
|
17593
|
+
case 8:
|
|
17594
|
+
_context0.p = 8;
|
|
17423
17595
|
_t10 = _context0.v;
|
|
17424
17596
|
log.error(_t10, 'Error on mark voice messages read');
|
|
17425
|
-
case
|
|
17597
|
+
case 9:
|
|
17426
17598
|
return _context0.a(2);
|
|
17427
17599
|
}
|
|
17428
|
-
}, _marked0, null, [[1,
|
|
17600
|
+
}, _marked0, null, [[1, 8]]);
|
|
17429
17601
|
}
|
|
17430
17602
|
function markMessagesDelivered(action) {
|
|
17431
|
-
var payload, channelId, messageIds, channel, _t11;
|
|
17603
|
+
var payload, channelId, messageIds, channel, messageListMarker, _iterator7, _step7, messageId, updateParams, _t11;
|
|
17432
17604
|
return _regenerator().w(function (_context1) {
|
|
17433
17605
|
while (1) switch (_context1.p = _context1.n) {
|
|
17434
17606
|
case 0:
|
|
@@ -17446,23 +17618,52 @@ function markMessagesDelivered(action) {
|
|
|
17446
17618
|
}
|
|
17447
17619
|
}
|
|
17448
17620
|
if (!channel) {
|
|
17449
|
-
_context1.n =
|
|
17621
|
+
_context1.n = 7;
|
|
17450
17622
|
break;
|
|
17451
17623
|
}
|
|
17452
17624
|
log.info('send delivered marker ', messageIds);
|
|
17453
17625
|
_context1.n = 3;
|
|
17454
17626
|
return effects.call(channel.markMessagesAsReceived, messageIds);
|
|
17455
17627
|
case 3:
|
|
17628
|
+
messageListMarker = _context1.v;
|
|
17629
|
+
_iterator7 = _createForOfIteratorHelperLoose(messageListMarker.messageIds);
|
|
17630
|
+
case 4:
|
|
17631
|
+
if ((_step7 = _iterator7()).done) {
|
|
17632
|
+
_context1.n = 7;
|
|
17633
|
+
break;
|
|
17634
|
+
}
|
|
17635
|
+
messageId = _step7.value;
|
|
17636
|
+
updateParams = {
|
|
17637
|
+
deliveryStatus: MESSAGE_DELIVERY_STATUS.DELIVERED,
|
|
17638
|
+
userMarkers: [{
|
|
17639
|
+
user: messageListMarker.user,
|
|
17640
|
+
createdAt: messageListMarker.createdAt,
|
|
17641
|
+
messageId: messageId,
|
|
17642
|
+
name: MESSAGE_DELIVERY_STATUS.DELIVERED
|
|
17643
|
+
}]
|
|
17644
|
+
};
|
|
17456
17645
|
_context1.n = 5;
|
|
17646
|
+
return effects.put(updateMessageAC(messageId, updateParams));
|
|
17647
|
+
case 5:
|
|
17648
|
+
updateMessageOnMap(channel.id, {
|
|
17649
|
+
messageId: messageId,
|
|
17650
|
+
params: updateParams
|
|
17651
|
+
});
|
|
17652
|
+
updateMessageOnAllMessages(messageId, updateParams);
|
|
17653
|
+
case 6:
|
|
17654
|
+
_context1.n = 4;
|
|
17457
17655
|
break;
|
|
17458
|
-
case
|
|
17459
|
-
_context1.
|
|
17656
|
+
case 7:
|
|
17657
|
+
_context1.n = 9;
|
|
17658
|
+
break;
|
|
17659
|
+
case 8:
|
|
17660
|
+
_context1.p = 8;
|
|
17460
17661
|
_t11 = _context1.v;
|
|
17461
17662
|
log.error(_t11, 'Error on mark messages delivered');
|
|
17462
|
-
case
|
|
17663
|
+
case 9:
|
|
17463
17664
|
return _context1.a(2);
|
|
17464
17665
|
}
|
|
17465
|
-
}, _marked1, null, [[1,
|
|
17666
|
+
}, _marked1, null, [[1, 8]]);
|
|
17466
17667
|
}
|
|
17467
17668
|
function switchChannel(action) {
|
|
17468
17669
|
var payload, channel, updateActiveChannel, channelToSwitch, existingChannel, addChannel, _SceytChatClient5, fetchedChannel, channelFromMap, currentActiveChannel, _t12;
|
|
@@ -17859,50 +18060,52 @@ function leaveChannel(action) {
|
|
|
17859
18060
|
}
|
|
17860
18061
|
}, _marked18, null, [[0, 6]]);
|
|
17861
18062
|
}
|
|
17862
|
-
function
|
|
17863
|
-
var
|
|
18063
|
+
function deletePendingDeleteChannels() {
|
|
18064
|
+
var pendingDeleteChannels, _iterator8, _step8, channel, resendableError, _t20;
|
|
17864
18065
|
return _regenerator().w(function (_context19) {
|
|
17865
18066
|
while (1) switch (_context19.p = _context19.n) {
|
|
17866
18067
|
case 0:
|
|
17867
|
-
|
|
17868
|
-
|
|
17869
|
-
channelId = payload.channelId;
|
|
17870
|
-
_context19.n = 1;
|
|
17871
|
-
return effects.call(getChannelFromMap, channelId);
|
|
18068
|
+
pendingDeleteChannels = getPendingDeleteChannels();
|
|
18069
|
+
_iterator8 = _createForOfIteratorHelperLoose(pendingDeleteChannels);
|
|
17872
18070
|
case 1:
|
|
17873
|
-
|
|
17874
|
-
|
|
17875
|
-
channel = getChannelFromAllChannels(channelId);
|
|
17876
|
-
}
|
|
17877
|
-
if (!channel) {
|
|
17878
|
-
_context19.n = 5;
|
|
18071
|
+
if ((_step8 = _iterator8()).done) {
|
|
18072
|
+
_context19.n = 9;
|
|
17879
18073
|
break;
|
|
17880
18074
|
}
|
|
17881
|
-
|
|
17882
|
-
|
|
17883
|
-
case 2:
|
|
18075
|
+
channel = _step8.value;
|
|
18076
|
+
_context19.p = 2;
|
|
17884
18077
|
_context19.n = 3;
|
|
17885
|
-
return effects.
|
|
18078
|
+
return effects.call(channel["delete"]);
|
|
17886
18079
|
case 3:
|
|
17887
18080
|
_context19.n = 4;
|
|
17888
|
-
return effects.put(
|
|
18081
|
+
return effects.put(setChannelToRemoveAC(channel));
|
|
17889
18082
|
case 4:
|
|
17890
18083
|
_context19.n = 5;
|
|
17891
|
-
return effects.put(
|
|
18084
|
+
return effects.put(removeChannelAC(channel.id));
|
|
17892
18085
|
case 5:
|
|
17893
|
-
_context19.n =
|
|
17894
|
-
|
|
18086
|
+
_context19.n = 6;
|
|
18087
|
+
return effects.put(removeChannelCachesAC(channel.id));
|
|
17895
18088
|
case 6:
|
|
17896
|
-
|
|
17897
|
-
|
|
17898
|
-
|
|
18089
|
+
removePendingDeleteChannel(channel.id);
|
|
18090
|
+
_context19.n = 8;
|
|
18091
|
+
break;
|
|
17899
18092
|
case 7:
|
|
18093
|
+
_context19.p = 7;
|
|
18094
|
+
_t20 = _context19.v;
|
|
18095
|
+
resendableError = isResendableError(_t20 === null || _t20 === void 0 ? void 0 : _t20.type);
|
|
18096
|
+
if (!resendableError) {
|
|
18097
|
+
removePendingDeleteChannel(channel.id);
|
|
18098
|
+
}
|
|
18099
|
+
case 8:
|
|
18100
|
+
_context19.n = 1;
|
|
18101
|
+
break;
|
|
18102
|
+
case 9:
|
|
17900
18103
|
return _context19.a(2);
|
|
17901
18104
|
}
|
|
17902
|
-
}, _marked19, null, [[
|
|
18105
|
+
}, _marked19, null, [[2, 7]]);
|
|
17903
18106
|
}
|
|
17904
|
-
function
|
|
17905
|
-
var payload, channelId, channel, _t21;
|
|
18107
|
+
function deleteChannel(action) {
|
|
18108
|
+
var payload, channelId, channel, activeChannelId, lastChannel, _t21;
|
|
17906
18109
|
return _regenerator().w(function (_context20) {
|
|
17907
18110
|
while (1) switch (_context20.p = _context20.n) {
|
|
17908
18111
|
case 0:
|
|
@@ -17916,39 +18119,63 @@ function blockChannel(action) {
|
|
|
17916
18119
|
if (!channel) {
|
|
17917
18120
|
channel = getChannelFromAllChannels(channelId);
|
|
17918
18121
|
}
|
|
17919
|
-
if (!
|
|
17920
|
-
_context20.n =
|
|
18122
|
+
if (!(store.getState().UserReducer.connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
18123
|
+
_context20.n = 5;
|
|
17921
18124
|
break;
|
|
17922
18125
|
}
|
|
18126
|
+
setPendingDeleteChannel(channel);
|
|
17923
18127
|
_context20.n = 2;
|
|
17924
|
-
return effects.call(
|
|
18128
|
+
return effects.call(getActiveChannelId);
|
|
17925
18129
|
case 2:
|
|
18130
|
+
activeChannelId = _context20.v;
|
|
18131
|
+
if (!(activeChannelId === channelId)) {
|
|
18132
|
+
_context20.n = 4;
|
|
18133
|
+
break;
|
|
18134
|
+
}
|
|
17926
18135
|
_context20.n = 3;
|
|
17927
|
-
return effects.
|
|
18136
|
+
return effects.call(getLastChannelFromMap, true);
|
|
17928
18137
|
case 3:
|
|
18138
|
+
lastChannel = _context20.v;
|
|
17929
18139
|
_context20.n = 4;
|
|
17930
|
-
return effects.put(
|
|
18140
|
+
return effects.put(switchChannelActionAC(lastChannel || null));
|
|
17931
18141
|
case 4:
|
|
18142
|
+
return _context20.a(2);
|
|
18143
|
+
case 5:
|
|
18144
|
+
if (!channel) {
|
|
18145
|
+
_context20.n = 9;
|
|
18146
|
+
break;
|
|
18147
|
+
}
|
|
17932
18148
|
_context20.n = 6;
|
|
18149
|
+
return effects.call(channel["delete"]);
|
|
18150
|
+
case 6:
|
|
18151
|
+
_context20.n = 7;
|
|
18152
|
+
return effects.put(setChannelToRemoveAC(channel));
|
|
18153
|
+
case 7:
|
|
18154
|
+
_context20.n = 8;
|
|
18155
|
+
return effects.put(removeChannelAC(channelId));
|
|
18156
|
+
case 8:
|
|
18157
|
+
_context20.n = 9;
|
|
18158
|
+
return effects.put(removeChannelCachesAC(channelId));
|
|
18159
|
+
case 9:
|
|
18160
|
+
_context20.n = 11;
|
|
17933
18161
|
break;
|
|
17934
|
-
case
|
|
17935
|
-
_context20.p =
|
|
18162
|
+
case 10:
|
|
18163
|
+
_context20.p = 10;
|
|
17936
18164
|
_t21 = _context20.v;
|
|
17937
|
-
log.error('ERROR in
|
|
17938
|
-
case
|
|
18165
|
+
log.error('ERROR in delete channel', _t21);
|
|
18166
|
+
case 11:
|
|
17939
18167
|
return _context20.a(2);
|
|
17940
18168
|
}
|
|
17941
|
-
}, _marked20, null, [[0,
|
|
18169
|
+
}, _marked20, null, [[0, 10]]);
|
|
17942
18170
|
}
|
|
17943
|
-
function
|
|
17944
|
-
var payload, channelId,
|
|
18171
|
+
function blockChannel(action) {
|
|
18172
|
+
var payload, channelId, channel, _t22;
|
|
17945
18173
|
return _regenerator().w(function (_context21) {
|
|
17946
18174
|
while (1) switch (_context21.p = _context21.n) {
|
|
17947
18175
|
case 0:
|
|
17948
18176
|
_context21.p = 0;
|
|
17949
18177
|
payload = action.payload;
|
|
17950
|
-
channelId = payload.channelId
|
|
17951
|
-
_SceytChatClient6 = getClient();
|
|
18178
|
+
channelId = payload.channelId;
|
|
17952
18179
|
_context21.n = 1;
|
|
17953
18180
|
return effects.call(getChannelFromMap, channelId);
|
|
17954
18181
|
case 1:
|
|
@@ -17956,6 +18183,46 @@ function updateChannel(action) {
|
|
|
17956
18183
|
if (!channel) {
|
|
17957
18184
|
channel = getChannelFromAllChannels(channelId);
|
|
17958
18185
|
}
|
|
18186
|
+
if (!channel) {
|
|
18187
|
+
_context21.n = 4;
|
|
18188
|
+
break;
|
|
18189
|
+
}
|
|
18190
|
+
_context21.n = 2;
|
|
18191
|
+
return effects.call(channel.block);
|
|
18192
|
+
case 2:
|
|
18193
|
+
_context21.n = 3;
|
|
18194
|
+
return effects.put(removeChannelAC(channelId));
|
|
18195
|
+
case 3:
|
|
18196
|
+
_context21.n = 4;
|
|
18197
|
+
return effects.put(removeChannelCachesAC(channelId));
|
|
18198
|
+
case 4:
|
|
18199
|
+
_context21.n = 6;
|
|
18200
|
+
break;
|
|
18201
|
+
case 5:
|
|
18202
|
+
_context21.p = 5;
|
|
18203
|
+
_t22 = _context21.v;
|
|
18204
|
+
log.error('ERROR in block channel - ', _t22.message);
|
|
18205
|
+
case 6:
|
|
18206
|
+
return _context21.a(2);
|
|
18207
|
+
}
|
|
18208
|
+
}, _marked21, null, [[0, 5]]);
|
|
18209
|
+
}
|
|
18210
|
+
function updateChannel(action) {
|
|
18211
|
+
var payload, channelId, config, _SceytChatClient6, channel, paramsToUpdate, fileToUpload, _yield$call5, subject, avatarUrl, metadata, onUpdateChannel, _channel3, _channel4, _channel5, fields, updatedChannel, _t23;
|
|
18212
|
+
return _regenerator().w(function (_context22) {
|
|
18213
|
+
while (1) switch (_context22.p = _context22.n) {
|
|
18214
|
+
case 0:
|
|
18215
|
+
_context22.p = 0;
|
|
18216
|
+
payload = action.payload;
|
|
18217
|
+
channelId = payload.channelId, config = payload.config;
|
|
18218
|
+
_SceytChatClient6 = getClient();
|
|
18219
|
+
_context22.n = 1;
|
|
18220
|
+
return effects.call(getChannelFromMap, channelId);
|
|
18221
|
+
case 1:
|
|
18222
|
+
channel = _context22.v;
|
|
18223
|
+
if (!channel) {
|
|
18224
|
+
channel = getChannelFromAllChannels(channelId);
|
|
18225
|
+
}
|
|
17959
18226
|
paramsToUpdate = {
|
|
17960
18227
|
uri: channel.uri,
|
|
17961
18228
|
subject: channel.subject,
|
|
@@ -17963,7 +18230,7 @@ function updateChannel(action) {
|
|
|
17963
18230
|
avatarUrl: channel.avatarUrl
|
|
17964
18231
|
};
|
|
17965
18232
|
if (!config.avatar) {
|
|
17966
|
-
|
|
18233
|
+
_context22.n = 3;
|
|
17967
18234
|
break;
|
|
17968
18235
|
}
|
|
17969
18236
|
fileToUpload = {
|
|
@@ -17972,10 +18239,10 @@ function updateChannel(action) {
|
|
|
17972
18239
|
log.info('upload percent - ', progressPercent);
|
|
17973
18240
|
}
|
|
17974
18241
|
};
|
|
17975
|
-
|
|
18242
|
+
_context22.n = 2;
|
|
17976
18243
|
return effects.call(_SceytChatClient6.uploadFile, fileToUpload);
|
|
17977
18244
|
case 2:
|
|
17978
|
-
paramsToUpdate.avatarUrl =
|
|
18245
|
+
paramsToUpdate.avatarUrl = _context22.v;
|
|
17979
18246
|
case 3:
|
|
17980
18247
|
if (config.subject) {
|
|
17981
18248
|
paramsToUpdate.subject = config.subject;
|
|
@@ -17986,14 +18253,14 @@ function updateChannel(action) {
|
|
|
17986
18253
|
if (config.avatarUrl === '') {
|
|
17987
18254
|
paramsToUpdate.avatarUrl = '';
|
|
17988
18255
|
}
|
|
17989
|
-
|
|
18256
|
+
_context22.n = 4;
|
|
17990
18257
|
return effects.call(channel.update, paramsToUpdate);
|
|
17991
18258
|
case 4:
|
|
17992
|
-
_yield$call5 =
|
|
18259
|
+
_yield$call5 = _context22.v;
|
|
17993
18260
|
subject = _yield$call5.subject;
|
|
17994
18261
|
avatarUrl = _yield$call5.avatarUrl;
|
|
17995
18262
|
metadata = _yield$call5.metadata;
|
|
17996
|
-
|
|
18263
|
+
_context22.n = 5;
|
|
17997
18264
|
return effects.put(updateChannelDataAC(channelId, {
|
|
17998
18265
|
subject: subject,
|
|
17999
18266
|
avatarUrl: avatarUrl,
|
|
@@ -18007,7 +18274,7 @@ function updateChannel(action) {
|
|
|
18007
18274
|
});
|
|
18008
18275
|
onUpdateChannel = getOnUpdateChannel();
|
|
18009
18276
|
if (!onUpdateChannel) {
|
|
18010
|
-
|
|
18277
|
+
_context22.n = 7;
|
|
18011
18278
|
break;
|
|
18012
18279
|
}
|
|
18013
18280
|
fields = [];
|
|
@@ -18020,35 +18287,35 @@ function updateChannel(action) {
|
|
|
18020
18287
|
if (JSON.stringify((_channel5 = channel) === null || _channel5 === void 0 ? void 0 : _channel5.metadata) !== metadata) {
|
|
18021
18288
|
fields.push('metadata');
|
|
18022
18289
|
}
|
|
18023
|
-
|
|
18290
|
+
_context22.n = 6;
|
|
18024
18291
|
return effects.call(getChannelFromMap, channelId);
|
|
18025
18292
|
case 6:
|
|
18026
|
-
updatedChannel =
|
|
18293
|
+
updatedChannel = _context22.v;
|
|
18027
18294
|
onUpdateChannel(updatedChannel, fields);
|
|
18028
18295
|
case 7:
|
|
18029
|
-
|
|
18296
|
+
_context22.n = 9;
|
|
18030
18297
|
break;
|
|
18031
18298
|
case 8:
|
|
18032
|
-
|
|
18033
|
-
|
|
18034
|
-
log.error('ERROR in update channel',
|
|
18299
|
+
_context22.p = 8;
|
|
18300
|
+
_t23 = _context22.v;
|
|
18301
|
+
log.error('ERROR in update channel', _t23.message);
|
|
18035
18302
|
case 9:
|
|
18036
|
-
return
|
|
18303
|
+
return _context22.a(2);
|
|
18037
18304
|
}
|
|
18038
|
-
},
|
|
18305
|
+
}, _marked22, null, [[0, 8]]);
|
|
18039
18306
|
}
|
|
18040
18307
|
function checkUsersStatus() {
|
|
18041
|
-
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData,
|
|
18042
|
-
return _regenerator().w(function (
|
|
18043
|
-
while (1) switch (
|
|
18308
|
+
var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData, _t24;
|
|
18309
|
+
return _regenerator().w(function (_context23) {
|
|
18310
|
+
while (1) switch (_context23.p = _context23.n) {
|
|
18044
18311
|
case 0:
|
|
18045
|
-
|
|
18312
|
+
_context23.p = 0;
|
|
18046
18313
|
_SceytChatClient7 = getClient();
|
|
18047
18314
|
usersForUpdate = Object.keys(usersMap);
|
|
18048
|
-
|
|
18315
|
+
_context23.n = 1;
|
|
18049
18316
|
return effects.call(_SceytChatClient7.getUsers, usersForUpdate);
|
|
18050
18317
|
case 1:
|
|
18051
|
-
updatedUsers =
|
|
18318
|
+
updatedUsers = _context23.v;
|
|
18052
18319
|
usersToUpdateMap = {};
|
|
18053
18320
|
update = false;
|
|
18054
18321
|
updatedUsers.forEach(function (updatedUser) {
|
|
@@ -18060,149 +18327,149 @@ function checkUsersStatus() {
|
|
|
18060
18327
|
}
|
|
18061
18328
|
});
|
|
18062
18329
|
if (!update) {
|
|
18063
|
-
|
|
18330
|
+
_context23.n = 4;
|
|
18064
18331
|
break;
|
|
18065
18332
|
}
|
|
18066
18333
|
updateData = JSON.parse(JSON.stringify(usersToUpdateMap));
|
|
18067
|
-
|
|
18334
|
+
_context23.n = 2;
|
|
18068
18335
|
return effects.put(updateMembersPresenceAC(updateData));
|
|
18069
18336
|
case 2:
|
|
18070
|
-
|
|
18337
|
+
_context23.n = 3;
|
|
18071
18338
|
return effects.put(updateUserStatusOnMapAC(updateData));
|
|
18072
18339
|
case 3:
|
|
18073
|
-
|
|
18340
|
+
_context23.n = 4;
|
|
18074
18341
|
return effects.put(updateUserStatusOnChannelAC(updateData));
|
|
18075
18342
|
case 4:
|
|
18076
|
-
|
|
18343
|
+
_context23.n = 6;
|
|
18077
18344
|
break;
|
|
18078
18345
|
case 5:
|
|
18079
|
-
|
|
18080
|
-
|
|
18081
|
-
log.error('ERROR in check user status : ',
|
|
18346
|
+
_context23.p = 5;
|
|
18347
|
+
_t24 = _context23.v;
|
|
18348
|
+
log.error('ERROR in check user status : ', _t24.message);
|
|
18082
18349
|
case 6:
|
|
18083
|
-
return
|
|
18350
|
+
return _context23.a(2);
|
|
18084
18351
|
}
|
|
18085
|
-
},
|
|
18352
|
+
}, _marked23, null, [[0, 5]]);
|
|
18086
18353
|
}
|
|
18087
18354
|
function sendTyping(action) {
|
|
18088
|
-
var state, activeChannelId, channel,
|
|
18089
|
-
return _regenerator().w(function (
|
|
18090
|
-
while (1) switch (
|
|
18355
|
+
var state, activeChannelId, channel, _t25;
|
|
18356
|
+
return _regenerator().w(function (_context24) {
|
|
18357
|
+
while (1) switch (_context24.p = _context24.n) {
|
|
18091
18358
|
case 0:
|
|
18092
18359
|
state = action.payload.state;
|
|
18093
|
-
|
|
18360
|
+
_context24.n = 1;
|
|
18094
18361
|
return effects.call(getActiveChannelId);
|
|
18095
18362
|
case 1:
|
|
18096
|
-
activeChannelId =
|
|
18097
|
-
|
|
18363
|
+
activeChannelId = _context24.v;
|
|
18364
|
+
_context24.n = 2;
|
|
18098
18365
|
return effects.call(getChannelFromMap, activeChannelId);
|
|
18099
18366
|
case 2:
|
|
18100
|
-
channel =
|
|
18101
|
-
|
|
18367
|
+
channel = _context24.v;
|
|
18368
|
+
_context24.p = 3;
|
|
18102
18369
|
if (!channel) {
|
|
18103
|
-
|
|
18370
|
+
_context24.n = 6;
|
|
18104
18371
|
break;
|
|
18105
18372
|
}
|
|
18106
18373
|
if (!state) {
|
|
18107
|
-
|
|
18374
|
+
_context24.n = 5;
|
|
18108
18375
|
break;
|
|
18109
18376
|
}
|
|
18110
|
-
|
|
18377
|
+
_context24.n = 4;
|
|
18111
18378
|
return effects.call(channel.startTyping);
|
|
18112
18379
|
case 4:
|
|
18113
|
-
|
|
18380
|
+
_context24.n = 6;
|
|
18114
18381
|
break;
|
|
18115
18382
|
case 5:
|
|
18116
|
-
|
|
18383
|
+
_context24.n = 6;
|
|
18117
18384
|
return effects.call(channel.stopTyping);
|
|
18118
18385
|
case 6:
|
|
18119
|
-
|
|
18386
|
+
_context24.n = 8;
|
|
18120
18387
|
break;
|
|
18121
18388
|
case 7:
|
|
18122
|
-
|
|
18123
|
-
|
|
18124
|
-
log.error('ERROR in send typing',
|
|
18389
|
+
_context24.p = 7;
|
|
18390
|
+
_t25 = _context24.v;
|
|
18391
|
+
log.error('ERROR in send typing', _t25);
|
|
18125
18392
|
case 8:
|
|
18126
|
-
return
|
|
18393
|
+
return _context24.a(2);
|
|
18127
18394
|
}
|
|
18128
|
-
},
|
|
18395
|
+
}, _marked24, null, [[3, 7]]);
|
|
18129
18396
|
}
|
|
18130
18397
|
function sendRecording(action) {
|
|
18131
|
-
var _action$payload, state, channelId, channel,
|
|
18132
|
-
return _regenerator().w(function (
|
|
18133
|
-
while (1) switch (
|
|
18398
|
+
var _action$payload, state, channelId, channel, _t26;
|
|
18399
|
+
return _regenerator().w(function (_context25) {
|
|
18400
|
+
while (1) switch (_context25.p = _context25.n) {
|
|
18134
18401
|
case 0:
|
|
18135
18402
|
_action$payload = action.payload, state = _action$payload.state, channelId = _action$payload.channelId;
|
|
18136
|
-
|
|
18403
|
+
_context25.n = 1;
|
|
18137
18404
|
return effects.call(getChannelFromMap, channelId);
|
|
18138
18405
|
case 1:
|
|
18139
|
-
channel =
|
|
18140
|
-
|
|
18406
|
+
channel = _context25.v;
|
|
18407
|
+
_context25.p = 2;
|
|
18141
18408
|
if (!channel) {
|
|
18142
|
-
|
|
18409
|
+
_context25.n = 5;
|
|
18143
18410
|
break;
|
|
18144
18411
|
}
|
|
18145
18412
|
if (!state) {
|
|
18146
|
-
|
|
18413
|
+
_context25.n = 4;
|
|
18147
18414
|
break;
|
|
18148
18415
|
}
|
|
18149
|
-
|
|
18416
|
+
_context25.n = 3;
|
|
18150
18417
|
return effects.call(channel.startRecording);
|
|
18151
18418
|
case 3:
|
|
18152
|
-
|
|
18419
|
+
_context25.n = 5;
|
|
18153
18420
|
break;
|
|
18154
18421
|
case 4:
|
|
18155
|
-
|
|
18422
|
+
_context25.n = 5;
|
|
18156
18423
|
return effects.call(channel.stopRecording);
|
|
18157
18424
|
case 5:
|
|
18158
|
-
|
|
18425
|
+
_context25.n = 7;
|
|
18159
18426
|
break;
|
|
18160
18427
|
case 6:
|
|
18161
|
-
|
|
18162
|
-
|
|
18163
|
-
log.error('ERROR in send recording',
|
|
18428
|
+
_context25.p = 6;
|
|
18429
|
+
_t26 = _context25.v;
|
|
18430
|
+
log.error('ERROR in send recording', _t26);
|
|
18164
18431
|
case 7:
|
|
18165
|
-
return
|
|
18432
|
+
return _context25.a(2);
|
|
18166
18433
|
}
|
|
18167
|
-
},
|
|
18434
|
+
}, _marked25, null, [[2, 6]]);
|
|
18168
18435
|
}
|
|
18169
18436
|
function clearHistory(action) {
|
|
18170
|
-
var payload, channelId, channel, activeChannelId, groupName,
|
|
18171
|
-
return _regenerator().w(function (
|
|
18172
|
-
while (1) switch (
|
|
18437
|
+
var payload, channelId, channel, activeChannelId, groupName, _t27;
|
|
18438
|
+
return _regenerator().w(function (_context26) {
|
|
18439
|
+
while (1) switch (_context26.p = _context26.n) {
|
|
18173
18440
|
case 0:
|
|
18174
|
-
|
|
18441
|
+
_context26.p = 0;
|
|
18175
18442
|
payload = action.payload;
|
|
18176
18443
|
channelId = payload.channelId;
|
|
18177
|
-
|
|
18444
|
+
_context26.n = 1;
|
|
18178
18445
|
return effects.call(getChannelFromMap, channelId);
|
|
18179
18446
|
case 1:
|
|
18180
|
-
channel =
|
|
18447
|
+
channel = _context26.v;
|
|
18181
18448
|
if (!channel) {
|
|
18182
18449
|
channel = getChannelFromAllChannels(channelId);
|
|
18183
18450
|
}
|
|
18184
|
-
|
|
18451
|
+
_context26.n = 2;
|
|
18185
18452
|
return effects.call(getActiveChannelId);
|
|
18186
18453
|
case 2:
|
|
18187
|
-
activeChannelId =
|
|
18454
|
+
activeChannelId = _context26.v;
|
|
18188
18455
|
if (!channel) {
|
|
18189
|
-
|
|
18456
|
+
_context26.n = 7;
|
|
18190
18457
|
break;
|
|
18191
18458
|
}
|
|
18192
|
-
|
|
18459
|
+
_context26.n = 3;
|
|
18193
18460
|
return effects.call(channel.deleteAllMessages);
|
|
18194
18461
|
case 3:
|
|
18195
|
-
|
|
18462
|
+
_context26.n = 4;
|
|
18196
18463
|
return effects.put(clearMessagesAC());
|
|
18197
18464
|
case 4:
|
|
18198
18465
|
removeMessagesFromMap(channelId);
|
|
18199
18466
|
if (channelId === activeChannelId) {
|
|
18200
18467
|
removeAllMessages();
|
|
18201
18468
|
}
|
|
18202
|
-
|
|
18469
|
+
_context26.n = 5;
|
|
18203
18470
|
return effects.put(clearSelectedMessagesAC());
|
|
18204
18471
|
case 5:
|
|
18205
|
-
|
|
18472
|
+
_context26.n = 6;
|
|
18206
18473
|
return effects.put(updateChannelDataAC(channel.id, {
|
|
18207
18474
|
lastMessage: null,
|
|
18208
18475
|
newMessageCount: 0,
|
|
@@ -18215,64 +18482,64 @@ function clearHistory(action) {
|
|
|
18215
18482
|
newMentionCount: 0
|
|
18216
18483
|
});
|
|
18217
18484
|
groupName = getChannelGroupName(channel);
|
|
18218
|
-
|
|
18485
|
+
_context26.n = 7;
|
|
18219
18486
|
return effects.put(updateSearchedChannelDataAC(channel.id, {
|
|
18220
18487
|
lastMessage: null,
|
|
18221
18488
|
newMessageCount: 0,
|
|
18222
18489
|
newMentionCount: 0
|
|
18223
18490
|
}, groupName));
|
|
18224
18491
|
case 7:
|
|
18225
|
-
|
|
18492
|
+
_context26.n = 9;
|
|
18226
18493
|
break;
|
|
18227
18494
|
case 8:
|
|
18228
|
-
|
|
18229
|
-
|
|
18230
|
-
log.error('ERROR in clear history',
|
|
18495
|
+
_context26.p = 8;
|
|
18496
|
+
_t27 = _context26.v;
|
|
18497
|
+
log.error('ERROR in clear history', _t27);
|
|
18231
18498
|
case 9:
|
|
18232
|
-
return
|
|
18499
|
+
return _context26.a(2);
|
|
18233
18500
|
}
|
|
18234
|
-
},
|
|
18501
|
+
}, _marked26, null, [[0, 8]]);
|
|
18235
18502
|
}
|
|
18236
18503
|
function deleteAllMessages(action) {
|
|
18237
|
-
var payload, channelId, channel, activeChannelId, groupName,
|
|
18238
|
-
return _regenerator().w(function (
|
|
18239
|
-
while (1) switch (
|
|
18504
|
+
var payload, channelId, channel, activeChannelId, groupName, _t28;
|
|
18505
|
+
return _regenerator().w(function (_context27) {
|
|
18506
|
+
while (1) switch (_context27.p = _context27.n) {
|
|
18240
18507
|
case 0:
|
|
18241
|
-
|
|
18508
|
+
_context27.p = 0;
|
|
18242
18509
|
payload = action.payload;
|
|
18243
18510
|
channelId = payload.channelId;
|
|
18244
|
-
|
|
18511
|
+
_context27.n = 1;
|
|
18245
18512
|
return effects.call(getChannelFromMap, channelId);
|
|
18246
18513
|
case 1:
|
|
18247
|
-
channel =
|
|
18514
|
+
channel = _context27.v;
|
|
18248
18515
|
if (!channel) {
|
|
18249
18516
|
channel = getChannelFromAllChannels(channelId);
|
|
18250
18517
|
}
|
|
18251
|
-
|
|
18518
|
+
_context27.n = 2;
|
|
18252
18519
|
return effects.call(getActiveChannelId);
|
|
18253
18520
|
case 2:
|
|
18254
|
-
activeChannelId =
|
|
18521
|
+
activeChannelId = _context27.v;
|
|
18255
18522
|
if (!channel) {
|
|
18256
|
-
|
|
18523
|
+
_context27.n = 8;
|
|
18257
18524
|
break;
|
|
18258
18525
|
}
|
|
18259
|
-
|
|
18526
|
+
_context27.n = 3;
|
|
18260
18527
|
return effects.call(channel.deleteAllMessages, true);
|
|
18261
18528
|
case 3:
|
|
18262
18529
|
removeMessagesFromMap(channelId);
|
|
18263
18530
|
if (!(channelId === activeChannelId)) {
|
|
18264
|
-
|
|
18531
|
+
_context27.n = 5;
|
|
18265
18532
|
break;
|
|
18266
18533
|
}
|
|
18267
|
-
|
|
18534
|
+
_context27.n = 4;
|
|
18268
18535
|
return effects.put(clearMessagesAC());
|
|
18269
18536
|
case 4:
|
|
18270
18537
|
removeAllMessages();
|
|
18271
18538
|
case 5:
|
|
18272
|
-
|
|
18539
|
+
_context27.n = 6;
|
|
18273
18540
|
return effects.put(clearSelectedMessagesAC());
|
|
18274
18541
|
case 6:
|
|
18275
|
-
|
|
18542
|
+
_context27.n = 7;
|
|
18276
18543
|
return effects.put(updateChannelDataAC(channel.id, {
|
|
18277
18544
|
lastMessage: null,
|
|
18278
18545
|
newMessageCount: 0,
|
|
@@ -18285,230 +18552,230 @@ function deleteAllMessages(action) {
|
|
|
18285
18552
|
newMentionCount: 0
|
|
18286
18553
|
});
|
|
18287
18554
|
groupName = getChannelGroupName(channel);
|
|
18288
|
-
|
|
18555
|
+
_context27.n = 8;
|
|
18289
18556
|
return effects.put(updateSearchedChannelDataAC(channel.id, {
|
|
18290
18557
|
lastMessage: null,
|
|
18291
18558
|
newMessageCount: 0,
|
|
18292
18559
|
newMentionCount: 0
|
|
18293
18560
|
}, groupName));
|
|
18294
18561
|
case 8:
|
|
18295
|
-
|
|
18562
|
+
_context27.n = 10;
|
|
18296
18563
|
break;
|
|
18297
18564
|
case 9:
|
|
18298
|
-
|
|
18299
|
-
|
|
18300
|
-
log.error('ERROR in clear history',
|
|
18565
|
+
_context27.p = 9;
|
|
18566
|
+
_t28 = _context27.v;
|
|
18567
|
+
log.error('ERROR in clear history', _t28);
|
|
18301
18568
|
case 10:
|
|
18302
|
-
return
|
|
18569
|
+
return _context27.a(2);
|
|
18303
18570
|
}
|
|
18304
|
-
},
|
|
18571
|
+
}, _marked27, null, [[0, 9]]);
|
|
18305
18572
|
}
|
|
18306
18573
|
function joinChannel(action) {
|
|
18307
|
-
var payload, channelId, _SceytChatClient8, channel, joinedChannel,
|
|
18308
|
-
return _regenerator().w(function (
|
|
18309
|
-
while (1) switch (
|
|
18574
|
+
var payload, channelId, _SceytChatClient8, channel, joinedChannel, _t29;
|
|
18575
|
+
return _regenerator().w(function (_context28) {
|
|
18576
|
+
while (1) switch (_context28.p = _context28.n) {
|
|
18310
18577
|
case 0:
|
|
18311
|
-
|
|
18578
|
+
_context28.p = 0;
|
|
18312
18579
|
payload = action.payload;
|
|
18313
18580
|
channelId = payload.channelId;
|
|
18314
18581
|
_SceytChatClient8 = getClient();
|
|
18315
|
-
|
|
18582
|
+
_context28.n = 1;
|
|
18316
18583
|
return effects.call(getChannelFromMap, channelId);
|
|
18317
18584
|
case 1:
|
|
18318
|
-
channel =
|
|
18585
|
+
channel = _context28.v;
|
|
18319
18586
|
if (!channel) {
|
|
18320
18587
|
channel = getChannelFromAllChannels(channelId);
|
|
18321
18588
|
}
|
|
18322
18589
|
if (channel) {
|
|
18323
|
-
|
|
18590
|
+
_context28.n = 3;
|
|
18324
18591
|
break;
|
|
18325
18592
|
}
|
|
18326
|
-
|
|
18593
|
+
_context28.n = 2;
|
|
18327
18594
|
return effects.call(_SceytChatClient8.getChannel, channelId);
|
|
18328
18595
|
case 2:
|
|
18329
|
-
channel =
|
|
18596
|
+
channel = _context28.v;
|
|
18330
18597
|
case 3:
|
|
18331
|
-
|
|
18598
|
+
_context28.n = 4;
|
|
18332
18599
|
return effects.call(channel.join);
|
|
18333
18600
|
case 4:
|
|
18334
|
-
joinedChannel =
|
|
18335
|
-
|
|
18601
|
+
joinedChannel = _context28.v;
|
|
18602
|
+
_context28.n = 5;
|
|
18336
18603
|
return effects.put(setCloseSearchChannelsAC(true));
|
|
18337
18604
|
case 5:
|
|
18338
|
-
|
|
18605
|
+
_context28.n = 6;
|
|
18339
18606
|
return effects.put(setChannelToAddAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
18340
18607
|
case 6:
|
|
18341
|
-
|
|
18608
|
+
_context28.n = 7;
|
|
18342
18609
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(joinedChannel))));
|
|
18343
18610
|
case 7:
|
|
18344
18611
|
addChannelToAllChannels(joinedChannel);
|
|
18345
|
-
|
|
18612
|
+
_context28.n = 8;
|
|
18346
18613
|
return effects.call(setActiveChannelId, joinedChannel.id);
|
|
18347
18614
|
case 8:
|
|
18348
|
-
|
|
18615
|
+
_context28.n = 10;
|
|
18349
18616
|
break;
|
|
18350
18617
|
case 9:
|
|
18351
|
-
|
|
18352
|
-
|
|
18353
|
-
log.error(
|
|
18618
|
+
_context28.p = 9;
|
|
18619
|
+
_t29 = _context28.v;
|
|
18620
|
+
log.error(_t29, 'Error in join to channel');
|
|
18354
18621
|
case 10:
|
|
18355
|
-
return
|
|
18622
|
+
return _context28.a(2);
|
|
18356
18623
|
}
|
|
18357
|
-
},
|
|
18624
|
+
}, _marked28, null, [[0, 9]]);
|
|
18358
18625
|
}
|
|
18359
18626
|
function watchForChannelEvents() {
|
|
18360
|
-
return _regenerator().w(function (
|
|
18361
|
-
while (1) switch (
|
|
18627
|
+
return _regenerator().w(function (_context29) {
|
|
18628
|
+
while (1) switch (_context29.n) {
|
|
18362
18629
|
case 0:
|
|
18363
|
-
|
|
18630
|
+
_context29.n = 1;
|
|
18364
18631
|
return effects.call(watchForEvents);
|
|
18365
18632
|
case 1:
|
|
18366
|
-
return
|
|
18633
|
+
return _context29.a(2);
|
|
18367
18634
|
}
|
|
18368
|
-
},
|
|
18635
|
+
}, _marked29);
|
|
18369
18636
|
}
|
|
18370
18637
|
function createChannelInviteKey(action) {
|
|
18371
|
-
var payload, channelId, _SceytChatClient9, channel, inviteKey,
|
|
18372
|
-
return _regenerator().w(function (
|
|
18373
|
-
while (1) switch (
|
|
18638
|
+
var payload, channelId, _SceytChatClient9, channel, inviteKey, _t30;
|
|
18639
|
+
return _regenerator().w(function (_context30) {
|
|
18640
|
+
while (1) switch (_context30.p = _context30.n) {
|
|
18374
18641
|
case 0:
|
|
18375
|
-
|
|
18642
|
+
_context30.p = 0;
|
|
18376
18643
|
payload = action.payload;
|
|
18377
18644
|
channelId = payload.channelId;
|
|
18378
18645
|
_SceytChatClient9 = getClient();
|
|
18379
|
-
|
|
18646
|
+
_context30.n = 1;
|
|
18380
18647
|
return effects.call(getChannelFromMap, channelId);
|
|
18381
18648
|
case 1:
|
|
18382
|
-
channel =
|
|
18649
|
+
channel = _context30.v;
|
|
18383
18650
|
if (!channel) {
|
|
18384
18651
|
channel = getChannelFromAllChannels(channelId);
|
|
18385
18652
|
}
|
|
18386
18653
|
if (!channel) {
|
|
18387
|
-
|
|
18654
|
+
_context30.n = 3;
|
|
18388
18655
|
break;
|
|
18389
18656
|
}
|
|
18390
|
-
|
|
18657
|
+
_context30.n = 2;
|
|
18391
18658
|
return effects.call(_SceytChatClient9.createInviteKey, {
|
|
18392
18659
|
maxUses: 0,
|
|
18393
18660
|
expiresAt: 0,
|
|
18394
18661
|
accessPriorHistory: true
|
|
18395
18662
|
});
|
|
18396
18663
|
case 2:
|
|
18397
|
-
inviteKey =
|
|
18398
|
-
|
|
18664
|
+
inviteKey = _context30.v;
|
|
18665
|
+
_context30.n = 3;
|
|
18399
18666
|
return effects.put(setChannelInviteKeysAC(channelId, [inviteKey]));
|
|
18400
18667
|
case 3:
|
|
18401
|
-
|
|
18668
|
+
_context30.n = 5;
|
|
18402
18669
|
break;
|
|
18403
18670
|
case 4:
|
|
18404
|
-
|
|
18405
|
-
|
|
18406
|
-
log.error('ERROR in create channel invite key',
|
|
18671
|
+
_context30.p = 4;
|
|
18672
|
+
_t30 = _context30.v;
|
|
18673
|
+
log.error('ERROR in create channel invite key', _t30);
|
|
18407
18674
|
case 5:
|
|
18408
|
-
return
|
|
18675
|
+
return _context30.a(2);
|
|
18409
18676
|
}
|
|
18410
|
-
},
|
|
18677
|
+
}, _marked30, null, [[0, 4]]);
|
|
18411
18678
|
}
|
|
18412
18679
|
function getChannelInviteKeys(action) {
|
|
18413
|
-
var payload, channelId, channel, inviteKeys,
|
|
18414
|
-
return _regenerator().w(function (
|
|
18415
|
-
while (1) switch (
|
|
18680
|
+
var payload, channelId, channel, inviteKeys, _t31;
|
|
18681
|
+
return _regenerator().w(function (_context31) {
|
|
18682
|
+
while (1) switch (_context31.p = _context31.n) {
|
|
18416
18683
|
case 0:
|
|
18417
|
-
|
|
18684
|
+
_context31.p = 0;
|
|
18418
18685
|
payload = action.payload;
|
|
18419
18686
|
channelId = payload.channelId;
|
|
18420
|
-
|
|
18687
|
+
_context31.n = 1;
|
|
18421
18688
|
return effects.call(getChannelFromMap, channelId);
|
|
18422
18689
|
case 1:
|
|
18423
|
-
channel =
|
|
18690
|
+
channel = _context31.v;
|
|
18424
18691
|
if (!channel) {
|
|
18425
18692
|
channel = getChannelFromAllChannels(channelId);
|
|
18426
18693
|
}
|
|
18427
18694
|
if (!channel) {
|
|
18428
|
-
|
|
18695
|
+
_context31.n = 3;
|
|
18429
18696
|
break;
|
|
18430
18697
|
}
|
|
18431
|
-
|
|
18698
|
+
_context31.n = 2;
|
|
18432
18699
|
return effects.call(channel.getInviteKeys);
|
|
18433
18700
|
case 2:
|
|
18434
|
-
inviteKeys =
|
|
18435
|
-
|
|
18701
|
+
inviteKeys = _context31.v;
|
|
18702
|
+
_context31.n = 3;
|
|
18436
18703
|
return effects.put(setChannelInviteKeysAC(channelId, inviteKeys));
|
|
18437
18704
|
case 3:
|
|
18438
|
-
|
|
18705
|
+
_context31.n = 5;
|
|
18439
18706
|
break;
|
|
18440
18707
|
case 4:
|
|
18441
|
-
|
|
18442
|
-
|
|
18443
|
-
log.error('ERROR in get channel invite keys',
|
|
18708
|
+
_context31.p = 4;
|
|
18709
|
+
_t31 = _context31.v;
|
|
18710
|
+
log.error('ERROR in get channel invite keys', _t31);
|
|
18444
18711
|
case 5:
|
|
18445
|
-
return
|
|
18712
|
+
return _context31.a(2);
|
|
18446
18713
|
}
|
|
18447
|
-
},
|
|
18714
|
+
}, _marked31, null, [[0, 4]]);
|
|
18448
18715
|
}
|
|
18449
18716
|
function regenerateChannelInviteKey(action) {
|
|
18450
|
-
var payload, channelId, key, deletePermanently, channel, inviteKey,
|
|
18451
|
-
return _regenerator().w(function (
|
|
18452
|
-
while (1) switch (
|
|
18717
|
+
var payload, channelId, key, deletePermanently, channel, inviteKey, _t32;
|
|
18718
|
+
return _regenerator().w(function (_context32) {
|
|
18719
|
+
while (1) switch (_context32.p = _context32.n) {
|
|
18453
18720
|
case 0:
|
|
18454
|
-
|
|
18721
|
+
_context32.p = 0;
|
|
18455
18722
|
payload = action.payload;
|
|
18456
18723
|
channelId = payload.channelId, key = payload.key, deletePermanently = payload.deletePermanently;
|
|
18457
|
-
|
|
18724
|
+
_context32.n = 1;
|
|
18458
18725
|
return effects.call(getChannelFromMap, channelId);
|
|
18459
18726
|
case 1:
|
|
18460
|
-
channel =
|
|
18727
|
+
channel = _context32.v;
|
|
18461
18728
|
if (!channel) {
|
|
18462
18729
|
channel = getChannelFromAllChannels(channelId);
|
|
18463
18730
|
}
|
|
18464
18731
|
if (!channel) {
|
|
18465
|
-
|
|
18732
|
+
_context32.n = 3;
|
|
18466
18733
|
break;
|
|
18467
18734
|
}
|
|
18468
|
-
|
|
18735
|
+
_context32.n = 2;
|
|
18469
18736
|
return effects.call(channel.regenerateInviteKey, {
|
|
18470
18737
|
key: key,
|
|
18471
18738
|
channelId: channelId,
|
|
18472
18739
|
deletePermanently: deletePermanently
|
|
18473
18740
|
});
|
|
18474
18741
|
case 2:
|
|
18475
|
-
inviteKey =
|
|
18476
|
-
|
|
18742
|
+
inviteKey = _context32.v;
|
|
18743
|
+
_context32.n = 3;
|
|
18477
18744
|
return effects.put(setChannelInviteKeysAC(channelId, [inviteKey]));
|
|
18478
18745
|
case 3:
|
|
18479
|
-
|
|
18746
|
+
_context32.n = 5;
|
|
18480
18747
|
break;
|
|
18481
18748
|
case 4:
|
|
18482
|
-
|
|
18483
|
-
|
|
18484
|
-
log.error('ERROR in regenerate channel invite key',
|
|
18749
|
+
_context32.p = 4;
|
|
18750
|
+
_t32 = _context32.v;
|
|
18751
|
+
log.error('ERROR in regenerate channel invite key', _t32);
|
|
18485
18752
|
case 5:
|
|
18486
|
-
return
|
|
18753
|
+
return _context32.a(2);
|
|
18487
18754
|
}
|
|
18488
|
-
},
|
|
18755
|
+
}, _marked32, null, [[0, 4]]);
|
|
18489
18756
|
}
|
|
18490
18757
|
function updateChannelInviteKey(action) {
|
|
18491
|
-
var channelInviteKeys, channelId, payload, payloadChannelId, key, accessPriorHistory, expiresAt, maxUses, channel, copiedChannelInviteKeys,
|
|
18492
|
-
return _regenerator().w(function (
|
|
18493
|
-
while (1) switch (
|
|
18758
|
+
var channelInviteKeys, channelId, payload, payloadChannelId, key, accessPriorHistory, expiresAt, maxUses, channel, copiedChannelInviteKeys, _t33;
|
|
18759
|
+
return _regenerator().w(function (_context33) {
|
|
18760
|
+
while (1) switch (_context33.p = _context33.n) {
|
|
18494
18761
|
case 0:
|
|
18495
18762
|
channelInviteKeys = [];
|
|
18496
18763
|
channelId = '';
|
|
18497
|
-
|
|
18764
|
+
_context33.p = 1;
|
|
18498
18765
|
payload = action.payload;
|
|
18499
18766
|
payloadChannelId = payload.channelId, key = payload.key, accessPriorHistory = payload.accessPriorHistory, expiresAt = payload.expiresAt, maxUses = payload.maxUses;
|
|
18500
18767
|
channelId = payloadChannelId;
|
|
18501
|
-
|
|
18768
|
+
_context33.n = 2;
|
|
18502
18769
|
return effects.call(getChannelFromMap, channelId);
|
|
18503
18770
|
case 2:
|
|
18504
|
-
channel =
|
|
18771
|
+
channel = _context33.v;
|
|
18505
18772
|
if (!channel) {
|
|
18506
18773
|
channel = getChannelFromAllChannels(channelId);
|
|
18507
18774
|
}
|
|
18508
18775
|
channelInviteKeys = store.getState().ChannelReducer.channelInviteKeys[channelId];
|
|
18509
18776
|
copiedChannelInviteKeys = JSON.parse(JSON.stringify(channelInviteKeys));
|
|
18510
18777
|
if (!copiedChannelInviteKeys) {
|
|
18511
|
-
|
|
18778
|
+
_context33.n = 3;
|
|
18512
18779
|
break;
|
|
18513
18780
|
}
|
|
18514
18781
|
copiedChannelInviteKeys.forEach(function (inviteKey) {
|
|
@@ -18518,14 +18785,14 @@ function updateChannelInviteKey(action) {
|
|
|
18518
18785
|
inviteKey.maxUses = maxUses;
|
|
18519
18786
|
}
|
|
18520
18787
|
});
|
|
18521
|
-
|
|
18788
|
+
_context33.n = 3;
|
|
18522
18789
|
return effects.put(setChannelInviteKeysAC(channelId, copiedChannelInviteKeys));
|
|
18523
18790
|
case 3:
|
|
18524
18791
|
if (!channel) {
|
|
18525
|
-
|
|
18792
|
+
_context33.n = 4;
|
|
18526
18793
|
break;
|
|
18527
18794
|
}
|
|
18528
|
-
|
|
18795
|
+
_context33.n = 4;
|
|
18529
18796
|
return effects.call(channel.updateInviteKey, {
|
|
18530
18797
|
key: key,
|
|
18531
18798
|
channelId: channelId,
|
|
@@ -18534,88 +18801,88 @@ function updateChannelInviteKey(action) {
|
|
|
18534
18801
|
accessPriorHistory: accessPriorHistory
|
|
18535
18802
|
});
|
|
18536
18803
|
case 4:
|
|
18537
|
-
|
|
18804
|
+
_context33.n = 6;
|
|
18538
18805
|
break;
|
|
18539
18806
|
case 5:
|
|
18540
|
-
|
|
18541
|
-
|
|
18542
|
-
log.error('ERROR in update channel invite key',
|
|
18543
|
-
|
|
18807
|
+
_context33.p = 5;
|
|
18808
|
+
_t33 = _context33.v;
|
|
18809
|
+
log.error('ERROR in update channel invite key', _t33);
|
|
18810
|
+
_context33.n = 6;
|
|
18544
18811
|
return effects.put(setChannelInviteKeysAC(channelId, channelInviteKeys));
|
|
18545
18812
|
case 6:
|
|
18546
|
-
return
|
|
18813
|
+
return _context33.a(2);
|
|
18547
18814
|
}
|
|
18548
|
-
},
|
|
18815
|
+
}, _marked33, null, [[1, 5]]);
|
|
18549
18816
|
}
|
|
18550
18817
|
function getChannelByInviteKey(action) {
|
|
18551
|
-
var _channel$, _channel$2, payload, key, _SceytChatClient0, channel,
|
|
18552
|
-
return _regenerator().w(function (
|
|
18553
|
-
while (1) switch (
|
|
18818
|
+
var _channel$, _channel$2, payload, key, _SceytChatClient0, channel, _t34;
|
|
18819
|
+
return _regenerator().w(function (_context34) {
|
|
18820
|
+
while (1) switch (_context34.p = _context34.n) {
|
|
18554
18821
|
case 0:
|
|
18555
|
-
|
|
18822
|
+
_context34.p = 0;
|
|
18556
18823
|
payload = action.payload;
|
|
18557
18824
|
key = payload.key;
|
|
18558
18825
|
_SceytChatClient0 = getClient();
|
|
18559
|
-
|
|
18826
|
+
_context34.n = 1;
|
|
18560
18827
|
return effects.call(_SceytChatClient0.Channel.getChannelByInviteKey, key);
|
|
18561
18828
|
case 1:
|
|
18562
|
-
channel =
|
|
18829
|
+
channel = _context34.v;
|
|
18563
18830
|
if (!(channel && channel.length > 0 && !((_channel$ = channel[0]) !== null && _channel$ !== void 0 && _channel$.role))) {
|
|
18564
|
-
|
|
18831
|
+
_context34.n = 3;
|
|
18565
18832
|
break;
|
|
18566
18833
|
}
|
|
18567
|
-
|
|
18834
|
+
_context34.n = 2;
|
|
18568
18835
|
return effects.put(setJoinableChannelAC(JSON.parse(JSON.stringify(channel[0]))));
|
|
18569
18836
|
case 2:
|
|
18570
18837
|
window.history.pushState({}, '', window.location.pathname + '?join=' + key);
|
|
18571
|
-
|
|
18838
|
+
_context34.n = 5;
|
|
18572
18839
|
break;
|
|
18573
18840
|
case 3:
|
|
18574
18841
|
if (!(channel && channel.length > 0 && (_channel$2 = channel[0]) !== null && _channel$2 !== void 0 && _channel$2.role)) {
|
|
18575
|
-
|
|
18842
|
+
_context34.n = 5;
|
|
18576
18843
|
break;
|
|
18577
18844
|
}
|
|
18578
|
-
|
|
18845
|
+
_context34.n = 4;
|
|
18579
18846
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(channel[0]))));
|
|
18580
18847
|
case 4:
|
|
18581
18848
|
window.history.pushState({}, '', window.location.pathname);
|
|
18582
18849
|
case 5:
|
|
18583
|
-
|
|
18850
|
+
_context34.n = 8;
|
|
18584
18851
|
break;
|
|
18585
18852
|
case 6:
|
|
18586
|
-
|
|
18587
|
-
|
|
18588
|
-
if (!(
|
|
18589
|
-
|
|
18853
|
+
_context34.p = 6;
|
|
18854
|
+
_t34 = _context34.v;
|
|
18855
|
+
if (!(_t34.code === 1109)) {
|
|
18856
|
+
_context34.n = 7;
|
|
18590
18857
|
break;
|
|
18591
18858
|
}
|
|
18592
|
-
|
|
18859
|
+
_context34.n = 7;
|
|
18593
18860
|
return effects.put(setChannelInviteKeyAvailableAC(false));
|
|
18594
18861
|
case 7:
|
|
18595
|
-
log.error('ERROR in get channel by invite key',
|
|
18862
|
+
log.error('ERROR in get channel by invite key', _t34);
|
|
18596
18863
|
case 8:
|
|
18597
|
-
return
|
|
18864
|
+
return _context34.a(2);
|
|
18598
18865
|
}
|
|
18599
|
-
},
|
|
18866
|
+
}, _marked34, null, [[0, 6]]);
|
|
18600
18867
|
}
|
|
18601
18868
|
function joinChannelWithInviteKey(action) {
|
|
18602
|
-
var payload, key, _SceytChatClient1, user, channel, messageToSend,
|
|
18603
|
-
return _regenerator().w(function (
|
|
18604
|
-
while (1) switch (
|
|
18869
|
+
var payload, key, _SceytChatClient1, user, channel, messageToSend, _t35;
|
|
18870
|
+
return _regenerator().w(function (_context35) {
|
|
18871
|
+
while (1) switch (_context35.p = _context35.n) {
|
|
18605
18872
|
case 0:
|
|
18606
|
-
|
|
18873
|
+
_context35.p = 0;
|
|
18607
18874
|
payload = action.payload;
|
|
18608
18875
|
key = payload.key;
|
|
18609
18876
|
_SceytChatClient1 = getClient();
|
|
18610
18877
|
user = _SceytChatClient1.user;
|
|
18611
|
-
|
|
18878
|
+
_context35.n = 1;
|
|
18612
18879
|
return effects.call(_SceytChatClient1.Channel.joinChannelByInviteKey, key);
|
|
18613
18880
|
case 1:
|
|
18614
|
-
channel =
|
|
18615
|
-
|
|
18881
|
+
channel = _context35.v;
|
|
18882
|
+
_context35.n = 2;
|
|
18616
18883
|
return effects.put(setJoinableChannelAC(null));
|
|
18617
18884
|
case 2:
|
|
18618
|
-
|
|
18885
|
+
_context35.n = 3;
|
|
18619
18886
|
return effects.call(setChannelInMap, channel);
|
|
18620
18887
|
case 3:
|
|
18621
18888
|
messageToSend = {
|
|
@@ -18624,47 +18891,47 @@ function joinChannelWithInviteKey(action) {
|
|
|
18624
18891
|
attachments: [],
|
|
18625
18892
|
type: 'system'
|
|
18626
18893
|
};
|
|
18627
|
-
|
|
18894
|
+
_context35.n = 4;
|
|
18628
18895
|
return effects.put(sendTextMessageAC(messageToSend, channel === null || channel === void 0 ? void 0 : channel.id, CONNECTION_STATUS.CONNECTED));
|
|
18629
18896
|
case 4:
|
|
18630
|
-
|
|
18897
|
+
_context35.n = 5;
|
|
18631
18898
|
return effects.put(switchChannelActionAC(JSON.parse(JSON.stringify(channel))));
|
|
18632
18899
|
case 5:
|
|
18633
18900
|
window.history.pushState({}, '', window.location.pathname);
|
|
18634
|
-
|
|
18901
|
+
_context35.n = 7;
|
|
18635
18902
|
break;
|
|
18636
18903
|
case 6:
|
|
18637
|
-
|
|
18638
|
-
|
|
18639
|
-
log.error('ERROR in join channel with invite key',
|
|
18904
|
+
_context35.p = 6;
|
|
18905
|
+
_t35 = _context35.v;
|
|
18906
|
+
log.error('ERROR in join channel with invite key', _t35);
|
|
18640
18907
|
case 7:
|
|
18641
|
-
return
|
|
18908
|
+
return _context35.a(2);
|
|
18642
18909
|
}
|
|
18643
|
-
},
|
|
18910
|
+
}, _marked35, null, [[0, 6]]);
|
|
18644
18911
|
}
|
|
18645
18912
|
function setMessageRetentionPeriod(action) {
|
|
18646
|
-
var payload, channelId, periodInMilliseconds, channel, messageToSend,
|
|
18647
|
-
return _regenerator().w(function (
|
|
18648
|
-
while (1) switch (
|
|
18913
|
+
var payload, channelId, periodInMilliseconds, channel, messageToSend, _t36;
|
|
18914
|
+
return _regenerator().w(function (_context36) {
|
|
18915
|
+
while (1) switch (_context36.p = _context36.n) {
|
|
18649
18916
|
case 0:
|
|
18650
|
-
|
|
18917
|
+
_context36.p = 0;
|
|
18651
18918
|
payload = action.payload;
|
|
18652
18919
|
channelId = payload.channelId, periodInMilliseconds = payload.periodInMilliseconds;
|
|
18653
|
-
|
|
18920
|
+
_context36.n = 1;
|
|
18654
18921
|
return effects.call(getChannelFromMap, channelId);
|
|
18655
18922
|
case 1:
|
|
18656
|
-
channel =
|
|
18923
|
+
channel = _context36.v;
|
|
18657
18924
|
if (!channel) {
|
|
18658
18925
|
channel = getChannelFromAllChannels(channelId);
|
|
18659
18926
|
}
|
|
18660
18927
|
if (!channel) {
|
|
18661
|
-
|
|
18928
|
+
_context36.n = 4;
|
|
18662
18929
|
break;
|
|
18663
18930
|
}
|
|
18664
|
-
|
|
18931
|
+
_context36.n = 2;
|
|
18665
18932
|
return effects.call(channel.setMessageRetentionPeriod, periodInMilliseconds);
|
|
18666
18933
|
case 2:
|
|
18667
|
-
|
|
18934
|
+
_context36.n = 3;
|
|
18668
18935
|
return effects.put(updateChannelDataAC(channelId, {
|
|
18669
18936
|
messageRetentionPeriod: periodInMilliseconds
|
|
18670
18937
|
}));
|
|
@@ -18681,264 +18948,265 @@ function setMessageRetentionPeriod(action) {
|
|
|
18681
18948
|
attachments: [],
|
|
18682
18949
|
type: 'system'
|
|
18683
18950
|
};
|
|
18684
|
-
|
|
18951
|
+
_context36.n = 4;
|
|
18685
18952
|
return effects.put(sendTextMessageAC(messageToSend, channelId, CONNECTION_STATUS.CONNECTED));
|
|
18686
18953
|
case 4:
|
|
18687
|
-
|
|
18954
|
+
_context36.n = 6;
|
|
18688
18955
|
break;
|
|
18689
18956
|
case 5:
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
log.error('ERROR in set message retention period',
|
|
18957
|
+
_context36.p = 5;
|
|
18958
|
+
_t36 = _context36.v;
|
|
18959
|
+
log.error('ERROR in set message retention period', _t36);
|
|
18693
18960
|
case 6:
|
|
18694
|
-
return
|
|
18961
|
+
return _context36.a(2);
|
|
18695
18962
|
}
|
|
18696
|
-
},
|
|
18963
|
+
}, _marked36, null, [[0, 5]]);
|
|
18697
18964
|
}
|
|
18698
18965
|
function getChannelsWithUser(action) {
|
|
18699
|
-
var payload, userId, _SceytChatClient10, channelsQueryBuilder, channelsQuery, channelsData, channels,
|
|
18700
|
-
return _regenerator().w(function (
|
|
18701
|
-
while (1) switch (
|
|
18966
|
+
var payload, userId, _SceytChatClient10, channelsQueryBuilder, channelsQuery, channelsData, channels, _t37;
|
|
18967
|
+
return _regenerator().w(function (_context37) {
|
|
18968
|
+
while (1) switch (_context37.p = _context37.n) {
|
|
18702
18969
|
case 0:
|
|
18703
|
-
|
|
18970
|
+
_context37.n = 1;
|
|
18704
18971
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18705
18972
|
case 1:
|
|
18706
|
-
|
|
18973
|
+
_context37.n = 2;
|
|
18707
18974
|
return effects.put(setMutualChannelsAC([]));
|
|
18708
18975
|
case 2:
|
|
18709
|
-
|
|
18976
|
+
_context37.p = 2;
|
|
18710
18977
|
payload = action.payload;
|
|
18711
18978
|
userId = payload.userId;
|
|
18712
18979
|
_SceytChatClient10 = getClient();
|
|
18713
18980
|
channelsQueryBuilder = new _SceytChatClient10.ChannelListQueryBuilder();
|
|
18714
18981
|
channelsQueryBuilder.memberCount(0);
|
|
18715
18982
|
channelsQueryBuilder.setMutualWithUserId(userId);
|
|
18983
|
+
channelsQueryBuilder.withExcludeTypes([DEFAULT_CHANNEL_TYPE.DIRECT]);
|
|
18716
18984
|
channelsQueryBuilder.limit(15);
|
|
18717
|
-
|
|
18985
|
+
_context37.n = 3;
|
|
18718
18986
|
return effects.call(channelsQueryBuilder.build);
|
|
18719
18987
|
case 3:
|
|
18720
|
-
channelsQuery =
|
|
18988
|
+
channelsQuery = _context37.v;
|
|
18721
18989
|
query.mutualChannelsQuery = channelsQuery;
|
|
18722
|
-
|
|
18990
|
+
_context37.n = 4;
|
|
18723
18991
|
return effects.call(channelsQuery.loadNextPage);
|
|
18724
18992
|
case 4:
|
|
18725
|
-
channelsData =
|
|
18993
|
+
channelsData = _context37.v;
|
|
18726
18994
|
channels = channelsData.channels;
|
|
18727
18995
|
if (!channelsData.hasNext) {
|
|
18728
|
-
|
|
18996
|
+
_context37.n = 6;
|
|
18729
18997
|
break;
|
|
18730
18998
|
}
|
|
18731
|
-
|
|
18999
|
+
_context37.n = 5;
|
|
18732
19000
|
return effects.put(setMutualChannelsHasNextAC(true));
|
|
18733
19001
|
case 5:
|
|
18734
|
-
|
|
19002
|
+
_context37.n = 7;
|
|
18735
19003
|
break;
|
|
18736
19004
|
case 6:
|
|
18737
|
-
|
|
19005
|
+
_context37.n = 7;
|
|
18738
19006
|
return effects.put(setMutualChannelsHasNextAC(false));
|
|
18739
19007
|
case 7:
|
|
18740
|
-
|
|
19008
|
+
_context37.n = 8;
|
|
18741
19009
|
return effects.put(setMutualChannelsAC(channels));
|
|
18742
19010
|
case 8:
|
|
18743
|
-
|
|
19011
|
+
_context37.n = 10;
|
|
18744
19012
|
break;
|
|
18745
19013
|
case 9:
|
|
18746
|
-
|
|
18747
|
-
|
|
18748
|
-
log.error('ERROR in get groups in common',
|
|
19014
|
+
_context37.p = 9;
|
|
19015
|
+
_t37 = _context37.v;
|
|
19016
|
+
log.error('ERROR in get groups in common', _t37);
|
|
18749
19017
|
case 10:
|
|
18750
|
-
|
|
18751
|
-
|
|
19018
|
+
_context37.p = 10;
|
|
19019
|
+
_context37.n = 11;
|
|
18752
19020
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18753
19021
|
case 11:
|
|
18754
|
-
return
|
|
19022
|
+
return _context37.f(10);
|
|
18755
19023
|
case 12:
|
|
18756
|
-
return
|
|
19024
|
+
return _context37.a(2);
|
|
18757
19025
|
}
|
|
18758
|
-
},
|
|
19026
|
+
}, _marked37, null, [[2, 9, 10, 12]]);
|
|
18759
19027
|
}
|
|
18760
19028
|
function loadMoreMutualChannels(action) {
|
|
18761
|
-
var payload, limit, mutualChannelsQuery, channelsData,
|
|
18762
|
-
return _regenerator().w(function (
|
|
18763
|
-
while (1) switch (
|
|
19029
|
+
var payload, limit, mutualChannelsQuery, channelsData, _t38;
|
|
19030
|
+
return _regenerator().w(function (_context38) {
|
|
19031
|
+
while (1) switch (_context38.p = _context38.n) {
|
|
18764
19032
|
case 0:
|
|
18765
|
-
|
|
19033
|
+
_context38.n = 1;
|
|
18766
19034
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18767
19035
|
case 1:
|
|
18768
|
-
|
|
19036
|
+
_context38.p = 1;
|
|
18769
19037
|
payload = action.payload;
|
|
18770
19038
|
limit = payload.limit;
|
|
18771
19039
|
mutualChannelsQuery = query.mutualChannelsQuery;
|
|
18772
19040
|
if (mutualChannelsQuery) {
|
|
18773
|
-
|
|
19041
|
+
_context38.n = 2;
|
|
18774
19042
|
break;
|
|
18775
19043
|
}
|
|
18776
|
-
return
|
|
19044
|
+
return _context38.a(2);
|
|
18777
19045
|
case 2:
|
|
18778
19046
|
if (limit) {
|
|
18779
19047
|
mutualChannelsQuery.limit = limit;
|
|
18780
19048
|
}
|
|
18781
|
-
|
|
19049
|
+
_context38.n = 3;
|
|
18782
19050
|
return effects.call(mutualChannelsQuery.loadNextPage);
|
|
18783
19051
|
case 3:
|
|
18784
|
-
channelsData =
|
|
19052
|
+
channelsData = _context38.v;
|
|
18785
19053
|
if (!channelsData.hasNext) {
|
|
18786
|
-
|
|
19054
|
+
_context38.n = 5;
|
|
18787
19055
|
break;
|
|
18788
19056
|
}
|
|
18789
|
-
|
|
19057
|
+
_context38.n = 4;
|
|
18790
19058
|
return effects.put(setMutualChannelsHasNextAC(true));
|
|
18791
19059
|
case 4:
|
|
18792
|
-
|
|
19060
|
+
_context38.n = 6;
|
|
18793
19061
|
break;
|
|
18794
19062
|
case 5:
|
|
18795
|
-
|
|
19063
|
+
_context38.n = 6;
|
|
18796
19064
|
return effects.put(setMutualChannelsHasNextAC(false));
|
|
18797
19065
|
case 6:
|
|
18798
|
-
|
|
19066
|
+
_context38.n = 7;
|
|
18799
19067
|
return effects.put(setMutualChannelsAC(channelsData.channels));
|
|
18800
19068
|
case 7:
|
|
18801
|
-
|
|
19069
|
+
_context38.n = 9;
|
|
18802
19070
|
break;
|
|
18803
19071
|
case 8:
|
|
18804
|
-
|
|
18805
|
-
|
|
18806
|
-
log.error('ERROR in load more mutual channels',
|
|
19072
|
+
_context38.p = 8;
|
|
19073
|
+
_t38 = _context38.v;
|
|
19074
|
+
log.error('ERROR in load more mutual channels', _t38);
|
|
18807
19075
|
case 9:
|
|
18808
|
-
|
|
18809
|
-
|
|
19076
|
+
_context38.p = 9;
|
|
19077
|
+
_context38.n = 10;
|
|
18810
19078
|
return effects.put(setMutualChannelsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18811
19079
|
case 10:
|
|
18812
|
-
return
|
|
19080
|
+
return _context38.f(9);
|
|
18813
19081
|
case 11:
|
|
18814
|
-
return
|
|
19082
|
+
return _context38.a(2);
|
|
18815
19083
|
}
|
|
18816
|
-
},
|
|
19084
|
+
}, _marked38, null, [[1, 8, 9, 11]]);
|
|
18817
19085
|
}
|
|
18818
19086
|
function ChannelsSaga() {
|
|
18819
|
-
return _regenerator().w(function (
|
|
18820
|
-
while (1) switch (
|
|
19087
|
+
return _regenerator().w(function (_context39) {
|
|
19088
|
+
while (1) switch (_context39.n) {
|
|
18821
19089
|
case 0:
|
|
18822
|
-
|
|
19090
|
+
_context39.n = 1;
|
|
18823
19091
|
return effects.takeLatest(CREATE_CHANNEL, createChannel);
|
|
18824
19092
|
case 1:
|
|
18825
|
-
|
|
19093
|
+
_context39.n = 2;
|
|
18826
19094
|
return effects.takeLatest(GET_CHANNELS, getChannels);
|
|
18827
19095
|
case 2:
|
|
18828
|
-
|
|
19096
|
+
_context39.n = 3;
|
|
18829
19097
|
return effects.takeLatest(SEARCH_CHANNELS, searchChannels);
|
|
18830
19098
|
case 3:
|
|
18831
|
-
|
|
19099
|
+
_context39.n = 4;
|
|
18832
19100
|
return effects.takeLatest(GET_CHANNELS_FOR_FORWARD, getChannelsForForward);
|
|
18833
19101
|
case 4:
|
|
18834
|
-
|
|
19102
|
+
_context39.n = 5;
|
|
18835
19103
|
return effects.takeLatest(SEARCH_CHANNELS_FOR_FORWARD, searchChannelsForForward);
|
|
18836
19104
|
case 5:
|
|
18837
|
-
|
|
19105
|
+
_context39.n = 6;
|
|
18838
19106
|
return effects.takeLatest(LOAD_MORE_CHANNEL, channelsLoadMore);
|
|
18839
19107
|
case 6:
|
|
18840
|
-
|
|
19108
|
+
_context39.n = 7;
|
|
18841
19109
|
return effects.takeLatest(LOAD_MORE_CHANNELS_FOR_FORWARD, channelsForForwardLoadMore);
|
|
18842
19110
|
case 7:
|
|
18843
|
-
|
|
19111
|
+
_context39.n = 8;
|
|
18844
19112
|
return effects.takeLatest(GET_CHANNELS_WITH_USER, getChannelsWithUser);
|
|
18845
19113
|
case 8:
|
|
18846
|
-
|
|
19114
|
+
_context39.n = 9;
|
|
18847
19115
|
return effects.takeLatest(LOAD_MORE_MUTUAL_CHANNELS, loadMoreMutualChannels);
|
|
18848
19116
|
case 9:
|
|
18849
|
-
|
|
19117
|
+
_context39.n = 10;
|
|
18850
19118
|
return effects.takeEvery(SWITCH_CHANNEL, switchChannel);
|
|
18851
19119
|
case 10:
|
|
18852
|
-
|
|
19120
|
+
_context39.n = 11;
|
|
18853
19121
|
return effects.takeLatest(LEAVE_CHANNEL, leaveChannel);
|
|
18854
19122
|
case 11:
|
|
18855
|
-
|
|
19123
|
+
_context39.n = 12;
|
|
18856
19124
|
return effects.takeLatest(DELETE_CHANNEL, deleteChannel);
|
|
18857
19125
|
case 12:
|
|
18858
|
-
|
|
19126
|
+
_context39.n = 13;
|
|
18859
19127
|
return effects.takeLatest(BLOCK_CHANNEL, blockChannel);
|
|
18860
19128
|
case 13:
|
|
18861
|
-
|
|
19129
|
+
_context39.n = 14;
|
|
18862
19130
|
return effects.takeLatest(UPDATE_CHANNEL, updateChannel);
|
|
18863
19131
|
case 14:
|
|
18864
|
-
|
|
19132
|
+
_context39.n = 15;
|
|
18865
19133
|
return effects.takeEvery(MARK_MESSAGES_AS_READ, markMessagesRead);
|
|
18866
19134
|
case 15:
|
|
18867
|
-
|
|
19135
|
+
_context39.n = 16;
|
|
18868
19136
|
return effects.takeLatest(MARK_MESSAGES_AS_DELIVERED, markMessagesDelivered);
|
|
18869
19137
|
case 16:
|
|
18870
|
-
|
|
19138
|
+
_context39.n = 17;
|
|
18871
19139
|
return effects.takeLatest(MARK_VOICE_MESSAGE_AS_PLAYED, markVoiceMessageAsPlayed);
|
|
18872
19140
|
case 17:
|
|
18873
|
-
|
|
19141
|
+
_context39.n = 18;
|
|
18874
19142
|
return effects.takeLatest(WATCH_FOR_EVENTS, watchForChannelEvents);
|
|
18875
19143
|
case 18:
|
|
18876
|
-
|
|
19144
|
+
_context39.n = 19;
|
|
18877
19145
|
return effects.takeLatest(TURN_OFF_NOTIFICATION, notificationsTurnOff);
|
|
18878
19146
|
case 19:
|
|
18879
|
-
|
|
19147
|
+
_context39.n = 20;
|
|
18880
19148
|
return effects.takeLatest(TURN_ON_NOTIFICATION, notificationsTurnOn);
|
|
18881
19149
|
case 20:
|
|
18882
|
-
|
|
19150
|
+
_context39.n = 21;
|
|
18883
19151
|
return effects.takeLatest(MARK_CHANNEL_AS_READ, markChannelAsRead);
|
|
18884
19152
|
case 21:
|
|
18885
|
-
|
|
19153
|
+
_context39.n = 22;
|
|
18886
19154
|
return effects.takeLatest(MARK_CHANNEL_AS_UNREAD, markChannelAsUnRead);
|
|
18887
19155
|
case 22:
|
|
18888
|
-
|
|
19156
|
+
_context39.n = 23;
|
|
18889
19157
|
return effects.takeLatest(CHECK_USER_STATUS, checkUsersStatus);
|
|
18890
19158
|
case 23:
|
|
18891
|
-
|
|
19159
|
+
_context39.n = 24;
|
|
18892
19160
|
return effects.takeLatest(SEND_TYPING, sendTyping);
|
|
18893
19161
|
case 24:
|
|
18894
|
-
|
|
19162
|
+
_context39.n = 25;
|
|
18895
19163
|
return effects.takeLatest(SEND_RECORDING, sendRecording);
|
|
18896
19164
|
case 25:
|
|
18897
|
-
|
|
19165
|
+
_context39.n = 26;
|
|
18898
19166
|
return effects.takeLatest(PIN_CHANNEL, pinChannel);
|
|
18899
19167
|
case 26:
|
|
18900
|
-
|
|
19168
|
+
_context39.n = 27;
|
|
18901
19169
|
return effects.takeLatest(UNPIN_CHANNEL, unpinChannel);
|
|
18902
19170
|
case 27:
|
|
18903
|
-
|
|
19171
|
+
_context39.n = 28;
|
|
18904
19172
|
return effects.takeLatest(CLEAR_HISTORY, clearHistory);
|
|
18905
19173
|
case 28:
|
|
18906
|
-
|
|
19174
|
+
_context39.n = 29;
|
|
18907
19175
|
return effects.takeLatest(JOIN_TO_CHANNEL, joinChannel);
|
|
18908
19176
|
case 29:
|
|
18909
|
-
|
|
19177
|
+
_context39.n = 30;
|
|
18910
19178
|
return effects.takeLatest(DELETE_ALL_MESSAGES, deleteAllMessages);
|
|
18911
19179
|
case 30:
|
|
18912
|
-
|
|
19180
|
+
_context39.n = 31;
|
|
18913
19181
|
return effects.takeLatest(REMOVE_CHANNEL_CACHES, removeChannelCaches);
|
|
18914
19182
|
case 31:
|
|
18915
|
-
|
|
19183
|
+
_context39.n = 32;
|
|
18916
19184
|
return effects.takeLatest(GET_CHANNEL_MENTIONS, getChannelMentions);
|
|
18917
19185
|
case 32:
|
|
18918
|
-
|
|
19186
|
+
_context39.n = 33;
|
|
18919
19187
|
return effects.takeLatest(CREATE_CHANNEL_INVITE_KEY, createChannelInviteKey);
|
|
18920
19188
|
case 33:
|
|
18921
|
-
|
|
19189
|
+
_context39.n = 34;
|
|
18922
19190
|
return effects.takeLatest(UPDATE_CHANNEL_INVITE_KEY, updateChannelInviteKey);
|
|
18923
19191
|
case 34:
|
|
18924
|
-
|
|
19192
|
+
_context39.n = 35;
|
|
18925
19193
|
return effects.takeLatest(REGENERATE_CHANNEL_INVITE_KEY, regenerateChannelInviteKey);
|
|
18926
19194
|
case 35:
|
|
18927
|
-
|
|
19195
|
+
_context39.n = 36;
|
|
18928
19196
|
return effects.takeLatest(GET_CHANNEL_INVITE_KEYS, getChannelInviteKeys);
|
|
18929
19197
|
case 36:
|
|
18930
|
-
|
|
19198
|
+
_context39.n = 37;
|
|
18931
19199
|
return effects.takeLatest(GET_CHANNEL_BY_INVITE_KEY, getChannelByInviteKey);
|
|
18932
19200
|
case 37:
|
|
18933
|
-
|
|
19201
|
+
_context39.n = 38;
|
|
18934
19202
|
return effects.takeLatest(JOIN_TO_CHANNEL_WITH_INVITE_KEY, joinChannelWithInviteKey);
|
|
18935
19203
|
case 38:
|
|
18936
|
-
|
|
19204
|
+
_context39.n = 39;
|
|
18937
19205
|
return effects.takeLatest(SET_MESSAGE_RETENTION_PERIOD, setMessageRetentionPeriod);
|
|
18938
19206
|
case 39:
|
|
18939
|
-
return
|
|
19207
|
+
return _context39.a(2);
|
|
18940
19208
|
}
|
|
18941
|
-
},
|
|
19209
|
+
}, _marked39);
|
|
18942
19210
|
}
|
|
18943
19211
|
|
|
18944
19212
|
function rgbaToThumbHash(w, h, rgba) {
|
|
@@ -19338,56 +19606,6 @@ var getFrame = function getFrame(videoSrc, time) {
|
|
|
19338
19606
|
}
|
|
19339
19607
|
};
|
|
19340
19608
|
|
|
19341
|
-
var SDKErrorTypeEnum = {
|
|
19342
|
-
BadRequest: {
|
|
19343
|
-
value: 'BadRequest',
|
|
19344
|
-
isResendable: false
|
|
19345
|
-
},
|
|
19346
|
-
BadParam: {
|
|
19347
|
-
value: 'BadParam',
|
|
19348
|
-
isResendable: false
|
|
19349
|
-
},
|
|
19350
|
-
NotFound: {
|
|
19351
|
-
value: 'NotFound',
|
|
19352
|
-
isResendable: false
|
|
19353
|
-
},
|
|
19354
|
-
NotAllowed: {
|
|
19355
|
-
value: 'NotAllowed',
|
|
19356
|
-
isResendable: false
|
|
19357
|
-
},
|
|
19358
|
-
TooLargeRequest: {
|
|
19359
|
-
value: 'TooLargeRequest',
|
|
19360
|
-
isResendable: false
|
|
19361
|
-
},
|
|
19362
|
-
InternalError: {
|
|
19363
|
-
value: 'InternalError',
|
|
19364
|
-
isResendable: true
|
|
19365
|
-
},
|
|
19366
|
-
TooManyRequests: {
|
|
19367
|
-
value: 'TooManyRequests',
|
|
19368
|
-
isResendable: true
|
|
19369
|
-
},
|
|
19370
|
-
Authentication: {
|
|
19371
|
-
value: 'Authentication',
|
|
19372
|
-
isResendable: true
|
|
19373
|
-
}
|
|
19374
|
-
};
|
|
19375
|
-
var fromValue = function fromValue(value) {
|
|
19376
|
-
if (!value) return null;
|
|
19377
|
-
var entries = Object.values(SDKErrorTypeEnum);
|
|
19378
|
-
return entries.find(function (entry) {
|
|
19379
|
-
return entry.value === value;
|
|
19380
|
-
}) || null;
|
|
19381
|
-
};
|
|
19382
|
-
var isResendableError = function isResendableError(value) {
|
|
19383
|
-
var _errorType$isResendab;
|
|
19384
|
-
if (!value) {
|
|
19385
|
-
return true;
|
|
19386
|
-
}
|
|
19387
|
-
var errorType = fromValue(value);
|
|
19388
|
-
return (_errorType$isResendab = errorType === null || errorType === void 0 ? void 0 : errorType.isResendable) != null ? _errorType$isResendab : true;
|
|
19389
|
-
};
|
|
19390
|
-
|
|
19391
19609
|
var _marked$3 = /*#__PURE__*/_regenerator().m(sendMessage),
|
|
19392
19610
|
_marked2$2 = /*#__PURE__*/_regenerator().m(sendTextMessage),
|
|
19393
19611
|
_marked3$1 = /*#__PURE__*/_regenerator().m(forwardMessage),
|
|
@@ -19583,7 +19801,7 @@ var updateMessage$1 = function updateMessage(actionType, pending, channelId, scr
|
|
|
19583
19801
|
break;
|
|
19584
19802
|
}
|
|
19585
19803
|
_context.n = 7;
|
|
19586
|
-
return effects.put(getMessagesAC(channel,
|
|
19804
|
+
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));
|
|
19587
19805
|
case 7:
|
|
19588
19806
|
return _context.a(2);
|
|
19589
19807
|
}
|
|
@@ -19611,6 +19829,9 @@ function sendMessage(action) {
|
|
|
19611
19829
|
if (channel) {
|
|
19612
19830
|
setChannelInMap(channel);
|
|
19613
19831
|
}
|
|
19832
|
+
if (!channel) {
|
|
19833
|
+
channel = getChannelFromAllChannelsMap(channelId);
|
|
19834
|
+
}
|
|
19614
19835
|
}
|
|
19615
19836
|
if (!channel.isMockChannel) {
|
|
19616
19837
|
_context4.n = 6;
|
|
@@ -19797,7 +20018,7 @@ function sendMessage(action) {
|
|
|
19797
20018
|
messagesToSend.push(messageToSend);
|
|
19798
20019
|
case 12:
|
|
19799
20020
|
_loop2 = /*#__PURE__*/_regenerator().m(function _callee3() {
|
|
19800
|
-
var messageAttachment, messageToSend, messageCopy, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, stringifiedMessageUpdateData, activeChannelId, messageToUpdate, channelUpdateParam, isErrorResendable, _t;
|
|
20021
|
+
var messageAttachment, messageToSend, messageCopy, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, stringifiedMessageUpdateData, activeChannelId, messageToUpdate, channelUpdateParam, _channel, _messageToSend2, _channel2, isErrorResendable, _t;
|
|
19801
20022
|
return _regenerator().w(function (_context3) {
|
|
19802
20023
|
while (1) switch (_context3.p = _context3.n) {
|
|
19803
20024
|
case 0:
|
|
@@ -19883,22 +20104,10 @@ function sendMessage(action) {
|
|
|
19883
20104
|
return attachment;
|
|
19884
20105
|
});
|
|
19885
20106
|
}
|
|
19886
|
-
messageUpdateData = {
|
|
19887
|
-
id: messageResponse.id,
|
|
19888
|
-
body: messageResponse.body,
|
|
19889
|
-
type: messageResponse.type,
|
|
19890
|
-
state: messageResponse.state,
|
|
19891
|
-
displayCount: messageResponse.displayCount,
|
|
19892
|
-
deliveryStatus: messageResponse.deliveryStatus,
|
|
20107
|
+
messageUpdateData = _extends({}, messageResponse, {
|
|
19893
20108
|
attachments: attachmentsToUpdate,
|
|
19894
|
-
mentionedUsers: messageResponse.mentionedUsers,
|
|
19895
|
-
bodyAttributes: messageResponse.bodyAttributes,
|
|
19896
|
-
metadata: messageResponse.metadata,
|
|
19897
|
-
parentMessage: messageResponse.parentMessage,
|
|
19898
|
-
repliedInThread: messageResponse.repliedInThread,
|
|
19899
|
-
createdAt: messageResponse.createdAt,
|
|
19900
20109
|
channelId: channel.id
|
|
19901
|
-
};
|
|
20110
|
+
});
|
|
19902
20111
|
stringifiedMessageUpdateData = JSON.parse(JSON.stringify(messageResponse));
|
|
19903
20112
|
activeChannelId = getActiveChannelId();
|
|
19904
20113
|
if (!(activeChannelId === channel.id)) {
|
|
@@ -19941,7 +20150,7 @@ function sendMessage(action) {
|
|
|
19941
20150
|
_context3.p = 15;
|
|
19942
20151
|
_t = _context3.v;
|
|
19943
20152
|
isErrorResendable = isResendableError(_t === null || _t === void 0 ? void 0 : _t.type);
|
|
19944
|
-
if (isErrorResendable) {
|
|
20153
|
+
if (!(!isErrorResendable && (_channel = channel) !== null && _channel !== void 0 && _channel.id && (_messageToSend2 = messageToSend) !== null && _messageToSend2 !== void 0 && _messageToSend2.tid)) {
|
|
19945
20154
|
_context3.n = 17;
|
|
19946
20155
|
break;
|
|
19947
20156
|
}
|
|
@@ -19951,6 +20160,10 @@ function sendMessage(action) {
|
|
|
19951
20160
|
_context3.n = 19;
|
|
19952
20161
|
break;
|
|
19953
20162
|
case 17:
|
|
20163
|
+
if (!((_channel2 = channel) !== null && _channel2 !== void 0 && _channel2.id)) {
|
|
20164
|
+
_context3.n = 19;
|
|
20165
|
+
break;
|
|
20166
|
+
}
|
|
19954
20167
|
log.error('Error on uploading attachment', messageToSend.tid, _t);
|
|
19955
20168
|
if (!(messageToSend.attachments && messageToSend.attachments.length)) {
|
|
19956
20169
|
_context3.n = 18;
|
|
@@ -20007,7 +20220,7 @@ function sendMessage(action) {
|
|
|
20007
20220
|
}, _marked$3, null, [[1, 16, 17, 19]]);
|
|
20008
20221
|
}
|
|
20009
20222
|
function sendTextMessage(action) {
|
|
20010
|
-
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend,
|
|
20223
|
+
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;
|
|
20011
20224
|
return _regenerator().w(function (_context5) {
|
|
20012
20225
|
while (1) switch (_context5.p = _context5.n) {
|
|
20013
20226
|
case 0:
|
|
@@ -20025,6 +20238,9 @@ function sendTextMessage(action) {
|
|
|
20025
20238
|
if (channel) {
|
|
20026
20239
|
setChannelInMap(channel);
|
|
20027
20240
|
}
|
|
20241
|
+
if (!channel) {
|
|
20242
|
+
channel = getChannelFromAllChannelsMap(channelId);
|
|
20243
|
+
}
|
|
20028
20244
|
}
|
|
20029
20245
|
sendMessageTid = null;
|
|
20030
20246
|
pendingMessage = null;
|
|
@@ -20114,23 +20330,9 @@ function sendTextMessage(action) {
|
|
|
20114
20330
|
case 11:
|
|
20115
20331
|
messageResponse = _context5.v;
|
|
20116
20332
|
case 12:
|
|
20117
|
-
messageUpdateData = {
|
|
20118
|
-
id: messageResponse.id,
|
|
20119
|
-
body: messageResponse.body,
|
|
20120
|
-
type: messageResponse.type,
|
|
20121
|
-
state: messageResponse.state,
|
|
20122
|
-
bodyAttributes: messageResponse.bodyAttributes,
|
|
20123
|
-
displayCount: messageResponse.displayCount,
|
|
20124
|
-
deliveryStatus: messageResponse.deliveryStatus,
|
|
20125
|
-
attachments: messageResponse.attachments,
|
|
20126
|
-
mentionedUsers: messageResponse.mentionedUsers,
|
|
20127
|
-
metadata: messageResponse.metadata,
|
|
20128
|
-
parentMessage: messageResponse.parentMessage,
|
|
20129
|
-
repliedInThread: messageResponse.repliedInThread,
|
|
20130
|
-
createdAt: messageResponse.createdAt,
|
|
20131
|
-
pollDetails: (_messageResponse = messageResponse) === null || _messageResponse === void 0 ? void 0 : _messageResponse.pollDetails,
|
|
20333
|
+
messageUpdateData = _extends({}, messageResponse, {
|
|
20132
20334
|
channelId: channel.id
|
|
20133
|
-
};
|
|
20335
|
+
});
|
|
20134
20336
|
activeChannelId = getActiveChannelId();
|
|
20135
20337
|
if (!(activeChannelId === channel.id)) {
|
|
20136
20338
|
_context5.n = 13;
|
|
@@ -20180,7 +20382,7 @@ function sendTextMessage(action) {
|
|
|
20180
20382
|
_t3 = _context5.v;
|
|
20181
20383
|
log.error('error on send text message ... ', _t3 === null || _t3 === void 0 ? void 0 : _t3.type);
|
|
20182
20384
|
isErrorResendable = isResendableError(_t3 === null || _t3 === void 0 ? void 0 : _t3.type);
|
|
20183
|
-
if (!(!isErrorResendable && channel.id && sendMessageTid)) {
|
|
20385
|
+
if (!(!isErrorResendable && (_channel3 = channel) !== null && _channel3 !== void 0 && _channel3.id && sendMessageTid)) {
|
|
20184
20386
|
_context5.n = 22;
|
|
20185
20387
|
break;
|
|
20186
20388
|
}
|
|
@@ -20190,7 +20392,7 @@ function sendTextMessage(action) {
|
|
|
20190
20392
|
_context5.n = 23;
|
|
20191
20393
|
break;
|
|
20192
20394
|
case 22:
|
|
20193
|
-
if (!(channel.id && sendMessageTid)) {
|
|
20395
|
+
if (!((_channel4 = channel) !== null && _channel4 !== void 0 && _channel4.id && sendMessageTid)) {
|
|
20194
20396
|
_context5.n = 23;
|
|
20195
20397
|
break;
|
|
20196
20398
|
}
|
|
@@ -20224,7 +20426,7 @@ function sendTextMessage(action) {
|
|
|
20224
20426
|
}, _marked2$2, null, [[3, 20, 23, 25]]);
|
|
20225
20427
|
}
|
|
20226
20428
|
function forwardMessage(action) {
|
|
20227
|
-
var payload, message, channelId, connectionState, isForward, pendingMessage, channel, activeChannelId, messageTid, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, pollDetails, messageToSend, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, isErrorResendable, _activeChannelId2, _t4;
|
|
20429
|
+
var payload, message, channelId, connectionState, isForward, pendingMessage, channel, activeChannelId, messageTid, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, pollDetails, messageToSend, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _channel5, isErrorResendable, _channel6, _activeChannelId2, _t4;
|
|
20228
20430
|
return _regenerator().w(function (_context6) {
|
|
20229
20431
|
while (1) switch (_context6.p = _context6.n) {
|
|
20230
20432
|
case 0:
|
|
@@ -20260,6 +20462,9 @@ function forwardMessage(action) {
|
|
|
20260
20462
|
if (channel) {
|
|
20261
20463
|
setChannelInMap(channel);
|
|
20262
20464
|
}
|
|
20465
|
+
if (!channel) {
|
|
20466
|
+
channel = getChannelFromAllChannelsMap(channelId);
|
|
20467
|
+
}
|
|
20263
20468
|
case 6:
|
|
20264
20469
|
if (channel) {
|
|
20265
20470
|
_context6.n = 7;
|
|
@@ -20350,20 +20555,9 @@ function forwardMessage(action) {
|
|
|
20350
20555
|
return effects.call(channel.sendMessage, messageToSend);
|
|
20351
20556
|
case 10:
|
|
20352
20557
|
messageResponse = _context6.v;
|
|
20353
|
-
messageUpdateData = {
|
|
20354
|
-
id: messageResponse.id,
|
|
20355
|
-
type: messageResponse.type,
|
|
20356
|
-
state: messageResponse.state,
|
|
20357
|
-
displayCount: messageResponse.displayCount,
|
|
20358
|
-
deliveryStatus: messageResponse.deliveryStatus,
|
|
20359
|
-
attachments: messageResponse.attachments,
|
|
20360
|
-
mentionedUsers: messageResponse.mentionedUsers,
|
|
20361
|
-
metadata: messageResponse.metadata,
|
|
20362
|
-
parentMessage: messageResponse.parentMessage,
|
|
20363
|
-
repliedInThread: messageResponse.repliedInThread,
|
|
20364
|
-
createdAt: messageResponse.createdAt,
|
|
20558
|
+
messageUpdateData = _extends({}, messageResponse, {
|
|
20365
20559
|
channelId: channel.id
|
|
20366
|
-
};
|
|
20560
|
+
});
|
|
20367
20561
|
if (!(channelId === activeChannelId)) {
|
|
20368
20562
|
_context6.n = 12;
|
|
20369
20563
|
break;
|
|
@@ -20409,7 +20603,7 @@ function forwardMessage(action) {
|
|
|
20409
20603
|
_context6.p = 18;
|
|
20410
20604
|
_t4 = _context6.v;
|
|
20411
20605
|
isErrorResendable = isResendableError(_t4 === null || _t4 === void 0 ? void 0 : _t4.type);
|
|
20412
|
-
if (isErrorResendable) {
|
|
20606
|
+
if (!(!isErrorResendable && (_channel5 = channel) !== null && _channel5 !== void 0 && _channel5.id && messageTid)) {
|
|
20413
20607
|
_context6.n = 20;
|
|
20414
20608
|
break;
|
|
20415
20609
|
}
|
|
@@ -20419,7 +20613,7 @@ function forwardMessage(action) {
|
|
|
20419
20613
|
_context6.n = 21;
|
|
20420
20614
|
break;
|
|
20421
20615
|
case 20:
|
|
20422
|
-
if (!(channel && messageTid)) {
|
|
20616
|
+
if (!((_channel6 = channel) !== null && _channel6 !== void 0 && _channel6.id && messageTid)) {
|
|
20423
20617
|
_context6.n = 21;
|
|
20424
20618
|
break;
|
|
20425
20619
|
}
|
|
@@ -20765,7 +20959,7 @@ var getFilteredPendingMessages = function getFilteredPendingMessages(messages) {
|
|
|
20765
20959
|
return filteredPendingMessages;
|
|
20766
20960
|
};
|
|
20767
20961
|
function getMessagesQuery(action) {
|
|
20768
|
-
var _action$payload, channel, loadWithLastMessage, messageId, limit, highlight, behavior, scrollToMessage, networkChanged, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, _result$messages$, _result$messages,
|
|
20962
|
+
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;
|
|
20769
20963
|
return _regenerator().w(function (_context10) {
|
|
20770
20964
|
while (1) switch (_context10.p = _context10.n) {
|
|
20771
20965
|
case 0:
|
|
@@ -20774,29 +20968,69 @@ function getMessagesQuery(action) {
|
|
|
20774
20968
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
20775
20969
|
case 1:
|
|
20776
20970
|
_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;
|
|
20971
|
+
channelNewMessageCount = (channel === null || channel === void 0 ? void 0 : channel.newMessageCount) || 0;
|
|
20777
20972
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
20778
20973
|
if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
|
|
20779
|
-
_context10.n =
|
|
20974
|
+
_context10.n = 77;
|
|
20780
20975
|
break;
|
|
20781
20976
|
}
|
|
20782
20977
|
SceytChatClient = getClient();
|
|
20978
|
+
if (!networkChanged) {
|
|
20979
|
+
_context10.n = 8;
|
|
20980
|
+
break;
|
|
20981
|
+
}
|
|
20982
|
+
_context10.p = 2;
|
|
20983
|
+
_context10.n = 3;
|
|
20984
|
+
return effects.call(SceytChatClient.getChannel, channel.id, true);
|
|
20985
|
+
case 3:
|
|
20986
|
+
_updatedChannel = _context10.v;
|
|
20987
|
+
if (!(_updatedChannel && _updatedChannel !== null && _updatedChannel !== void 0 && _updatedChannel.id)) {
|
|
20988
|
+
_context10.n = 6;
|
|
20989
|
+
break;
|
|
20990
|
+
}
|
|
20991
|
+
_context10.n = 4;
|
|
20992
|
+
return effects.put(updateChannelDataAC(channel.id, _extends({}, _updatedChannel)));
|
|
20993
|
+
case 4:
|
|
20994
|
+
channelNewMessageCount = (_updatedChannel === null || _updatedChannel === void 0 ? void 0 : _updatedChannel.newMessageCount) || 0;
|
|
20995
|
+
if (!(channelNewMessageCount !== channel.newMessageCount)) {
|
|
20996
|
+
_context10.n = 6;
|
|
20997
|
+
break;
|
|
20998
|
+
}
|
|
20999
|
+
_context10.n = 5;
|
|
21000
|
+
return effects.put(updateChannelDataAC(channel.id, {
|
|
21001
|
+
newMessageCount: channelNewMessageCount
|
|
21002
|
+
}));
|
|
21003
|
+
case 5:
|
|
21004
|
+
updateChannelOnAllChannels(channel.id, {
|
|
21005
|
+
newMessageCount: channelNewMessageCount
|
|
21006
|
+
});
|
|
21007
|
+
_context10.n = 6;
|
|
21008
|
+
return effects.put(setUnreadMessageIdAC(channel.lastDisplayedMessageId));
|
|
21009
|
+
case 6:
|
|
21010
|
+
_context10.n = 8;
|
|
21011
|
+
break;
|
|
21012
|
+
case 7:
|
|
21013
|
+
_context10.p = 7;
|
|
21014
|
+
_t0 = _context10.v;
|
|
21015
|
+
log.error('error to get updated channel in get messages query', _t0);
|
|
21016
|
+
case 8:
|
|
20783
21017
|
messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channel.id);
|
|
20784
21018
|
messageQueryBuilder.limit(limit || MESSAGES_MAX_LENGTH);
|
|
20785
21019
|
messageQueryBuilder.reverse(true);
|
|
20786
21020
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20787
|
-
_context10.n =
|
|
21021
|
+
_context10.n = 10;
|
|
20788
21022
|
break;
|
|
20789
21023
|
}
|
|
20790
|
-
_context10.n =
|
|
21024
|
+
_context10.n = 9;
|
|
20791
21025
|
return effects.call(messageQueryBuilder.build);
|
|
20792
|
-
case
|
|
20793
|
-
|
|
20794
|
-
_context10.n =
|
|
21026
|
+
case 9:
|
|
21027
|
+
_t1 = _context10.v;
|
|
21028
|
+
_context10.n = 11;
|
|
20795
21029
|
break;
|
|
20796
|
-
case
|
|
20797
|
-
|
|
20798
|
-
case
|
|
20799
|
-
messageQuery =
|
|
21030
|
+
case 10:
|
|
21031
|
+
_t1 = null;
|
|
21032
|
+
case 11:
|
|
21033
|
+
messageQuery = _t1;
|
|
20800
21034
|
query.messageQuery = messageQuery;
|
|
20801
21035
|
cachedMessages = Object.values(getMessagesFromMap(channel.id) || {}).sort(function (a, b) {
|
|
20802
21036
|
return Number(a.id) - Number(b.id);
|
|
@@ -20806,161 +21040,126 @@ function getMessagesQuery(action) {
|
|
|
20806
21040
|
hasNext: false
|
|
20807
21041
|
};
|
|
20808
21042
|
if (!loadWithLastMessage) {
|
|
20809
|
-
_context10.n =
|
|
21043
|
+
_context10.n = 29;
|
|
20810
21044
|
break;
|
|
20811
21045
|
}
|
|
20812
|
-
if (!(
|
|
20813
|
-
_context10.n =
|
|
21046
|
+
if (!(channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
21047
|
+
_context10.n = 22;
|
|
20814
21048
|
break;
|
|
20815
21049
|
}
|
|
20816
21050
|
setHasPrevCached(false);
|
|
20817
21051
|
setAllMessages([]);
|
|
20818
21052
|
messageQuery.limit = MESSAGES_MAX_LENGTH;
|
|
20819
21053
|
if (!Number(channel.lastDisplayedMessageId)) {
|
|
20820
|
-
_context10.n =
|
|
21054
|
+
_context10.n = 15;
|
|
20821
21055
|
break;
|
|
20822
21056
|
}
|
|
20823
21057
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20824
|
-
_context10.n =
|
|
21058
|
+
_context10.n = 13;
|
|
20825
21059
|
break;
|
|
20826
21060
|
}
|
|
20827
|
-
_context10.n =
|
|
21061
|
+
_context10.n = 12;
|
|
20828
21062
|
return effects.call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
|
|
20829
|
-
case
|
|
20830
|
-
|
|
20831
|
-
_context10.n =
|
|
21063
|
+
case 12:
|
|
21064
|
+
_t10 = _context10.v;
|
|
21065
|
+
_context10.n = 14;
|
|
20832
21066
|
break;
|
|
20833
|
-
case
|
|
20834
|
-
|
|
21067
|
+
case 13:
|
|
21068
|
+
_t10 = {
|
|
20835
21069
|
messages: [],
|
|
20836
21070
|
hasNext: false
|
|
20837
21071
|
};
|
|
20838
|
-
case
|
|
20839
|
-
result =
|
|
20840
|
-
_context10.n =
|
|
21072
|
+
case 14:
|
|
21073
|
+
result = _t10;
|
|
21074
|
+
_context10.n = 19;
|
|
20841
21075
|
break;
|
|
20842
|
-
case
|
|
21076
|
+
case 15:
|
|
20843
21077
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20844
|
-
_context10.n =
|
|
21078
|
+
_context10.n = 17;
|
|
20845
21079
|
break;
|
|
20846
21080
|
}
|
|
20847
|
-
_context10.n =
|
|
21081
|
+
_context10.n = 16;
|
|
20848
21082
|
return effects.call(messageQuery.loadPrevious);
|
|
20849
|
-
case
|
|
20850
|
-
|
|
20851
|
-
_context10.n =
|
|
21083
|
+
case 16:
|
|
21084
|
+
_t11 = _context10.v;
|
|
21085
|
+
_context10.n = 18;
|
|
20852
21086
|
break;
|
|
20853
|
-
case
|
|
20854
|
-
|
|
21087
|
+
case 17:
|
|
21088
|
+
_t11 = {
|
|
20855
21089
|
messages: [],
|
|
20856
21090
|
hasNext: false
|
|
20857
21091
|
};
|
|
20858
|
-
case 11:
|
|
20859
|
-
result = _t10;
|
|
20860
|
-
case 12:
|
|
20861
|
-
_context10.n = 13;
|
|
20862
|
-
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20863
|
-
case 13:
|
|
20864
|
-
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);
|
|
20865
|
-
setAllMessages(result.messages);
|
|
20866
|
-
_context10.n = 14;
|
|
20867
|
-
return effects.put(setMessagesHasPrevAC(true));
|
|
20868
|
-
case 14:
|
|
20869
|
-
_context10.n = 17;
|
|
20870
|
-
break;
|
|
20871
|
-
case 15:
|
|
20872
|
-
result.messages = getFromAllMessagesByMessageId('', '', true);
|
|
20873
|
-
_context10.n = 16;
|
|
20874
|
-
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20875
|
-
case 16:
|
|
20876
|
-
_context10.n = 17;
|
|
20877
|
-
return effects.put(setMessagesHasPrevAC(true));
|
|
20878
|
-
case 17:
|
|
20879
|
-
_context10.n = 18;
|
|
20880
|
-
return effects.put(setMessagesHasNextAC(false));
|
|
20881
21092
|
case 18:
|
|
20882
|
-
|
|
20883
|
-
if (!(messageId && scrollToMessage)) {
|
|
20884
|
-
_context10.n = 21;
|
|
20885
|
-
break;
|
|
20886
|
-
}
|
|
20887
|
-
if (!(channel.newMessageCount && channel.newMessageCount > 0)) {
|
|
20888
|
-
_context10.n = 20;
|
|
20889
|
-
break;
|
|
20890
|
-
}
|
|
20891
|
-
_context10.n = 19;
|
|
20892
|
-
return effects.put(setScrollToMessagesAC(channel.lastDisplayedMessageId, highlight, behavior));
|
|
21093
|
+
result = _t11;
|
|
20893
21094
|
case 19:
|
|
20894
|
-
_context10.n =
|
|
20895
|
-
|
|
21095
|
+
_context10.n = 20;
|
|
21096
|
+
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20896
21097
|
case 20:
|
|
21098
|
+
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);
|
|
21099
|
+
setAllMessages(result.messages);
|
|
20897
21100
|
_context10.n = 21;
|
|
20898
|
-
return effects.put(
|
|
21101
|
+
return effects.put(setMessagesHasPrevAC(true));
|
|
20899
21102
|
case 21:
|
|
20900
|
-
_context10.n =
|
|
21103
|
+
_context10.n = 24;
|
|
20901
21104
|
break;
|
|
20902
21105
|
case 22:
|
|
20903
|
-
|
|
20904
|
-
_context10.n = 52;
|
|
20905
|
-
break;
|
|
20906
|
-
}
|
|
20907
|
-
messages = store.getState().MessageReducer.activeChannelMessages;
|
|
20908
|
-
centerMessageId = (_messages$Math$floor = messages[Math.floor(messages.length / 2)]) === null || _messages$Math$floor === void 0 ? void 0 : _messages$Math$floor.id;
|
|
20909
|
-
loadWithMessageId = networkChanged && (messages === null || messages === void 0 ? void 0 : messages.length) > 0 ? centerMessageId : messageId;
|
|
20910
|
-
allMessages = getAllMessages();
|
|
20911
|
-
messageIndex = allMessages.findIndex(function (msg) {
|
|
20912
|
-
return msg.id === loadWithMessageId;
|
|
20913
|
-
});
|
|
20914
|
-
maxLengthPart = MESSAGES_MAX_LENGTH / 2;
|
|
20915
|
-
if (!(messageIndex >= maxLengthPart)) {
|
|
20916
|
-
_context10.n = 25;
|
|
20917
|
-
break;
|
|
20918
|
-
}
|
|
20919
|
-
result.messages = allMessages.slice(messageIndex - maxLengthPart, messageIndex + maxLengthPart);
|
|
21106
|
+
result.messages = getFromAllMessagesByMessageId('', '', true);
|
|
20920
21107
|
_context10.n = 23;
|
|
20921
21108
|
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20922
21109
|
case 23:
|
|
20923
|
-
setHasPrevCached(messageIndex > maxLengthPart);
|
|
20924
|
-
setHasNextCached(allMessages.length > maxLengthPart);
|
|
20925
21110
|
_context10.n = 24;
|
|
20926
21111
|
return effects.put(setMessagesHasPrevAC(true));
|
|
20927
21112
|
case 24:
|
|
20928
|
-
_context10.n =
|
|
20929
|
-
|
|
21113
|
+
_context10.n = 25;
|
|
21114
|
+
return effects.put(setMessagesHasNextAC(false));
|
|
20930
21115
|
case 25:
|
|
20931
|
-
|
|
20932
|
-
|
|
20933
|
-
|
|
21116
|
+
setHasNextCached(false);
|
|
21117
|
+
if (!(messageId && scrollToMessage)) {
|
|
21118
|
+
_context10.n = 28;
|
|
21119
|
+
break;
|
|
21120
|
+
}
|
|
21121
|
+
if (!(channelNewMessageCount && channelNewMessageCount > 0)) {
|
|
20934
21122
|
_context10.n = 27;
|
|
20935
21123
|
break;
|
|
20936
21124
|
}
|
|
20937
21125
|
_context10.n = 26;
|
|
20938
|
-
return effects.
|
|
21126
|
+
return effects.put(setScrollToMessagesAC(channel.lastDisplayedMessageId, highlight, behavior));
|
|
20939
21127
|
case 26:
|
|
20940
|
-
_t11 = _context10.v;
|
|
20941
21128
|
_context10.n = 28;
|
|
20942
21129
|
break;
|
|
20943
21130
|
case 27:
|
|
20944
|
-
|
|
20945
|
-
|
|
20946
|
-
hasNext: false
|
|
20947
|
-
};
|
|
21131
|
+
_context10.n = 28;
|
|
21132
|
+
return effects.put(scrollToNewMessageAC(true));
|
|
20948
21133
|
case 28:
|
|
20949
|
-
|
|
20950
|
-
|
|
20951
|
-
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
21134
|
+
_context10.n = 70;
|
|
21135
|
+
break;
|
|
20952
21136
|
case 29:
|
|
20953
|
-
if (!
|
|
20954
|
-
_context10.n =
|
|
21137
|
+
if (!messageId) {
|
|
21138
|
+
_context10.n = 40;
|
|
20955
21139
|
break;
|
|
20956
21140
|
}
|
|
20957
|
-
|
|
21141
|
+
messages = store.getState().MessageReducer.activeChannelMessages;
|
|
21142
|
+
loadNextMessageId = '';
|
|
21143
|
+
loadPreviousMessageId = '';
|
|
21144
|
+
nextLoadLimit = MESSAGES_MAX_PAGE_COUNT / 2;
|
|
21145
|
+
previousLoadLimit = MESSAGES_MAX_PAGE_COUNT / 2;
|
|
21146
|
+
if (networkChanged) {
|
|
21147
|
+
centerMessageIndex = getCenterTwoMessages(messages);
|
|
21148
|
+
loadPreviousMessageId = centerMessageIndex.mid2.messageId;
|
|
21149
|
+
loadNextMessageId = centerMessageIndex.mid1.messageId;
|
|
21150
|
+
previousLoadLimit = centerMessageIndex.mid2.index;
|
|
21151
|
+
nextLoadLimit = messages.length - centerMessageIndex.mid1.index - 1;
|
|
21152
|
+
} else if (messageId) {
|
|
21153
|
+
loadPreviousMessageId = messageId;
|
|
21154
|
+
}
|
|
21155
|
+
messageQuery.limit = previousLoadLimit;
|
|
21156
|
+
log.info('load by message id from server ...............', messageId);
|
|
20958
21157
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20959
21158
|
_context10.n = 31;
|
|
20960
21159
|
break;
|
|
20961
21160
|
}
|
|
20962
21161
|
_context10.n = 30;
|
|
20963
|
-
return effects.call(messageQuery.loadPreviousMessageId,
|
|
21162
|
+
return effects.call(messageQuery.loadPreviousMessageId, loadPreviousMessageId);
|
|
20964
21163
|
case 30:
|
|
20965
21164
|
_t12 = _context10.v;
|
|
20966
21165
|
_context10.n = 32;
|
|
@@ -20971,234 +21170,185 @@ function getMessagesQuery(action) {
|
|
|
20971
21170
|
hasNext: false
|
|
20972
21171
|
};
|
|
20973
21172
|
case 32:
|
|
20974
|
-
|
|
20975
|
-
|
|
20976
|
-
|
|
20977
|
-
|
|
20978
|
-
|
|
20979
|
-
|
|
21173
|
+
firstResult = _t12;
|
|
21174
|
+
if (!networkChanged && firstResult.messages.length > 0) {
|
|
21175
|
+
loadNextMessageId = firstResult.messages[firstResult.messages.length - 1].id;
|
|
21176
|
+
} else if (!networkChanged && !firstResult.messages.length) {
|
|
21177
|
+
loadNextMessageId = '0';
|
|
21178
|
+
}
|
|
20980
21179
|
messageQuery.reverse = false;
|
|
21180
|
+
messageQuery.limit = nextLoadLimit;
|
|
20981
21181
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20982
|
-
_context10.n =
|
|
21182
|
+
_context10.n = 34;
|
|
20983
21183
|
break;
|
|
20984
21184
|
}
|
|
20985
|
-
_context10.n =
|
|
20986
|
-
return effects.call(messageQuery.loadNextMessageId,
|
|
20987
|
-
case
|
|
21185
|
+
_context10.n = 33;
|
|
21186
|
+
return effects.call(messageQuery.loadNextMessageId, loadNextMessageId);
|
|
21187
|
+
case 33:
|
|
20988
21188
|
_t13 = _context10.v;
|
|
20989
|
-
_context10.n =
|
|
21189
|
+
_context10.n = 35;
|
|
20990
21190
|
break;
|
|
20991
|
-
case
|
|
21191
|
+
case 34:
|
|
20992
21192
|
_t13 = {
|
|
20993
21193
|
messages: [],
|
|
20994
21194
|
hasNext: false
|
|
20995
21195
|
};
|
|
21196
|
+
case 35:
|
|
21197
|
+
secondResult = _t13;
|
|
21198
|
+
result.messages = [].concat(firstResult.messages, secondResult.messages);
|
|
21199
|
+
_context10.n = 36;
|
|
21200
|
+
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20996
21201
|
case 36:
|
|
20997
|
-
thirdResult = _t13;
|
|
20998
|
-
result.messages = [].concat(result.messages, thirdResult.messages);
|
|
20999
|
-
_context10.n = 37;
|
|
21000
|
-
return effects.put(addMessagesAC(JSON.parse(JSON.stringify(thirdResult.messages)), MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21001
|
-
case 37:
|
|
21002
|
-
if (!(secondResult.hasNext && !thirdResult.hasNext)) {
|
|
21003
|
-
_context10.n = 42;
|
|
21004
|
-
break;
|
|
21005
|
-
}
|
|
21006
|
-
messageQuery.limit = MESSAGES_MAX_PAGE_COUNT - 50 - secondResult.messages.length - result.messages.length;
|
|
21007
|
-
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21008
|
-
_context10.n = 39;
|
|
21009
|
-
break;
|
|
21010
|
-
}
|
|
21011
|
-
_context10.n = 38;
|
|
21012
|
-
return effects.call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
21013
|
-
case 38:
|
|
21014
|
-
_t14 = _context10.v;
|
|
21015
|
-
_context10.n = 40;
|
|
21016
|
-
break;
|
|
21017
|
-
case 39:
|
|
21018
|
-
_t14 = {
|
|
21019
|
-
messages: [],
|
|
21020
|
-
hasNext: false
|
|
21021
|
-
};
|
|
21022
|
-
case 40:
|
|
21023
|
-
fourthResult = _t14;
|
|
21024
|
-
result.messages = [].concat(fourthResult.messages, result.messages);
|
|
21025
|
-
_context10.n = 41;
|
|
21026
|
-
return effects.put(addMessagesAC(JSON.parse(JSON.stringify(fourthResult.messages)), MESSAGE_LOAD_DIRECTION.PREV));
|
|
21027
|
-
case 41:
|
|
21028
|
-
_context10.n = 46;
|
|
21029
|
-
break;
|
|
21030
|
-
case 42:
|
|
21031
|
-
if (!(!secondResult.hasNext && thirdResult.hasNext)) {
|
|
21032
|
-
_context10.n = 46;
|
|
21033
|
-
break;
|
|
21034
|
-
}
|
|
21035
|
-
messageQuery.limit = MESSAGES_MAX_PAGE_COUNT - 50 - secondResult.messages.length - result.messages.length;
|
|
21036
|
-
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21037
|
-
_context10.n = 44;
|
|
21038
|
-
break;
|
|
21039
|
-
}
|
|
21040
|
-
_context10.n = 43;
|
|
21041
|
-
return effects.call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
|
|
21042
|
-
case 43:
|
|
21043
|
-
_t15 = _context10.v;
|
|
21044
|
-
_context10.n = 45;
|
|
21045
|
-
break;
|
|
21046
|
-
case 44:
|
|
21047
|
-
_t15 = {
|
|
21048
|
-
messages: [],
|
|
21049
|
-
hasNext: false
|
|
21050
|
-
};
|
|
21051
|
-
case 45:
|
|
21052
|
-
_fourthResult = _t15;
|
|
21053
|
-
result.messages = [].concat(result.messages, _fourthResult.messages);
|
|
21054
|
-
_context10.n = 46;
|
|
21055
|
-
return effects.put(addMessagesAC(JSON.parse(JSON.stringify(_fourthResult.messages)), MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21056
|
-
case 46:
|
|
21057
|
-
messageQuery.reverse = true;
|
|
21058
|
-
case 47:
|
|
21059
21202
|
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);
|
|
21060
21203
|
setAllMessages([].concat(result.messages));
|
|
21061
21204
|
setHasPrevCached(false);
|
|
21062
21205
|
setHasNextCached(false);
|
|
21063
|
-
|
|
21064
|
-
_context10.n = 49;
|
|
21206
|
+
_context10.n = 37;
|
|
21065
21207
|
return effects.put(setMessagesHasNextAC(true));
|
|
21066
|
-
case
|
|
21067
|
-
if (!scrollToMessage) {
|
|
21068
|
-
_context10.n =
|
|
21208
|
+
case 37:
|
|
21209
|
+
if (!(scrollToMessage && !networkChanged)) {
|
|
21210
|
+
_context10.n = 38;
|
|
21069
21211
|
break;
|
|
21070
21212
|
}
|
|
21071
|
-
_context10.n =
|
|
21072
|
-
return effects.put(setScrollToMessagesAC(
|
|
21073
|
-
case
|
|
21074
|
-
_context10.n =
|
|
21213
|
+
_context10.n = 38;
|
|
21214
|
+
return effects.put(setScrollToMessagesAC(messageId, highlight, behavior));
|
|
21215
|
+
case 38:
|
|
21216
|
+
_context10.n = 39;
|
|
21075
21217
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
21076
|
-
case
|
|
21077
|
-
_context10.n =
|
|
21218
|
+
case 39:
|
|
21219
|
+
_context10.n = 70;
|
|
21078
21220
|
break;
|
|
21079
|
-
case
|
|
21080
|
-
if (!(
|
|
21081
|
-
_context10.n =
|
|
21221
|
+
case 40:
|
|
21222
|
+
if (!(channelNewMessageCount && channel.lastDisplayedMessageId)) {
|
|
21223
|
+
_context10.n = 54;
|
|
21082
21224
|
break;
|
|
21083
21225
|
}
|
|
21084
21226
|
setAllMessages([]);
|
|
21085
21227
|
messageQuery.limit = MESSAGES_MAX_LENGTH;
|
|
21086
21228
|
if (!Number(channel.lastDisplayedMessageId)) {
|
|
21087
|
-
_context10.n =
|
|
21229
|
+
_context10.n = 44;
|
|
21088
21230
|
break;
|
|
21089
21231
|
}
|
|
21090
21232
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21091
|
-
_context10.n =
|
|
21233
|
+
_context10.n = 42;
|
|
21092
21234
|
break;
|
|
21093
21235
|
}
|
|
21094
|
-
_context10.n =
|
|
21236
|
+
_context10.n = 41;
|
|
21095
21237
|
return effects.call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
|
|
21096
|
-
case
|
|
21097
|
-
|
|
21098
|
-
_context10.n =
|
|
21238
|
+
case 41:
|
|
21239
|
+
_t14 = _context10.v;
|
|
21240
|
+
_context10.n = 43;
|
|
21099
21241
|
break;
|
|
21100
|
-
case
|
|
21101
|
-
|
|
21242
|
+
case 42:
|
|
21243
|
+
_t14 = {
|
|
21102
21244
|
messages: [],
|
|
21103
21245
|
hasNext: false
|
|
21104
21246
|
};
|
|
21105
|
-
case
|
|
21106
|
-
result =
|
|
21107
|
-
_context10.n =
|
|
21247
|
+
case 43:
|
|
21248
|
+
result = _t14;
|
|
21249
|
+
_context10.n = 48;
|
|
21108
21250
|
break;
|
|
21109
|
-
case
|
|
21251
|
+
case 44:
|
|
21110
21252
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21111
|
-
_context10.n =
|
|
21253
|
+
_context10.n = 46;
|
|
21112
21254
|
break;
|
|
21113
21255
|
}
|
|
21114
|
-
_context10.n =
|
|
21256
|
+
_context10.n = 45;
|
|
21115
21257
|
return effects.call(messageQuery.loadPrevious);
|
|
21116
|
-
case
|
|
21117
|
-
|
|
21118
|
-
_context10.n =
|
|
21258
|
+
case 45:
|
|
21259
|
+
_t15 = _context10.v;
|
|
21260
|
+
_context10.n = 47;
|
|
21119
21261
|
break;
|
|
21120
|
-
case
|
|
21121
|
-
|
|
21262
|
+
case 46:
|
|
21263
|
+
_t15 = {
|
|
21122
21264
|
messages: [],
|
|
21123
21265
|
hasNext: false
|
|
21124
21266
|
};
|
|
21125
|
-
case
|
|
21126
|
-
result =
|
|
21127
|
-
case
|
|
21128
|
-
_context10.n =
|
|
21267
|
+
case 47:
|
|
21268
|
+
result = _t15;
|
|
21269
|
+
case 48:
|
|
21270
|
+
_context10.n = 49;
|
|
21129
21271
|
return effects.put(setMessagesHasPrevAC(true));
|
|
21130
|
-
case
|
|
21131
|
-
_context10.n =
|
|
21272
|
+
case 49:
|
|
21273
|
+
_context10.n = 50;
|
|
21132
21274
|
return effects.put(setMessagesHasNextAC(channel.lastMessage && result.messages.length > 0 && channel.lastMessage.id !== result.messages[result.messages.length - 1].id));
|
|
21133
|
-
case
|
|
21275
|
+
case 50:
|
|
21134
21276
|
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);
|
|
21135
21277
|
setAllMessages([].concat(result.messages));
|
|
21136
|
-
_context10.n =
|
|
21278
|
+
_context10.n = 51;
|
|
21137
21279
|
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
21138
|
-
case
|
|
21139
|
-
_context10.n =
|
|
21280
|
+
case 51:
|
|
21281
|
+
_context10.n = 52;
|
|
21282
|
+
return effects.put(scrollToNewMessageAC(false));
|
|
21283
|
+
case 52:
|
|
21284
|
+
_context10.n = 53;
|
|
21285
|
+
return effects.put(setUnreadScrollToAC(true));
|
|
21286
|
+
case 53:
|
|
21287
|
+
_context10.n = 70;
|
|
21140
21288
|
break;
|
|
21141
|
-
case
|
|
21289
|
+
case 54:
|
|
21142
21290
|
if (!(cachedMessages && cachedMessages.length)) {
|
|
21143
|
-
_context10.n =
|
|
21291
|
+
_context10.n = 57;
|
|
21144
21292
|
break;
|
|
21145
21293
|
}
|
|
21146
|
-
|
|
21147
|
-
|
|
21148
|
-
|
|
21149
|
-
|
|
21150
|
-
|
|
21151
|
-
|
|
21152
|
-
|
|
21294
|
+
_messages = getFromAllMessagesByMessageId('', '', true);
|
|
21295
|
+
_context10.n = 55;
|
|
21296
|
+
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(_messages))));
|
|
21297
|
+
case 55:
|
|
21298
|
+
_context10.n = 56;
|
|
21299
|
+
return effects.delay(0);
|
|
21300
|
+
case 56:
|
|
21301
|
+
_filteredPendingMessages = getFilteredPendingMessages(_messages);
|
|
21302
|
+
_context10.n = 57;
|
|
21153
21303
|
return effects.put(addMessagesAC(_filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21154
|
-
case
|
|
21304
|
+
case 57:
|
|
21155
21305
|
log.info('load message from server');
|
|
21156
21306
|
result = {
|
|
21157
21307
|
messages: [],
|
|
21158
21308
|
hasNext: false
|
|
21159
21309
|
};
|
|
21160
21310
|
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))) {
|
|
21161
|
-
_context10.n =
|
|
21311
|
+
_context10.n = 61;
|
|
21162
21312
|
break;
|
|
21163
21313
|
}
|
|
21164
21314
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21165
|
-
_context10.n =
|
|
21315
|
+
_context10.n = 59;
|
|
21166
21316
|
break;
|
|
21167
21317
|
}
|
|
21168
|
-
_context10.n =
|
|
21318
|
+
_context10.n = 58;
|
|
21169
21319
|
return effects.call(messageQuery.loadPreviousMessageId, channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId);
|
|
21170
|
-
case
|
|
21171
|
-
|
|
21172
|
-
_context10.n =
|
|
21320
|
+
case 58:
|
|
21321
|
+
_t16 = _context10.v;
|
|
21322
|
+
_context10.n = 60;
|
|
21173
21323
|
break;
|
|
21174
|
-
case
|
|
21175
|
-
|
|
21324
|
+
case 59:
|
|
21325
|
+
_t16 = {
|
|
21176
21326
|
messages: [],
|
|
21177
21327
|
hasNext: false
|
|
21178
21328
|
};
|
|
21179
|
-
case
|
|
21180
|
-
result =
|
|
21181
|
-
_context10.n =
|
|
21329
|
+
case 60:
|
|
21330
|
+
result = _t16;
|
|
21331
|
+
_context10.n = 65;
|
|
21182
21332
|
break;
|
|
21183
|
-
case
|
|
21333
|
+
case 61:
|
|
21184
21334
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
21185
|
-
_context10.n =
|
|
21335
|
+
_context10.n = 63;
|
|
21186
21336
|
break;
|
|
21187
21337
|
}
|
|
21188
|
-
_context10.n =
|
|
21338
|
+
_context10.n = 62;
|
|
21189
21339
|
return effects.call(messageQuery.loadPrevious);
|
|
21190
|
-
case
|
|
21191
|
-
|
|
21192
|
-
_context10.n =
|
|
21340
|
+
case 62:
|
|
21341
|
+
_t17 = _context10.v;
|
|
21342
|
+
_context10.n = 64;
|
|
21193
21343
|
break;
|
|
21194
|
-
case
|
|
21195
|
-
|
|
21344
|
+
case 63:
|
|
21345
|
+
_t17 = {
|
|
21196
21346
|
messages: [],
|
|
21197
21347
|
hasNext: false
|
|
21198
21348
|
};
|
|
21199
|
-
case
|
|
21200
|
-
result =
|
|
21201
|
-
case
|
|
21349
|
+
case 64:
|
|
21350
|
+
result = _t17;
|
|
21351
|
+
case 65:
|
|
21202
21352
|
updatedMessages = [];
|
|
21203
21353
|
result.messages.forEach(function (msg) {
|
|
21204
21354
|
var updatedMessage = updateMessageOnMap(channel.id, {
|
|
@@ -21209,72 +21359,86 @@ function getMessagesQuery(action) {
|
|
|
21209
21359
|
updatedMessages.push(updatedMessage || msg);
|
|
21210
21360
|
});
|
|
21211
21361
|
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';
|
|
21212
|
-
|
|
21362
|
+
if (!updatedMessages.length) {
|
|
21363
|
+
_context10.n = 69;
|
|
21364
|
+
break;
|
|
21365
|
+
}
|
|
21366
|
+
_context10.n = 66;
|
|
21213
21367
|
return effects.call(updateMessages, channel, updatedMessages, (_updatedMessages$ = updatedMessages[0]) === null || _updatedMessages$ === void 0 ? void 0 : _updatedMessages$.id, messageIdForLoad);
|
|
21214
|
-
case
|
|
21215
|
-
_context10.n =
|
|
21368
|
+
case 66:
|
|
21369
|
+
_context10.n = 67;
|
|
21216
21370
|
return effects.put(setMessagesHasPrevAC(true));
|
|
21217
|
-
case
|
|
21218
|
-
_context10.n =
|
|
21371
|
+
case 67:
|
|
21372
|
+
_context10.n = 68;
|
|
21219
21373
|
return effects.put(setMessagesHasNextAC(false));
|
|
21220
|
-
case
|
|
21374
|
+
case 68:
|
|
21375
|
+
_context10.n = 70;
|
|
21376
|
+
break;
|
|
21377
|
+
case 69:
|
|
21378
|
+
if (!(!(cachedMessages !== null && cachedMessages !== void 0 && cachedMessages.length) && !((_result$messages4 = result.messages) !== null && _result$messages4 !== void 0 && _result$messages4.length))) {
|
|
21379
|
+
_context10.n = 70;
|
|
21380
|
+
break;
|
|
21381
|
+
}
|
|
21382
|
+
_context10.n = 70;
|
|
21383
|
+
return effects.put(setMessagesAC([]));
|
|
21384
|
+
case 70:
|
|
21221
21385
|
filteredPendingMessages = getFilteredPendingMessages(result.messages);
|
|
21222
|
-
_context10.n =
|
|
21386
|
+
_context10.n = 71;
|
|
21223
21387
|
return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
21224
|
-
case
|
|
21388
|
+
case 71:
|
|
21225
21389
|
waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
|
|
21226
21390
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED && waitToSendPendingMessages)) {
|
|
21227
|
-
_context10.n =
|
|
21391
|
+
_context10.n = 73;
|
|
21228
21392
|
break;
|
|
21229
21393
|
}
|
|
21230
|
-
_context10.n =
|
|
21394
|
+
_context10.n = 72;
|
|
21231
21395
|
return effects.put(setWaitToSendPendingMessagesAC(false));
|
|
21232
|
-
case
|
|
21233
|
-
_context10.n =
|
|
21396
|
+
case 72:
|
|
21397
|
+
_context10.n = 73;
|
|
21234
21398
|
return effects.spawn(sendPendingMessages, connectionState);
|
|
21235
|
-
case
|
|
21236
|
-
_context10.n =
|
|
21399
|
+
case 73:
|
|
21400
|
+
_context10.n = 74;
|
|
21237
21401
|
return effects.call(SceytChatClient.getChannel, channel.id, true);
|
|
21238
|
-
case
|
|
21402
|
+
case 74:
|
|
21239
21403
|
updatedChannel = _context10.v;
|
|
21240
|
-
if (!updatedChannel) {
|
|
21241
|
-
_context10.n =
|
|
21404
|
+
if (!(updatedChannel && updatedChannel !== null && updatedChannel !== void 0 && updatedChannel.lastMessage)) {
|
|
21405
|
+
_context10.n = 76;
|
|
21242
21406
|
break;
|
|
21243
21407
|
}
|
|
21244
|
-
_context10.n =
|
|
21408
|
+
_context10.n = 75;
|
|
21245
21409
|
return effects.put(updateChannelLastMessageAC(updatedChannel.lastMessage, updatedChannel));
|
|
21246
|
-
case
|
|
21410
|
+
case 75:
|
|
21247
21411
|
updateChannelLastMessageOnAllChannels(channel.id, updatedChannel.lastMessage);
|
|
21248
|
-
case
|
|
21249
|
-
_context10.n =
|
|
21412
|
+
case 76:
|
|
21413
|
+
_context10.n = 78;
|
|
21250
21414
|
break;
|
|
21251
|
-
case
|
|
21415
|
+
case 77:
|
|
21252
21416
|
if (!(channel !== null && channel !== void 0 && channel.isMockChannel)) {
|
|
21253
|
-
_context10.n =
|
|
21417
|
+
_context10.n = 78;
|
|
21254
21418
|
break;
|
|
21255
21419
|
}
|
|
21256
|
-
_context10.n =
|
|
21420
|
+
_context10.n = 78;
|
|
21257
21421
|
return effects.put(setMessagesAC([]));
|
|
21258
|
-
case
|
|
21259
|
-
_context10.n =
|
|
21422
|
+
case 78:
|
|
21423
|
+
_context10.n = 80;
|
|
21260
21424
|
break;
|
|
21261
|
-
case
|
|
21262
|
-
_context10.p =
|
|
21263
|
-
|
|
21264
|
-
log.error('error in message query',
|
|
21265
|
-
case
|
|
21266
|
-
_context10.p =
|
|
21267
|
-
_context10.n =
|
|
21425
|
+
case 79:
|
|
21426
|
+
_context10.p = 79;
|
|
21427
|
+
_t18 = _context10.v;
|
|
21428
|
+
log.error('error in message query', _t18);
|
|
21429
|
+
case 80:
|
|
21430
|
+
_context10.p = 80;
|
|
21431
|
+
_context10.n = 81;
|
|
21268
21432
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
21269
|
-
case
|
|
21270
|
-
return _context10.f(
|
|
21271
|
-
case
|
|
21433
|
+
case 81:
|
|
21434
|
+
return _context10.f(80);
|
|
21435
|
+
case 82:
|
|
21272
21436
|
return _context10.a(2);
|
|
21273
21437
|
}
|
|
21274
|
-
}, _marked7$1, null, [[0,
|
|
21438
|
+
}, _marked7$1, null, [[2, 7], [0, 79, 80, 82]]);
|
|
21275
21439
|
}
|
|
21276
21440
|
function getMessageQuery(action) {
|
|
21277
|
-
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage,
|
|
21441
|
+
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage, _t19;
|
|
21278
21442
|
return _regenerator().w(function (_context11) {
|
|
21279
21443
|
while (1) switch (_context11.p = _context11.n) {
|
|
21280
21444
|
case 0:
|
|
@@ -21324,15 +21488,15 @@ function getMessageQuery(action) {
|
|
|
21324
21488
|
break;
|
|
21325
21489
|
case 7:
|
|
21326
21490
|
_context11.p = 7;
|
|
21327
|
-
|
|
21328
|
-
log.error('error in message query',
|
|
21491
|
+
_t19 = _context11.v;
|
|
21492
|
+
log.error('error in message query', _t19);
|
|
21329
21493
|
case 8:
|
|
21330
21494
|
return _context11.a(2);
|
|
21331
21495
|
}
|
|
21332
21496
|
}, _marked8$1, null, [[0, 7]]);
|
|
21333
21497
|
}
|
|
21334
21498
|
function loadMoreMessages(action) {
|
|
21335
|
-
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _result$messages$4, _result$
|
|
21499
|
+
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _result$messages$4, _result$messages5, _result$messages$5, _result$messages6, _t20;
|
|
21336
21500
|
return _regenerator().w(function (_context12) {
|
|
21337
21501
|
while (1) switch (_context12.p = _context12.n) {
|
|
21338
21502
|
case 0:
|
|
@@ -21376,7 +21540,7 @@ function loadMoreMessages(action) {
|
|
|
21376
21540
|
result = _context12.v;
|
|
21377
21541
|
if (result.messages.length) {
|
|
21378
21542
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.PREV);
|
|
21379
|
-
setMessagesToMap(channelId, result.messages, (_result$messages$4 = result.messages[0]) === null || _result$messages$4 === void 0 ? void 0 : _result$messages$4.id, (_result$
|
|
21543
|
+
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);
|
|
21380
21544
|
}
|
|
21381
21545
|
_context12.n = 5;
|
|
21382
21546
|
return effects.put(setMessagesHasPrevAC(result.hasNext));
|
|
@@ -21404,7 +21568,7 @@ function loadMoreMessages(action) {
|
|
|
21404
21568
|
result = _context12.v;
|
|
21405
21569
|
if (result.messages.length) {
|
|
21406
21570
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.NEXT);
|
|
21407
|
-
setMessagesToMap(channelId, result.messages, (_result$messages$5 = result.messages[0]) === null || _result$messages$5 === void 0 ? void 0 : _result$messages$5.id, (_result$
|
|
21571
|
+
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);
|
|
21408
21572
|
}
|
|
21409
21573
|
_context12.n = 9;
|
|
21410
21574
|
return effects.put(setMessagesHasNextAC(result.hasNext));
|
|
@@ -21445,15 +21609,15 @@ function loadMoreMessages(action) {
|
|
|
21445
21609
|
break;
|
|
21446
21610
|
case 18:
|
|
21447
21611
|
_context12.p = 18;
|
|
21448
|
-
|
|
21449
|
-
log.error('error in load more messages',
|
|
21612
|
+
_t20 = _context12.v;
|
|
21613
|
+
log.error('error in load more messages', _t20);
|
|
21450
21614
|
case 19:
|
|
21451
21615
|
return _context12.a(2);
|
|
21452
21616
|
}
|
|
21453
21617
|
}, _marked9$1, null, [[0, 18]]);
|
|
21454
21618
|
}
|
|
21455
21619
|
function addReaction(action) {
|
|
21456
|
-
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam,
|
|
21620
|
+
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam, _t21;
|
|
21457
21621
|
return _regenerator().w(function (_context13) {
|
|
21458
21622
|
while (1) switch (_context13.p = _context13.n) {
|
|
21459
21623
|
case 0:
|
|
@@ -21506,15 +21670,15 @@ function addReaction(action) {
|
|
|
21506
21670
|
break;
|
|
21507
21671
|
case 8:
|
|
21508
21672
|
_context13.p = 8;
|
|
21509
|
-
|
|
21510
|
-
log.error('ERROR in add reaction',
|
|
21673
|
+
_t21 = _context13.v;
|
|
21674
|
+
log.error('ERROR in add reaction', _t21.message);
|
|
21511
21675
|
case 9:
|
|
21512
21676
|
return _context13.a(2);
|
|
21513
21677
|
}
|
|
21514
21678
|
}, _marked0$1, null, [[0, 8]]);
|
|
21515
21679
|
}
|
|
21516
21680
|
function deleteReaction(action) {
|
|
21517
|
-
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam,
|
|
21681
|
+
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam, _t22;
|
|
21518
21682
|
return _regenerator().w(function (_context14) {
|
|
21519
21683
|
while (1) switch (_context14.p = _context14.n) {
|
|
21520
21684
|
case 0:
|
|
@@ -21562,15 +21726,15 @@ function deleteReaction(action) {
|
|
|
21562
21726
|
break;
|
|
21563
21727
|
case 7:
|
|
21564
21728
|
_context14.p = 7;
|
|
21565
|
-
|
|
21566
|
-
log.error('ERROR in delete reaction',
|
|
21729
|
+
_t22 = _context14.v;
|
|
21730
|
+
log.error('ERROR in delete reaction', _t22.message);
|
|
21567
21731
|
case 8:
|
|
21568
21732
|
return _context14.a(2);
|
|
21569
21733
|
}
|
|
21570
21734
|
}, _marked1$1, null, [[0, 7]]);
|
|
21571
21735
|
}
|
|
21572
21736
|
function getReactions(action) {
|
|
21573
|
-
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result,
|
|
21737
|
+
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result, _t23;
|
|
21574
21738
|
return _regenerator().w(function (_context15) {
|
|
21575
21739
|
while (1) switch (_context15.p = _context15.n) {
|
|
21576
21740
|
case 0:
|
|
@@ -21605,15 +21769,15 @@ function getReactions(action) {
|
|
|
21605
21769
|
break;
|
|
21606
21770
|
case 6:
|
|
21607
21771
|
_context15.p = 6;
|
|
21608
|
-
|
|
21609
|
-
log.error('ERROR in get reactions',
|
|
21772
|
+
_t23 = _context15.v;
|
|
21773
|
+
log.error('ERROR in get reactions', _t23.message);
|
|
21610
21774
|
case 7:
|
|
21611
21775
|
return _context15.a(2);
|
|
21612
21776
|
}
|
|
21613
21777
|
}, _marked10$1, null, [[0, 6]]);
|
|
21614
21778
|
}
|
|
21615
21779
|
function loadMoreReactions(action) {
|
|
21616
|
-
var payload, limit, ReactionQuery, result,
|
|
21780
|
+
var payload, limit, ReactionQuery, result, _t24;
|
|
21617
21781
|
return _regenerator().w(function (_context16) {
|
|
21618
21782
|
while (1) switch (_context16.p = _context16.n) {
|
|
21619
21783
|
case 0:
|
|
@@ -21641,15 +21805,15 @@ function loadMoreReactions(action) {
|
|
|
21641
21805
|
break;
|
|
21642
21806
|
case 5:
|
|
21643
21807
|
_context16.p = 5;
|
|
21644
|
-
|
|
21645
|
-
log.error('ERROR in load more reactions',
|
|
21808
|
+
_t24 = _context16.v;
|
|
21809
|
+
log.error('ERROR in load more reactions', _t24.message);
|
|
21646
21810
|
case 6:
|
|
21647
21811
|
return _context16.a(2);
|
|
21648
21812
|
}
|
|
21649
21813
|
}, _marked11$1, null, [[0, 5]]);
|
|
21650
21814
|
}
|
|
21651
21815
|
function getMessageAttachments(action) {
|
|
21652
|
-
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result,
|
|
21816
|
+
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, _t25;
|
|
21653
21817
|
return _regenerator().w(function (_context17) {
|
|
21654
21818
|
while (1) switch (_context17.p = _context17.n) {
|
|
21655
21819
|
case 0:
|
|
@@ -21727,15 +21891,15 @@ function getMessageAttachments(action) {
|
|
|
21727
21891
|
break;
|
|
21728
21892
|
case 13:
|
|
21729
21893
|
_context17.p = 13;
|
|
21730
|
-
|
|
21731
|
-
log.error('error in message attachment query',
|
|
21894
|
+
_t25 = _context17.v;
|
|
21895
|
+
log.error('error in message attachment query', _t25);
|
|
21732
21896
|
case 14:
|
|
21733
21897
|
return _context17.a(2);
|
|
21734
21898
|
}
|
|
21735
21899
|
}, _marked12$1, null, [[0, 13]]);
|
|
21736
21900
|
}
|
|
21737
21901
|
function loadMoreMessageAttachments(action) {
|
|
21738
|
-
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext,
|
|
21902
|
+
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext, _t26;
|
|
21739
21903
|
return _regenerator().w(function (_context18) {
|
|
21740
21904
|
while (1) switch (_context18.p = _context18.n) {
|
|
21741
21905
|
case 0:
|
|
@@ -21779,15 +21943,15 @@ function loadMoreMessageAttachments(action) {
|
|
|
21779
21943
|
break;
|
|
21780
21944
|
case 8:
|
|
21781
21945
|
_context18.p = 8;
|
|
21782
|
-
|
|
21783
|
-
log.error('error in message attachment query',
|
|
21946
|
+
_t26 = _context18.v;
|
|
21947
|
+
log.error('error in message attachment query', _t26);
|
|
21784
21948
|
case 9:
|
|
21785
21949
|
return _context18.a(2);
|
|
21786
21950
|
}
|
|
21787
21951
|
}, _marked13$1, null, [[0, 8]]);
|
|
21788
21952
|
}
|
|
21789
21953
|
function pauseAttachmentUploading(action) {
|
|
21790
|
-
var attachmentId, isPaused,
|
|
21954
|
+
var attachmentId, isPaused, _t27;
|
|
21791
21955
|
return _regenerator().w(function (_context19) {
|
|
21792
21956
|
while (1) switch (_context19.p = _context19.n) {
|
|
21793
21957
|
case 0:
|
|
@@ -21809,15 +21973,15 @@ function pauseAttachmentUploading(action) {
|
|
|
21809
21973
|
break;
|
|
21810
21974
|
case 2:
|
|
21811
21975
|
_context19.p = 2;
|
|
21812
|
-
|
|
21813
|
-
log.error('error in pause attachment uploading',
|
|
21976
|
+
_t27 = _context19.v;
|
|
21977
|
+
log.error('error in pause attachment uploading', _t27);
|
|
21814
21978
|
case 3:
|
|
21815
21979
|
return _context19.a(2);
|
|
21816
21980
|
}
|
|
21817
21981
|
}, _marked14$1, null, [[0, 2]]);
|
|
21818
21982
|
}
|
|
21819
21983
|
function resumeAttachmentUploading(action) {
|
|
21820
|
-
var attachmentId, isResumed,
|
|
21984
|
+
var attachmentId, isResumed, _t28;
|
|
21821
21985
|
return _regenerator().w(function (_context20) {
|
|
21822
21986
|
while (1) switch (_context20.p = _context20.n) {
|
|
21823
21987
|
case 0:
|
|
@@ -21840,15 +22004,15 @@ function resumeAttachmentUploading(action) {
|
|
|
21840
22004
|
break;
|
|
21841
22005
|
case 2:
|
|
21842
22006
|
_context20.p = 2;
|
|
21843
|
-
|
|
21844
|
-
log.error('error in resume attachment uploading',
|
|
22007
|
+
_t28 = _context20.v;
|
|
22008
|
+
log.error('error in resume attachment uploading', _t28);
|
|
21845
22009
|
case 3:
|
|
21846
22010
|
return _context20.a(2);
|
|
21847
22011
|
}
|
|
21848
22012
|
}, _marked15$1, null, [[0, 2]]);
|
|
21849
22013
|
}
|
|
21850
22014
|
function getMessageMarkers(action) {
|
|
21851
|
-
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers,
|
|
22015
|
+
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers, _t29;
|
|
21852
22016
|
return _regenerator().w(function (_context21) {
|
|
21853
22017
|
while (1) switch (_context21.p = _context21.n) {
|
|
21854
22018
|
case 0:
|
|
@@ -21878,8 +22042,8 @@ function getMessageMarkers(action) {
|
|
|
21878
22042
|
break;
|
|
21879
22043
|
case 5:
|
|
21880
22044
|
_context21.p = 5;
|
|
21881
|
-
|
|
21882
|
-
log.error('error in get message markers',
|
|
22045
|
+
_t29 = _context21.v;
|
|
22046
|
+
log.error('error in get message markers', _t29);
|
|
21883
22047
|
case 6:
|
|
21884
22048
|
_context21.p = 6;
|
|
21885
22049
|
_context21.n = 7;
|
|
@@ -21892,8 +22056,7 @@ function getMessageMarkers(action) {
|
|
|
21892
22056
|
}, _marked16$1, null, [[0, 5, 6, 8]]);
|
|
21893
22057
|
}
|
|
21894
22058
|
function executeAddPollVote(channelId, pollId, optionId, message) {
|
|
21895
|
-
var
|
|
21896
|
-
var channel, user, vote, objs, _message$pollDetails5, _message$pollDetails6, _message$pollDetails7;
|
|
22059
|
+
var channel;
|
|
21897
22060
|
return _regenerator().w(function (_context22) {
|
|
21898
22061
|
while (1) switch (_context22.n) {
|
|
21899
22062
|
case 0:
|
|
@@ -21907,41 +22070,6 @@ function executeAddPollVote(channelId, pollId, optionId, message) {
|
|
|
21907
22070
|
}
|
|
21908
22071
|
return _context22.a(2);
|
|
21909
22072
|
case 2:
|
|
21910
|
-
user = getClient().user;
|
|
21911
|
-
vote = {
|
|
21912
|
-
optionId: optionId,
|
|
21913
|
-
createdAt: new Date().getTime(),
|
|
21914
|
-
user: {
|
|
21915
|
-
id: user.id,
|
|
21916
|
-
presence: {
|
|
21917
|
-
status: ((_user$presence = user.presence) === null || _user$presence === void 0 ? void 0 : _user$presence.status) || 'online'
|
|
21918
|
-
},
|
|
21919
|
-
profile: {
|
|
21920
|
-
avatar: user.avatarUrl || '',
|
|
21921
|
-
firstName: user.firstName,
|
|
21922
|
-
lastName: user.lastName,
|
|
21923
|
-
metadata: user.metadata || '',
|
|
21924
|
-
metadataMap: user.metadataMap || {},
|
|
21925
|
-
updatedAt: new Date().getTime(),
|
|
21926
|
-
username: user.username || '',
|
|
21927
|
-
createdAt: new Date().getTime()
|
|
21928
|
-
},
|
|
21929
|
-
createdAt: new Date().getTime()
|
|
21930
|
-
}
|
|
21931
|
-
};
|
|
21932
|
-
objs = [];
|
|
21933
|
-
if (!((_message$pollDetails = message.pollDetails) !== null && _message$pollDetails !== void 0 && _message$pollDetails.allowMultipleVotes) && ((_message$pollDetails2 = message.pollDetails) === null || _message$pollDetails2 === void 0 ? void 0 : (_message$pollDetails3 = _message$pollDetails2.voteDetails) === null || _message$pollDetails3 === void 0 ? void 0 : (_message$pollDetails4 = _message$pollDetails3.ownVotes) === null || _message$pollDetails4 === void 0 ? void 0 : _message$pollDetails4.length) > 0) {
|
|
21934
|
-
objs.push({
|
|
21935
|
-
type: 'deleteOwn',
|
|
21936
|
-
vote: (_message$pollDetails5 = message.pollDetails) === null || _message$pollDetails5 === void 0 ? void 0 : (_message$pollDetails6 = _message$pollDetails5.voteDetails) === null || _message$pollDetails6 === void 0 ? void 0 : (_message$pollDetails7 = _message$pollDetails6.ownVotes) === null || _message$pollDetails7 === void 0 ? void 0 : _message$pollDetails7[0],
|
|
21937
|
-
incrementVotesPerOptionCount: -1
|
|
21938
|
-
});
|
|
21939
|
-
}
|
|
21940
|
-
objs.push({
|
|
21941
|
-
type: 'addOwn',
|
|
21942
|
-
vote: vote,
|
|
21943
|
-
incrementVotesPerOptionCount: 1
|
|
21944
|
-
});
|
|
21945
22073
|
if (!(channel && message.id)) {
|
|
21946
22074
|
_context22.n = 4;
|
|
21947
22075
|
break;
|
|
@@ -21957,7 +22085,8 @@ function executeAddPollVote(channelId, pollId, optionId, message) {
|
|
|
21957
22085
|
}, _marked17$1);
|
|
21958
22086
|
}
|
|
21959
22087
|
function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
21960
|
-
var
|
|
22088
|
+
var _message$pollDetails, _message$pollDetails2, _message$pollDetails3, _message$pollDetails4;
|
|
22089
|
+
var channel, objs, _message$pollDetails5, _message$pollDetails6, _message$pollDetails7, _i2, _objs, obj;
|
|
21961
22090
|
return _regenerator().w(function (_context23) {
|
|
21962
22091
|
while (1) switch (_context23.n) {
|
|
21963
22092
|
case 0:
|
|
@@ -21977,25 +22106,42 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
|
21977
22106
|
}
|
|
21978
22107
|
return _context23.a(2);
|
|
21979
22108
|
case 3:
|
|
21980
|
-
|
|
22109
|
+
objs = [];
|
|
22110
|
+
if (!((_message$pollDetails = message.pollDetails) !== null && _message$pollDetails !== void 0 && _message$pollDetails.allowMultipleVotes) && ((_message$pollDetails2 = message.pollDetails) === null || _message$pollDetails2 === void 0 ? void 0 : (_message$pollDetails3 = _message$pollDetails2.voteDetails) === null || _message$pollDetails3 === void 0 ? void 0 : (_message$pollDetails4 = _message$pollDetails3.ownVotes) === null || _message$pollDetails4 === void 0 ? void 0 : _message$pollDetails4.length) > 0) {
|
|
22111
|
+
objs.push({
|
|
22112
|
+
type: 'deleteOwn',
|
|
22113
|
+
vote: (_message$pollDetails5 = message.pollDetails) === null || _message$pollDetails5 === void 0 ? void 0 : (_message$pollDetails6 = _message$pollDetails5.voteDetails) === null || _message$pollDetails6 === void 0 ? void 0 : (_message$pollDetails7 = _message$pollDetails6.ownVotes) === null || _message$pollDetails7 === void 0 ? void 0 : _message$pollDetails7[0]
|
|
22114
|
+
});
|
|
22115
|
+
}
|
|
22116
|
+
objs.push({
|
|
21981
22117
|
type: 'addOwn',
|
|
21982
|
-
vote: vote
|
|
21983
|
-
|
|
21984
|
-
|
|
22118
|
+
vote: vote
|
|
22119
|
+
});
|
|
22120
|
+
_i2 = 0, _objs = objs;
|
|
22121
|
+
case 4:
|
|
22122
|
+
if (!(_i2 < _objs.length)) {
|
|
22123
|
+
_context23.n = 6;
|
|
22124
|
+
break;
|
|
22125
|
+
}
|
|
22126
|
+
obj = _objs[_i2];
|
|
21985
22127
|
updateMessageOnMap(channel.id, {
|
|
21986
22128
|
messageId: message.id,
|
|
21987
22129
|
params: {}
|
|
21988
22130
|
}, obj);
|
|
21989
22131
|
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21990
|
-
_context23.n =
|
|
22132
|
+
_context23.n = 5;
|
|
21991
22133
|
return effects.put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21992
|
-
case
|
|
22134
|
+
case 5:
|
|
22135
|
+
_i2++;
|
|
22136
|
+
_context23.n = 4;
|
|
22137
|
+
break;
|
|
22138
|
+
case 6:
|
|
21993
22139
|
return _context23.a(2);
|
|
21994
22140
|
}
|
|
21995
22141
|
}, _marked18$1);
|
|
21996
22142
|
}
|
|
21997
22143
|
function addPollVote(action) {
|
|
21998
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$
|
|
22144
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence, user, vote, pendingAction, conflictCheck, channel, _Object$values, _store$getState$Messa, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj, _t30;
|
|
21999
22145
|
return _regenerator().w(function (_context24) {
|
|
22000
22146
|
while (1) switch (_context24.p = _context24.n) {
|
|
22001
22147
|
case 0:
|
|
@@ -22014,7 +22160,7 @@ function addPollVote(action) {
|
|
|
22014
22160
|
user: {
|
|
22015
22161
|
id: user.id,
|
|
22016
22162
|
presence: {
|
|
22017
|
-
status: ((_user$
|
|
22163
|
+
status: ((_user$presence = user.presence) === null || _user$presence === void 0 ? void 0 : _user$presence.status) || 'online'
|
|
22018
22164
|
},
|
|
22019
22165
|
profile: {
|
|
22020
22166
|
avatar: user.avatarUrl || '',
|
|
@@ -22058,8 +22204,7 @@ function addPollVote(action) {
|
|
|
22058
22204
|
case 2:
|
|
22059
22205
|
obj = {
|
|
22060
22206
|
type: 'addOwn',
|
|
22061
|
-
vote: vote
|
|
22062
|
-
incrementVotesPerOptionCount: 1
|
|
22207
|
+
vote: vote
|
|
22063
22208
|
};
|
|
22064
22209
|
updateMessageOnMap(channel.id, {
|
|
22065
22210
|
messageId: message.id,
|
|
@@ -22076,19 +22221,21 @@ function addPollVote(action) {
|
|
|
22076
22221
|
_context24.n = 5;
|
|
22077
22222
|
break;
|
|
22078
22223
|
}
|
|
22079
|
-
|
|
22224
|
+
_context24.n = 5;
|
|
22225
|
+
return effects.call(updateMessageOptimisticallyForAddPollVote, channelId, message, vote);
|
|
22080
22226
|
case 5:
|
|
22081
22227
|
if (!conflictCheck.shouldSkip && !isResend) {
|
|
22082
22228
|
setPendingPollAction(pendingAction);
|
|
22083
22229
|
}
|
|
22084
|
-
|
|
22230
|
+
_context24.n = 6;
|
|
22231
|
+
return effects.call(executeAddPollVote, channelId, pollId, optionId, message);
|
|
22085
22232
|
case 6:
|
|
22086
22233
|
_context24.n = 8;
|
|
22087
22234
|
break;
|
|
22088
22235
|
case 7:
|
|
22089
22236
|
_context24.p = 7;
|
|
22090
|
-
|
|
22091
|
-
log.error('error in add poll vote',
|
|
22237
|
+
_t30 = _context24.v;
|
|
22238
|
+
log.error('error in add poll vote', _t30);
|
|
22092
22239
|
case 8:
|
|
22093
22240
|
return _context24.a(2);
|
|
22094
22241
|
}
|
|
@@ -22156,8 +22303,7 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
|
|
|
22156
22303
|
case 3:
|
|
22157
22304
|
obj = {
|
|
22158
22305
|
type: 'deleteOwn',
|
|
22159
|
-
vote: vote
|
|
22160
|
-
incrementVotesPerOptionCount: -1
|
|
22306
|
+
vote: vote
|
|
22161
22307
|
};
|
|
22162
22308
|
updateMessageOnMap(channel.id, {
|
|
22163
22309
|
messageId: message.id,
|
|
@@ -22172,7 +22318,7 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
|
|
|
22172
22318
|
}, _marked21$1);
|
|
22173
22319
|
}
|
|
22174
22320
|
function deletePollVote(action) {
|
|
22175
|
-
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,
|
|
22321
|
+
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;
|
|
22176
22322
|
return _regenerator().w(function (_context27) {
|
|
22177
22323
|
while (1) switch (_context27.p = _context27.n) {
|
|
22178
22324
|
case 0:
|
|
@@ -22221,8 +22367,7 @@ function deletePollVote(action) {
|
|
|
22221
22367
|
case 3:
|
|
22222
22368
|
obj = {
|
|
22223
22369
|
type: 'deleteOwn',
|
|
22224
|
-
vote: vote
|
|
22225
|
-
incrementVotesPerOptionCount: -1
|
|
22370
|
+
vote: vote
|
|
22226
22371
|
};
|
|
22227
22372
|
updateMessageOnMap(channel.id, {
|
|
22228
22373
|
messageId: message.id,
|
|
@@ -22239,19 +22384,21 @@ function deletePollVote(action) {
|
|
|
22239
22384
|
_context27.n = 6;
|
|
22240
22385
|
break;
|
|
22241
22386
|
}
|
|
22242
|
-
|
|
22387
|
+
_context27.n = 6;
|
|
22388
|
+
return effects.call(updateMessageOptimisticallyForDeletePollVote, channelId, message, vote);
|
|
22243
22389
|
case 6:
|
|
22244
22390
|
if (!conflictCheck.shouldSkip && !isResend) {
|
|
22245
22391
|
setPendingPollAction(pendingAction);
|
|
22246
22392
|
}
|
|
22247
|
-
|
|
22393
|
+
_context27.n = 7;
|
|
22394
|
+
return effects.call(executeDeletePollVote, channelId, pollId, optionId, message);
|
|
22248
22395
|
case 7:
|
|
22249
22396
|
_context27.n = 9;
|
|
22250
22397
|
break;
|
|
22251
22398
|
case 8:
|
|
22252
22399
|
_context27.p = 8;
|
|
22253
|
-
|
|
22254
|
-
log.error('error in delete poll vote',
|
|
22400
|
+
_t31 = _context27.v;
|
|
22401
|
+
log.error('error in delete poll vote', _t31);
|
|
22255
22402
|
case 9:
|
|
22256
22403
|
return _context27.a(2);
|
|
22257
22404
|
}
|
|
@@ -22267,8 +22414,7 @@ function executeClosePoll(channelId, pollId, message) {
|
|
|
22267
22414
|
case 1:
|
|
22268
22415
|
channel = _context28.v;
|
|
22269
22416
|
obj = {
|
|
22270
|
-
type: 'close'
|
|
22271
|
-
incrementVotesPerOptionCount: 0
|
|
22417
|
+
type: 'close'
|
|
22272
22418
|
};
|
|
22273
22419
|
updateMessageOnMap(channel.id, {
|
|
22274
22420
|
messageId: message.id,
|
|
@@ -22329,7 +22475,7 @@ function updateMessageOptimisticallyForClosePoll(channelId, message) {
|
|
|
22329
22475
|
}, _marked24$1);
|
|
22330
22476
|
}
|
|
22331
22477
|
function closePoll(action) {
|
|
22332
|
-
var payload, channelId, pollId, message, sceytChatClient, connectionState,
|
|
22478
|
+
var payload, channelId, pollId, message, sceytChatClient, connectionState, _t32;
|
|
22333
22479
|
return _regenerator().w(function (_context30) {
|
|
22334
22480
|
while (1) switch (_context30.p = _context30.n) {
|
|
22335
22481
|
case 0:
|
|
@@ -22346,7 +22492,8 @@ function closePoll(action) {
|
|
|
22346
22492
|
_context30.n = 2;
|
|
22347
22493
|
break;
|
|
22348
22494
|
}
|
|
22349
|
-
|
|
22495
|
+
_context30.n = 1;
|
|
22496
|
+
return effects.call(updateMessageOptimisticallyForClosePoll, channelId, message);
|
|
22350
22497
|
case 1:
|
|
22351
22498
|
setPendingPollAction({
|
|
22352
22499
|
type: 'CLOSE_POLL',
|
|
@@ -22356,14 +22503,15 @@ function closePoll(action) {
|
|
|
22356
22503
|
});
|
|
22357
22504
|
return _context30.a(2);
|
|
22358
22505
|
case 2:
|
|
22359
|
-
|
|
22506
|
+
_context30.n = 3;
|
|
22507
|
+
return effects.call(executeClosePoll, channelId, pollId, message);
|
|
22360
22508
|
case 3:
|
|
22361
22509
|
_context30.n = 5;
|
|
22362
22510
|
break;
|
|
22363
22511
|
case 4:
|
|
22364
22512
|
_context30.p = 4;
|
|
22365
|
-
|
|
22366
|
-
log.error('error in close poll',
|
|
22513
|
+
_t32 = _context30.v;
|
|
22514
|
+
log.error('error in close poll', _t32);
|
|
22367
22515
|
case 5:
|
|
22368
22516
|
return _context30.a(2);
|
|
22369
22517
|
}
|
|
@@ -22452,7 +22600,7 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
|
|
|
22452
22600
|
}, _marked27$1);
|
|
22453
22601
|
}
|
|
22454
22602
|
function retractPollVote(action) {
|
|
22455
|
-
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator4, _step4, _message$pollDetails12, _message$pollDetails13, vote,
|
|
22603
|
+
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator4, _step4, _message$pollDetails12, _message$pollDetails13, vote, _t33;
|
|
22456
22604
|
return _regenerator().w(function (_context33) {
|
|
22457
22605
|
while (1) switch (_context33.p = _context33.n) {
|
|
22458
22606
|
case 0:
|
|
@@ -22470,15 +22618,15 @@ function retractPollVote(action) {
|
|
|
22470
22618
|
vote = _step4.value;
|
|
22471
22619
|
objs.push({
|
|
22472
22620
|
type: 'deleteOwn',
|
|
22473
|
-
vote: vote
|
|
22474
|
-
incrementVotesPerOptionCount: -1
|
|
22621
|
+
vote: vote
|
|
22475
22622
|
});
|
|
22476
22623
|
}
|
|
22477
22624
|
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
22478
22625
|
_context33.n = 2;
|
|
22479
22626
|
break;
|
|
22480
22627
|
}
|
|
22481
|
-
|
|
22628
|
+
_context33.n = 1;
|
|
22629
|
+
return effects.call(updateMessageOptimisticallyForRetractPollVote, channelId, message, objs);
|
|
22482
22630
|
case 1:
|
|
22483
22631
|
setPendingPollAction({
|
|
22484
22632
|
type: 'RETRACT_POLL_VOTE',
|
|
@@ -22488,21 +22636,22 @@ function retractPollVote(action) {
|
|
|
22488
22636
|
});
|
|
22489
22637
|
return _context33.a(2);
|
|
22490
22638
|
case 2:
|
|
22491
|
-
|
|
22639
|
+
_context33.n = 3;
|
|
22640
|
+
return effects.call(executeRetractPollVote, channelId, pollId, message, objs, isResend);
|
|
22492
22641
|
case 3:
|
|
22493
22642
|
_context33.n = 5;
|
|
22494
22643
|
break;
|
|
22495
22644
|
case 4:
|
|
22496
22645
|
_context33.p = 4;
|
|
22497
|
-
|
|
22498
|
-
log.error('error in retract poll vote',
|
|
22646
|
+
_t33 = _context33.v;
|
|
22647
|
+
log.error('error in retract poll vote', _t33);
|
|
22499
22648
|
case 5:
|
|
22500
22649
|
return _context33.a(2);
|
|
22501
22650
|
}
|
|
22502
22651
|
}, _marked28$1, null, [[0, 4]]);
|
|
22503
22652
|
}
|
|
22504
22653
|
function resendPendingPollActions(action) {
|
|
22505
|
-
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy,
|
|
22654
|
+
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy, _t34;
|
|
22506
22655
|
return _regenerator().w(function (_context34) {
|
|
22507
22656
|
while (1) switch (_context34.p = _context34.n) {
|
|
22508
22657
|
case 0:
|
|
@@ -22551,15 +22700,15 @@ function resendPendingPollActions(action) {
|
|
|
22551
22700
|
break;
|
|
22552
22701
|
case 2:
|
|
22553
22702
|
_context34.p = 2;
|
|
22554
|
-
|
|
22555
|
-
log.error('error in resend pending poll actions',
|
|
22703
|
+
_t34 = _context34.v;
|
|
22704
|
+
log.error('error in resend pending poll actions', _t34);
|
|
22556
22705
|
case 3:
|
|
22557
22706
|
return _context34.a(2);
|
|
22558
22707
|
}
|
|
22559
22708
|
}, _marked29$1, null, [[0, 2]]);
|
|
22560
22709
|
}
|
|
22561
22710
|
function getPollVotes(action) {
|
|
22562
|
-
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes,
|
|
22711
|
+
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes, _t35;
|
|
22563
22712
|
return _regenerator().w(function (_context35) {
|
|
22564
22713
|
while (1) switch (_context35.p = _context35.n) {
|
|
22565
22714
|
case 0:
|
|
@@ -22625,8 +22774,8 @@ function getPollVotes(action) {
|
|
|
22625
22774
|
break;
|
|
22626
22775
|
case 7:
|
|
22627
22776
|
_context35.p = 7;
|
|
22628
|
-
|
|
22629
|
-
log.error('ERROR in get poll votes',
|
|
22777
|
+
_t35 = _context35.v;
|
|
22778
|
+
log.error('ERROR in get poll votes', _t35);
|
|
22630
22779
|
_context35.n = 8;
|
|
22631
22780
|
return effects.put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
22632
22781
|
case 8:
|
|
@@ -22635,7 +22784,7 @@ function getPollVotes(action) {
|
|
|
22635
22784
|
}, _marked30$1, null, [[0, 7]]);
|
|
22636
22785
|
}
|
|
22637
22786
|
function loadMorePollVotes(action) {
|
|
22638
|
-
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes,
|
|
22787
|
+
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes, _t36;
|
|
22639
22788
|
return _regenerator().w(function (_context36) {
|
|
22640
22789
|
while (1) switch (_context36.p = _context36.n) {
|
|
22641
22790
|
case 0:
|
|
@@ -22693,8 +22842,8 @@ function loadMorePollVotes(action) {
|
|
|
22693
22842
|
break;
|
|
22694
22843
|
case 6:
|
|
22695
22844
|
_context36.p = 6;
|
|
22696
|
-
|
|
22697
|
-
log.error('ERROR in load more poll votes',
|
|
22845
|
+
_t36 = _context36.v;
|
|
22846
|
+
log.error('ERROR in load more poll votes', _t36);
|
|
22698
22847
|
_context36.n = 7;
|
|
22699
22848
|
return effects.put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
22700
22849
|
case 7:
|
|
@@ -22910,7 +23059,7 @@ function loadMoreMembers(action) {
|
|
|
22910
23059
|
}, _marked2$3, null, [[0, 7, 8, 10]]);
|
|
22911
23060
|
}
|
|
22912
23061
|
function addMembers(action) {
|
|
22913
|
-
var payload, members, channelId, channel, membersToAdd, addedMembers, membersIds, messageToSend, updateChannelData,
|
|
23062
|
+
var payload, members, channelId, channel, membersToAdd, addedMembers, whoDoesNotAdded, membersIds, messageToSend, updateChannelData, _t3;
|
|
22914
23063
|
return _regenerator().w(function (_context3) {
|
|
22915
23064
|
while (1) switch (_context3.p = _context3.n) {
|
|
22916
23065
|
case 0:
|
|
@@ -22922,7 +23071,7 @@ function addMembers(action) {
|
|
|
22922
23071
|
case 1:
|
|
22923
23072
|
channel = _context3.v;
|
|
22924
23073
|
if (!channel) {
|
|
22925
|
-
_context3.n =
|
|
23074
|
+
_context3.n = 7;
|
|
22926
23075
|
break;
|
|
22927
23076
|
}
|
|
22928
23077
|
membersToAdd = members.map(function (mem) {
|
|
@@ -22933,14 +23082,30 @@ function addMembers(action) {
|
|
|
22933
23082
|
return effects.call(channel.addMembers, membersToAdd);
|
|
22934
23083
|
case 2:
|
|
22935
23084
|
addedMembers = _context3.v;
|
|
22936
|
-
|
|
23085
|
+
whoDoesNotAdded = members.filter(function (mem) {
|
|
23086
|
+
return !addedMembers.some(function (addedMem) {
|
|
23087
|
+
return addedMem.id === mem.id;
|
|
23088
|
+
});
|
|
23089
|
+
});
|
|
23090
|
+
if (!whoDoesNotAdded.length) {
|
|
22937
23091
|
_context3.n = 3;
|
|
22938
23092
|
break;
|
|
22939
23093
|
}
|
|
23094
|
+
_context3.n = 3;
|
|
23095
|
+
return effects.put(setActionIsRestrictedAC(true, true, whoDoesNotAdded));
|
|
23096
|
+
case 3:
|
|
23097
|
+
if (!(channel.type === DEFAULT_CHANNEL_TYPE.GROUP || channel.type === DEFAULT_CHANNEL_TYPE.PRIVATE)) {
|
|
23098
|
+
_context3.n = 4;
|
|
23099
|
+
break;
|
|
23100
|
+
}
|
|
22940
23101
|
membersIds = [];
|
|
22941
23102
|
addedMembers.forEach(function (mem) {
|
|
22942
23103
|
membersIds.push(mem.id);
|
|
22943
23104
|
});
|
|
23105
|
+
if (!membersIds.length) {
|
|
23106
|
+
_context3.n = 4;
|
|
23107
|
+
break;
|
|
23108
|
+
}
|
|
22944
23109
|
messageToSend = {
|
|
22945
23110
|
metadata: {
|
|
22946
23111
|
m: membersIds
|
|
@@ -22950,41 +23115,34 @@ function addMembers(action) {
|
|
|
22950
23115
|
attachments: [],
|
|
22951
23116
|
type: 'system'
|
|
22952
23117
|
};
|
|
22953
|
-
_context3.n = 3;
|
|
22954
|
-
return effects.put(sendTextMessageAC(messageToSend, channelId, CONNECTION_STATUS.CONNECTED));
|
|
22955
|
-
case 3:
|
|
22956
23118
|
_context3.n = 4;
|
|
22957
|
-
return effects.put(
|
|
23119
|
+
return effects.put(sendTextMessageAC(messageToSend, channelId, CONNECTION_STATUS.CONNECTED));
|
|
22958
23120
|
case 4:
|
|
23121
|
+
_context3.n = 5;
|
|
23122
|
+
return effects.put(addMembersToListAC(addedMembers));
|
|
23123
|
+
case 5:
|
|
22959
23124
|
updateChannelOnAllChannels(channel.id, {
|
|
22960
23125
|
memberCount: channel.memberCount + addedMembers.length
|
|
22961
23126
|
});
|
|
22962
|
-
_context3.n =
|
|
23127
|
+
_context3.n = 6;
|
|
22963
23128
|
return effects.call(updateActiveChannelMembersAdd, addedMembers) || {};
|
|
22964
|
-
case
|
|
23129
|
+
case 6:
|
|
22965
23130
|
updateChannelData = _context3.v;
|
|
22966
|
-
_context3.n =
|
|
23131
|
+
_context3.n = 7;
|
|
22967
23132
|
return effects.put(updateChannelDataAC(channel.id, _extends({
|
|
22968
23133
|
memberCount: channel.memberCount + addedMembers.length
|
|
22969
23134
|
}, updateChannelData)));
|
|
22970
|
-
case
|
|
23135
|
+
case 7:
|
|
22971
23136
|
_context3.n = 9;
|
|
22972
23137
|
break;
|
|
22973
|
-
case 7:
|
|
22974
|
-
_context3.p = 7;
|
|
22975
|
-
_t3 = _context3.v;
|
|
22976
|
-
if (!(_t3.code === 1041)) {
|
|
22977
|
-
_context3.n = 8;
|
|
22978
|
-
break;
|
|
22979
|
-
}
|
|
22980
|
-
_context3.n = 8;
|
|
22981
|
-
return effects.put(setActionIsRestrictedAC(true, true, (action === null || action === void 0 ? void 0 : (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.members) || []));
|
|
22982
23138
|
case 8:
|
|
23139
|
+
_context3.p = 8;
|
|
23140
|
+
_t3 = _context3.v;
|
|
22983
23141
|
log.error('error on add members... ', _t3);
|
|
22984
23142
|
case 9:
|
|
22985
23143
|
return _context3.a(2);
|
|
22986
23144
|
}
|
|
22987
|
-
}, _marked3$2, null, [[0,
|
|
23145
|
+
}, _marked3$2, null, [[0, 8]]);
|
|
22988
23146
|
}
|
|
22989
23147
|
function kickMemberFromChannel(action) {
|
|
22990
23148
|
var payload, memberId, channelId, channel, removedMembers, membersIds, messageToSend, updateChannelData;
|
|
@@ -23139,11 +23297,11 @@ function reportMember(action) {
|
|
|
23139
23297
|
}, _marked7$2, null, [[1, 3]]);
|
|
23140
23298
|
}
|
|
23141
23299
|
function getRoles(action) {
|
|
23142
|
-
var _action$
|
|
23300
|
+
var _action$payload, timeout, attempts, SceytChatClient, roles, _t8;
|
|
23143
23301
|
return _regenerator().w(function (_context8) {
|
|
23144
23302
|
while (1) switch (_context8.p = _context8.n) {
|
|
23145
23303
|
case 0:
|
|
23146
|
-
_action$
|
|
23304
|
+
_action$payload = action.payload, timeout = _action$payload.timeout, attempts = _action$payload.attempts;
|
|
23147
23305
|
_context8.p = 1;
|
|
23148
23306
|
SceytChatClient = getClient();
|
|
23149
23307
|
if (!(store.getState().UserReducer.connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
|
|
@@ -24292,7 +24450,9 @@ var MembersText = styled__default.div(_templateObject7$1 || (_templateObject7$1
|
|
|
24292
24450
|
var Center = styled__default.div(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-top: 24px;\n"])));
|
|
24293
24451
|
|
|
24294
24452
|
var ActionRestrictedPopup = function ActionRestrictedPopup(_ref) {
|
|
24295
|
-
var fromChannel = _ref.fromChannel
|
|
24453
|
+
var fromChannel = _ref.fromChannel,
|
|
24454
|
+
members = _ref.members,
|
|
24455
|
+
contactsMap = _ref.contactsMap;
|
|
24296
24456
|
var dispatch = useDispatch();
|
|
24297
24457
|
var _useColor = useColors(),
|
|
24298
24458
|
background = _useColor[THEME_COLORS.BACKGROUND],
|
|
@@ -24309,6 +24469,29 @@ var ActionRestrictedPopup = function ActionRestrictedPopup(_ref) {
|
|
|
24309
24469
|
dispatch(setOpenInviteModalAC(true));
|
|
24310
24470
|
handleClose();
|
|
24311
24471
|
};
|
|
24472
|
+
var getExcludedContactsMessage = function getExcludedContactsMessage(fromChannel) {
|
|
24473
|
+
var excludedContacts = members || [];
|
|
24474
|
+
var count = excludedContacts.length;
|
|
24475
|
+
var fromContact = getShowOnlyContactUsers() || false;
|
|
24476
|
+
var makeName = function makeName(member) {
|
|
24477
|
+
return makeUsername(contactsMap[member.id], member, fromContact, false);
|
|
24478
|
+
};
|
|
24479
|
+
var prefix = fromChannel ? '' : 'The group was created, but ';
|
|
24480
|
+
var suffix = fromChannel ? " couldn't be added to the group. You can share an invite link with them." : " couldn't be added. You can share an invite link with them.";
|
|
24481
|
+
if (count === 1) {
|
|
24482
|
+
var name = makeName(excludedContacts[0]);
|
|
24483
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, prefix, /*#__PURE__*/React__default.createElement(BoltText, null, name), suffix);
|
|
24484
|
+
} else if (count === 2) {
|
|
24485
|
+
var name1 = makeName(excludedContacts[0]);
|
|
24486
|
+
var name2 = makeName(excludedContacts[1]);
|
|
24487
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, prefix, /*#__PURE__*/React__default.createElement(BoltText, null, name1), " and ", /*#__PURE__*/React__default.createElement(BoltText, null, name2), suffix);
|
|
24488
|
+
} else if (count > 2) {
|
|
24489
|
+
var firstName = makeName(excludedContacts[0]);
|
|
24490
|
+
var othersCount = count - 1;
|
|
24491
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, prefix, /*#__PURE__*/React__default.createElement(BoltText, null, firstName, " and ", othersCount, " others"), suffix);
|
|
24492
|
+
}
|
|
24493
|
+
return null;
|
|
24494
|
+
};
|
|
24312
24495
|
return /*#__PURE__*/React__default.createElement(PopupContainer, null, /*#__PURE__*/React__default.createElement(Popup, {
|
|
24313
24496
|
backgroundColor: background,
|
|
24314
24497
|
maxWidth: '520px',
|
|
@@ -24323,23 +24506,23 @@ var ActionRestrictedPopup = function ActionRestrictedPopup(_ref) {
|
|
|
24323
24506
|
}), /*#__PURE__*/React__default.createElement(PopupName, {
|
|
24324
24507
|
color: textPrimary,
|
|
24325
24508
|
marginBottom: '20px'
|
|
24326
|
-
},
|
|
24509
|
+
}, "Privacy note"), /*#__PURE__*/React__default.createElement(PopupDescription, {
|
|
24327
24510
|
color: textPrimary,
|
|
24328
24511
|
highlightColor: linkColor
|
|
24329
|
-
}, fromChannel
|
|
24512
|
+
}, getExcludedContactsMessage(fromChannel))), /*#__PURE__*/React__default.createElement(PopupFooter, {
|
|
24330
24513
|
backgroundColor: surface1
|
|
24331
|
-
},
|
|
24514
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
24332
24515
|
type: 'button',
|
|
24333
24516
|
color: textPrimary,
|
|
24334
24517
|
backgroundColor: 'transparent',
|
|
24335
24518
|
onClick: handleClose
|
|
24336
|
-
}, "Cancel")
|
|
24519
|
+
}, "Cancel"), /*#__PURE__*/React__default.createElement(Button, {
|
|
24337
24520
|
type: 'button',
|
|
24338
24521
|
backgroundColor: accentColor,
|
|
24339
24522
|
color: textOnPrimary,
|
|
24340
24523
|
borderRadius: '8px',
|
|
24341
|
-
onClick:
|
|
24342
|
-
},
|
|
24524
|
+
onClick: handleInvite
|
|
24525
|
+
}, "Invite"))));
|
|
24343
24526
|
};
|
|
24344
24527
|
|
|
24345
24528
|
var UnavailableInviteKeyPopup = function UnavailableInviteKeyPopup() {
|
|
@@ -24672,9 +24855,11 @@ var SceytChat = function SceytChat(_ref) {
|
|
|
24672
24855
|
highlightedBackground: highlightedBackground,
|
|
24673
24856
|
id: 'sceyt_chat_container',
|
|
24674
24857
|
chatMinWidth: chatMinWidth
|
|
24675
|
-
}, children, embeddedJoinGroupPopup && joinPopup && /*#__PURE__*/React__default.createElement(EmbeddedPopupWrapper, null, joinPopup), (restricted === null || restricted === void 0 ? void 0 : restricted.isRestricted) && /*#__PURE__*/React__default.createElement(ActionRestrictedPopup, {
|
|
24676
|
-
fromChannel: restricted === null || restricted === void 0 ? void 0 : restricted.fromChannel
|
|
24677
|
-
|
|
24858
|
+
}, children, embeddedJoinGroupPopup && joinPopup && /*#__PURE__*/React__default.createElement(EmbeddedPopupWrapper, null, joinPopup), (restricted === null || restricted === void 0 ? void 0 : restricted.isRestricted) && (/*#__PURE__*/React__default.createElement(ActionRestrictedPopup, {
|
|
24859
|
+
fromChannel: restricted === null || restricted === void 0 ? void 0 : restricted.fromChannel,
|
|
24860
|
+
members: restricted === null || restricted === void 0 ? void 0 : restricted.members,
|
|
24861
|
+
contactsMap: contactsMap
|
|
24862
|
+
})), !channelInviteKeyAvailable && /*#__PURE__*/React__default.createElement(UnavailableInviteKeyPopup, null))) : '', !embeddedJoinGroupPopup && joinPopup);
|
|
24678
24863
|
};
|
|
24679
24864
|
var Container$2 = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n height: 100vh;\n"])));
|
|
24680
24865
|
var ChatContainer = styled__default.div(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n height: 100%;\n max-height: 100vh;\n min-width: ", ";\n background-color: ", ";\n position: relative;\n\n /* Global highlighted background styles */\n ::selection {\n background-color: ", ";\n }\n\n ::-moz-selection {\n background-color: ", ";\n }\n\n /* For text selection highlighting */\n *::selection {\n background-color: ", ";\n }\n\n *::-moz-selection {\n background-color: ", ";\n }\n"])), function (props) {
|
|
@@ -27800,7 +27985,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
27800
27985
|
loadMoreChannels: handleLoadMoreChannels,
|
|
27801
27986
|
searchValue: searchValue
|
|
27802
27987
|
}, !searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, channels.map(function (channel) {
|
|
27803
|
-
return ListItem ? (/*#__PURE__*/React__default.createElement(ListItem, {
|
|
27988
|
+
return !getPendingDeleteChannel(channel.id) && (ListItem ? (/*#__PURE__*/React__default.createElement(ListItem, {
|
|
27804
27989
|
channel: channel,
|
|
27805
27990
|
setSelectedChannel: setSelectedChannel,
|
|
27806
27991
|
key: channel.id
|
|
@@ -27833,7 +28018,7 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
27833
28018
|
getCustomLatestMessage: getCustomLatestMessage,
|
|
27834
28019
|
doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
|
|
27835
28020
|
showPhoneNumber: showPhoneNumber
|
|
27836
|
-
}));
|
|
28021
|
+
})));
|
|
27837
28022
|
}))) : 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, {
|
|
27838
28023
|
color: textSecondary,
|
|
27839
28024
|
fontSize: searchedChannelsTitleFontSize
|
|
@@ -28517,6 +28702,9 @@ var pollVotesLoadingStateSelector = function pollVotesLoadingStateSelector(store
|
|
|
28517
28702
|
var unreadScrollToSelector = function unreadScrollToSelector(store) {
|
|
28518
28703
|
return store.MessageReducer.unreadScrollTo;
|
|
28519
28704
|
};
|
|
28705
|
+
var unreadMessageIdSelector = function unreadMessageIdSelector(store) {
|
|
28706
|
+
return store.MessageReducer.unreadMessageId;
|
|
28707
|
+
};
|
|
28520
28708
|
|
|
28521
28709
|
var _path$v;
|
|
28522
28710
|
function _extends$w() {
|
|
@@ -31062,6 +31250,10 @@ var _templateObject$t, _templateObject2$p, _templateObject3$k;
|
|
|
31062
31250
|
function MessageActions(_ref) {
|
|
31063
31251
|
var _ref$isPollMessage = _ref.isPollMessage,
|
|
31064
31252
|
isPollMessage = _ref$isPollMessage === void 0 ? false : _ref$isPollMessage,
|
|
31253
|
+
_ref$allowVoteRetract = _ref.allowVoteRetract,
|
|
31254
|
+
allowVoteRetract = _ref$allowVoteRetract === void 0 ? false : _ref$allowVoteRetract,
|
|
31255
|
+
_ref$pollClosed = _ref.pollClosed,
|
|
31256
|
+
pollClosed = _ref$pollClosed === void 0 ? false : _ref$pollClosed,
|
|
31065
31257
|
editModeToggle = _ref.editModeToggle,
|
|
31066
31258
|
channel = _ref.channel,
|
|
31067
31259
|
handleResendMessage = _ref.handleResendMessage,
|
|
@@ -31154,7 +31346,7 @@ function MessageActions(_ref) {
|
|
|
31154
31346
|
}, /*#__PURE__*/React__default.createElement(EditMessageContainer, {
|
|
31155
31347
|
backgroundColor: backgroundSections,
|
|
31156
31348
|
className: 'message_actions_cont '
|
|
31157
|
-
}, showMessageReaction &&
|
|
31349
|
+
}, showMessageReaction && messageStatus !== MESSAGE_DELIVERY_STATUS.PENDING && checkActionPermission('addMessageReaction') && (/*#__PURE__*/React__default.createElement(Action, {
|
|
31158
31350
|
order: reactionIconOrder || 0,
|
|
31159
31351
|
iconColor: messageActionIconsColor || iconInactive,
|
|
31160
31352
|
hoverBackgroundColor: backgroundHovered,
|
|
@@ -31223,7 +31415,7 @@ function MessageActions(_ref) {
|
|
|
31223
31415
|
disabledColor: textSecondary,
|
|
31224
31416
|
bgColor: tooltipBackground,
|
|
31225
31417
|
direction: 'top'
|
|
31226
|
-
}, copyIconTooltipText || 'Copy', /*#__PURE__*/React__default.createElement(SvgArrowDown, null)), copyIcon || /*#__PURE__*/React__default.createElement(SvgCopyIcon, null))), isPollMessage && (/*#__PURE__*/React__default.createElement(Action, {
|
|
31418
|
+
}, copyIconTooltipText || 'Copy', /*#__PURE__*/React__default.createElement(SvgArrowDown, null)), copyIcon || /*#__PURE__*/React__default.createElement(SvgCopyIcon, null))), isPollMessage && allowVoteRetract && !pollClosed && (/*#__PURE__*/React__default.createElement(Action, {
|
|
31227
31419
|
onClick: handleRetractVote,
|
|
31228
31420
|
iconColor: messageActionIconsColor || iconInactive,
|
|
31229
31421
|
hoverBackgroundColor: backgroundHovered,
|
|
@@ -31232,7 +31424,7 @@ function MessageActions(_ref) {
|
|
|
31232
31424
|
disabledColor: textSecondary,
|
|
31233
31425
|
bgColor: tooltipBackground,
|
|
31234
31426
|
direction: 'top'
|
|
31235
|
-
}, "Retract Vote", /*#__PURE__*/React__default.createElement(SvgArrowDown, null)), retractVoteIcon || /*#__PURE__*/React__default.createElement(SvgRetractVote, null))),
|
|
31427
|
+
}, "Retract Vote", /*#__PURE__*/React__default.createElement(SvgArrowDown, null)), retractVoteIcon || /*#__PURE__*/React__default.createElement(SvgRetractVote, null))), isPollMessage && !isIncoming && !pollClosed && (/*#__PURE__*/React__default.createElement(Action, {
|
|
31236
31428
|
onClick: handleEndVote,
|
|
31237
31429
|
iconColor: messageActionIconsColor || iconInactive,
|
|
31238
31430
|
hoverBackgroundColor: backgroundHovered,
|
|
@@ -31241,7 +31433,7 @@ function MessageActions(_ref) {
|
|
|
31241
31433
|
disabledColor: textSecondary,
|
|
31242
31434
|
bgColor: tooltipBackground,
|
|
31243
31435
|
direction: 'top'
|
|
31244
|
-
}, "End Vote", /*#__PURE__*/React__default.createElement(SvgArrowDown, null)), endVoteIcon || /*#__PURE__*/React__default.createElement(SvgEndVote, null))), showForwardMessage && forwardMessagePermitted && messageStatus !== MESSAGE_DELIVERY_STATUS.PENDING && (/*#__PURE__*/React__default.createElement(Action, {
|
|
31436
|
+
}, "End Vote", /*#__PURE__*/React__default.createElement(SvgArrowDown, null)), endVoteIcon || /*#__PURE__*/React__default.createElement(SvgEndVote, null))), showForwardMessage && forwardMessagePermitted && messageStatus !== MESSAGE_DELIVERY_STATUS.PENDING && !isPollMessage && (/*#__PURE__*/React__default.createElement(Action, {
|
|
31245
31437
|
order: forwardIconOrder || 5,
|
|
31246
31438
|
iconColor: messageActionIconsColor || iconInactive,
|
|
31247
31439
|
hoverBackgroundColor: backgroundHovered,
|
|
@@ -36125,11 +36317,11 @@ var PollMessage = function PollMessage(_ref) {
|
|
|
36125
36317
|
onClick: handleResultsClick,
|
|
36126
36318
|
cursor: poll.anonymous ? 'default' : 'pointer'
|
|
36127
36319
|
}, optionVotesUsers.map(function (vote) {
|
|
36128
|
-
var _vote$user, _vote$user2, _vote$user2$profile, _vote$user3, _vote$user3$profile;
|
|
36320
|
+
var _vote$user, _vote$user2, _vote$user2$profile, _vote$user3, _vote$user3$profile, _vote$user4;
|
|
36129
36321
|
return /*#__PURE__*/React__default.createElement(Avatar, {
|
|
36130
36322
|
key: vote === null || vote === void 0 ? void 0 : (_vote$user = vote.user) === null || _vote$user === void 0 ? void 0 : _vote$user.id,
|
|
36131
36323
|
image: vote === null || vote === void 0 ? void 0 : (_vote$user2 = vote.user) === null || _vote$user2 === void 0 ? void 0 : (_vote$user2$profile = _vote$user2.profile) === null || _vote$user2$profile === void 0 ? void 0 : _vote$user2$profile.avatar,
|
|
36132
|
-
name: vote === null || vote === void 0 ? void 0 : (_vote$user3 = vote.user) === null || _vote$user3 === void 0 ? void 0 : (_vote$user3$profile = _vote$user3.profile) === null || _vote$user3$profile === void 0 ? void 0 : _vote$user3$profile.firstName,
|
|
36324
|
+
name: (vote === null || vote === void 0 ? void 0 : (_vote$user3 = vote.user) === null || _vote$user3 === void 0 ? void 0 : (_vote$user3$profile = _vote$user3.profile) === null || _vote$user3$profile === void 0 ? void 0 : _vote$user3$profile.firstName) || (vote === null || vote === void 0 ? void 0 : (_vote$user4 = vote.user) === null || _vote$user4 === void 0 ? void 0 : _vote$user4.id),
|
|
36133
36325
|
size: 18,
|
|
36134
36326
|
textSize: 12,
|
|
36135
36327
|
setDefaultAvatar: true,
|
|
@@ -36675,6 +36867,7 @@ var FaviconImg = styled__default.img(_templateObject1$a || (_templateObject1$a =
|
|
|
36675
36867
|
|
|
36676
36868
|
var _templateObject$H, _templateObject2$C, _templateObject3$w, _templateObject4$r, _templateObject5$m, _templateObject6$k, _templateObject7$j;
|
|
36677
36869
|
var MessageBody = function MessageBody(_ref) {
|
|
36870
|
+
var _message$pollDetails, _message$pollDetails2;
|
|
36678
36871
|
var message = _ref.message,
|
|
36679
36872
|
channel = _ref.channel,
|
|
36680
36873
|
MessageActionsMenu = _ref.MessageActionsMenu,
|
|
@@ -37050,6 +37243,8 @@ var MessageBody = function MessageBody(_ref) {
|
|
|
37050
37243
|
handleEndVote: handleEndVote
|
|
37051
37244
|
})) : (/*#__PURE__*/React__default.createElement(MessageActions, {
|
|
37052
37245
|
isPollMessage: (message === null || message === void 0 ? void 0 : message.type) === exports.MESSAGE_TYPE.POLL,
|
|
37246
|
+
allowVoteRetract: message === null || message === void 0 ? void 0 : (_message$pollDetails = message.pollDetails) === null || _message$pollDetails === void 0 ? void 0 : _message$pollDetails.allowVoteRetract,
|
|
37247
|
+
pollClosed: message === null || message === void 0 ? void 0 : (_message$pollDetails2 = message.pollDetails) === null || _message$pollDetails2 === void 0 ? void 0 : _message$pollDetails2.closed,
|
|
37053
37248
|
messageFrom: message.user,
|
|
37054
37249
|
channel: channel,
|
|
37055
37250
|
editModeToggle: toggleEditMode,
|
|
@@ -39071,42 +39266,40 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39071
39266
|
var showScrollToNewMessageButton = useSelector(showScrollToNewMessageButtonSelector, reactRedux.shallowEqual);
|
|
39072
39267
|
var unreadScrollTo = useSelector(unreadScrollToSelector, reactRedux.shallowEqual);
|
|
39073
39268
|
var messages = useSelector(activeChannelMessagesSelector, reactRedux.shallowEqual) || [];
|
|
39074
|
-
var
|
|
39075
|
-
|
|
39076
|
-
|
|
39269
|
+
var unreadMessageId = useSelector(unreadMessageIdSelector, reactRedux.shallowEqual);
|
|
39270
|
+
var _useState2 = React.useState(null),
|
|
39271
|
+
mediaFile = _useState2[0],
|
|
39272
|
+
setMediaFile = _useState2[1];
|
|
39077
39273
|
var _useState3 = React.useState(null),
|
|
39078
|
-
|
|
39079
|
-
|
|
39274
|
+
isDragging = _useState3[0],
|
|
39275
|
+
setIsDragging = _useState3[1];
|
|
39080
39276
|
var _useState4 = React.useState(null),
|
|
39081
|
-
|
|
39082
|
-
|
|
39083
|
-
var _useState5 = React.useState(
|
|
39084
|
-
|
|
39085
|
-
|
|
39277
|
+
showTopDate = _useState4[0],
|
|
39278
|
+
setShowTopDate = _useState4[1];
|
|
39279
|
+
var _useState5 = React.useState(false),
|
|
39280
|
+
stopScrolling = _useState5[0],
|
|
39281
|
+
setStopScrolling = _useState5[1];
|
|
39086
39282
|
var _useState6 = React.useState(false),
|
|
39087
|
-
|
|
39088
|
-
|
|
39089
|
-
var _useState7 = React.useState(false),
|
|
39090
|
-
isScrolling = _useState7[0],
|
|
39091
|
-
setIsScrolling = _useState7[1];
|
|
39283
|
+
isScrolling = _useState6[0],
|
|
39284
|
+
setIsScrolling = _useState6[1];
|
|
39092
39285
|
var hideTopDateTimeout = React.useRef(null);
|
|
39093
|
-
var
|
|
39094
|
-
lastVisibleMessageId =
|
|
39095
|
-
_setLastVisibleMessageId =
|
|
39096
|
-
var
|
|
39097
|
-
scrollToReply =
|
|
39098
|
-
setScrollToReply =
|
|
39099
|
-
var
|
|
39100
|
-
previousScrollTop =
|
|
39101
|
-
setPreviousScrollTop =
|
|
39102
|
-
var
|
|
39103
|
-
shouldPreserveScroll =
|
|
39104
|
-
setShouldPreserveScroll =
|
|
39286
|
+
var _useState7 = React.useState(''),
|
|
39287
|
+
lastVisibleMessageId = _useState7[0],
|
|
39288
|
+
_setLastVisibleMessageId = _useState7[1];
|
|
39289
|
+
var _useState8 = React.useState(null),
|
|
39290
|
+
scrollToReply = _useState8[0],
|
|
39291
|
+
setScrollToReply = _useState8[1];
|
|
39292
|
+
var _useState9 = React.useState(0),
|
|
39293
|
+
previousScrollTop = _useState9[0],
|
|
39294
|
+
setPreviousScrollTop = _useState9[1];
|
|
39295
|
+
var _useState0 = React.useState(false),
|
|
39296
|
+
shouldPreserveScroll = _useState0[0],
|
|
39297
|
+
setShouldPreserveScroll = _useState0[1];
|
|
39105
39298
|
var messageForReply = {};
|
|
39106
39299
|
var attachmentsSelected = false;
|
|
39107
|
-
var
|
|
39108
|
-
topDateLabel =
|
|
39109
|
-
setTopDateLabel =
|
|
39300
|
+
var _useState1 = React.useState(''),
|
|
39301
|
+
topDateLabel = _useState1[0],
|
|
39302
|
+
setTopDateLabel = _useState1[1];
|
|
39110
39303
|
var scrollRef = React.useRef(null);
|
|
39111
39304
|
var loadFromServerRef = React.useRef(false);
|
|
39112
39305
|
var loadDirectionRef = React.useRef('');
|
|
@@ -39441,7 +39634,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39441
39634
|
var visibleMessagesIds = Object.keys(visibleMessages);
|
|
39442
39635
|
var messageId = visibleMessagesIds[visibleMessagesIds.length - 1];
|
|
39443
39636
|
dispatch(getMessagesAC(channel, undefined, messageId, undefined, undefined, 'instant'));
|
|
39444
|
-
|
|
39637
|
+
dispatch(setUnreadMessageIdAC(messageId));
|
|
39445
39638
|
} else {
|
|
39446
39639
|
if (!channel.isLinkedChannel) {
|
|
39447
39640
|
clearVisibleMessagesMap();
|
|
@@ -39451,9 +39644,9 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39451
39644
|
}
|
|
39452
39645
|
if (channel.id) {
|
|
39453
39646
|
if (channel.newMessageCount && channel.newMessageCount > 0) {
|
|
39454
|
-
|
|
39647
|
+
dispatch(setUnreadMessageIdAC(channel.lastDisplayedMessageId));
|
|
39455
39648
|
} else {
|
|
39456
|
-
|
|
39649
|
+
dispatch(setUnreadMessageIdAC(''));
|
|
39457
39650
|
}
|
|
39458
39651
|
}
|
|
39459
39652
|
}
|
|
@@ -39477,7 +39670,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39477
39670
|
if (messages.length > 0 && hiddenMessagesProperties !== null && hiddenMessagesProperties !== void 0 && hiddenMessagesProperties.includes(HiddenMessageProperty.hideAfterSendMessage)) {
|
|
39478
39671
|
var lastMessage = messages[messages.length - 1];
|
|
39479
39672
|
if (lastMessage.user.id === user.id) {
|
|
39480
|
-
|
|
39673
|
+
dispatch(setUnreadMessageIdAC(''));
|
|
39481
39674
|
}
|
|
39482
39675
|
}
|
|
39483
39676
|
}, [messages, hiddenMessagesProperties, user === null || user === void 0 ? void 0 : user.id]);
|
|
@@ -39598,12 +39791,14 @@ var MessageList = function MessageList(_ref2) {
|
|
|
39598
39791
|
React.useEffect(function () {
|
|
39599
39792
|
log.info('connection status is changed.. .... ', connectionStatus, 'channel ... ', channel);
|
|
39600
39793
|
if (connectionStatus === CONNECTION_STATUS.CONNECTED && channel !== null && channel !== void 0 && channel.id) {
|
|
39794
|
+
var _channel$lastMessage4;
|
|
39601
39795
|
loadingRef.current = false;
|
|
39602
39796
|
prevDisableRef.current = false;
|
|
39603
39797
|
nextDisableRef.current = false;
|
|
39604
39798
|
clearMessagesMap();
|
|
39605
39799
|
removeAllMessages();
|
|
39606
|
-
|
|
39800
|
+
var isWithLastVisibleMessageId = lastVisibleMessageId !== ((_channel$lastMessage4 = channel.lastMessage) === null || _channel$lastMessage4 === void 0 ? void 0 : _channel$lastMessage4.id) && lastVisibleMessageId ? lastVisibleMessageId : '';
|
|
39801
|
+
dispatch(getMessagesAC(channel, false, isWithLastVisibleMessageId, 0, false, 'instant', false, true));
|
|
39607
39802
|
}
|
|
39608
39803
|
}, [connectionStatus]);
|
|
39609
39804
|
React.useEffect(function () {
|
|
@@ -41417,9 +41612,9 @@ function useFormatMessage(editor, editorState, setMessageBodyAttributes, setMess
|
|
|
41417
41612
|
if (getFromContacts === void 0) {
|
|
41418
41613
|
getFromContacts = false;
|
|
41419
41614
|
}
|
|
41420
|
-
|
|
41615
|
+
var processMentionsInPastedText = React.useCallback(function (pastedText, activeChannelMembers, contactsMap, getFromContacts, setMentionedMember, selection) {
|
|
41421
41616
|
if (!pastedText) return;
|
|
41422
|
-
var contacts =
|
|
41617
|
+
var contacts = [].concat(activeChannelMembers);
|
|
41423
41618
|
var mentionPatterns = [];
|
|
41424
41619
|
contacts.forEach(function (contactOrMember) {
|
|
41425
41620
|
var contactFromMap = contactsMap[contactOrMember.id];
|
|
@@ -41506,7 +41701,7 @@ function useFormatMessage(editor, editorState, setMessageBodyAttributes, setMess
|
|
|
41506
41701
|
} else if (nodes.length > 0) {
|
|
41507
41702
|
selection.insertNodes(nodes);
|
|
41508
41703
|
}
|
|
41509
|
-
}
|
|
41704
|
+
}, [activeChannelMembers, contactsMap, getFromContacts, setMentionedMember]);
|
|
41510
41705
|
var handlePast = React.useCallback(function (e) {
|
|
41511
41706
|
if (!('clipboardData' in e) || !e.clipboardData) {
|
|
41512
41707
|
return false;
|
|
@@ -41521,7 +41716,7 @@ function useFormatMessage(editor, editorState, setMessageBodyAttributes, setMess
|
|
|
41521
41716
|
});
|
|
41522
41717
|
}
|
|
41523
41718
|
return true;
|
|
41524
|
-
}, [editor, contactsMap, setMentionedMember, getFromContacts, activeChannelMembers]);
|
|
41719
|
+
}, [editor, contactsMap, setMentionedMember, getFromContacts, activeChannelMembers, processMentionsInPastedText]);
|
|
41525
41720
|
var onDelete = React.useCallback(function (event) {
|
|
41526
41721
|
event.preventDefault();
|
|
41527
41722
|
editor.update(function () {
|
|
@@ -41547,7 +41742,7 @@ function useFormatMessage(editor, editorState, setMessageBodyAttributes, setMess
|
|
|
41547
41742
|
handlePast(e);
|
|
41548
41743
|
return true;
|
|
41549
41744
|
}, lexical.COMMAND_PRIORITY_NORMAL), editor.registerCommand(lexical.KEY_DELETE_COMMAND, onDelete, lexical.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical.KEY_BACKSPACE_COMMAND, onDelete, lexical.COMMAND_PRIORITY_LOW));
|
|
41550
|
-
}, []);
|
|
41745
|
+
}, [editor, handlePast, onDelete]);
|
|
41551
41746
|
useDidUpdate(function () {
|
|
41552
41747
|
if (editorState) {
|
|
41553
41748
|
editorState.read(function () {
|
|
@@ -45697,7 +45892,8 @@ var GroupsInCommonPopup = function GroupsInCommonPopup(_ref2) {
|
|
|
45697
45892
|
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
|
|
45698
45893
|
background = _useColor[THEME_COLORS.BACKGROUND],
|
|
45699
45894
|
iconPrimary = _useColor[THEME_COLORS.ICON_PRIMARY],
|
|
45700
|
-
backgroundHovered = _useColor[THEME_COLORS.BACKGROUND_HOVERED]
|
|
45895
|
+
backgroundHovered = _useColor[THEME_COLORS.BACKGROUND_HOVERED],
|
|
45896
|
+
surface2 = _useColor[THEME_COLORS.SURFACE_2];
|
|
45701
45897
|
var contactsMap = useSelector(contactsMapSelector);
|
|
45702
45898
|
var getFromContacts = getShowOnlyContactUsers();
|
|
45703
45899
|
var dispatch = useDispatch();
|
|
@@ -45762,7 +45958,7 @@ var GroupsInCommonPopup = function GroupsInCommonPopup(_ref2) {
|
|
|
45762
45958
|
onMouseLeave: function onMouseLeave() {
|
|
45763
45959
|
return setIsScrolling(false);
|
|
45764
45960
|
},
|
|
45765
|
-
thumbColor:
|
|
45961
|
+
thumbColor: surface2
|
|
45766
45962
|
}, isLoadingInitial ? (/*#__PURE__*/React__default.createElement(LoadingText$1, {
|
|
45767
45963
|
color: textSecondary
|
|
45768
45964
|
}, "Loading...")) : mutualChannels.length > 0 ? mutualChannels.map(function (channel) {
|
|
@@ -45785,7 +45981,7 @@ var GroupsInCommonPopup = function GroupsInCommonPopup(_ref2) {
|
|
|
45785
45981
|
color: textSecondary
|
|
45786
45982
|
}, "Loading more...")))));
|
|
45787
45983
|
};
|
|
45788
|
-
var ChannelsList$1 = styled__default.div(_templateObject$U || (_templateObject$U = _taggedTemplateLiteralLoose(["\n max-height: 400px;\n overflow-y: auto;\n overflow-x: hidden;\n\n &::-webkit-scrollbar {\n width:
|
|
45984
|
+
var ChannelsList$1 = styled__default.div(_templateObject$U || (_templateObject$U = _taggedTemplateLiteralLoose(["\n max-height: 400px;\n overflow-y: auto;\n overflow-x: hidden;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
|
|
45789
45985
|
return props.thumbColor;
|
|
45790
45986
|
});
|
|
45791
45987
|
var ChannelItem$1 = styled__default.div(_templateObject2$P || (_templateObject2$P = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n padding: 6px 2px 6px 6px;\n border-radius: 8px;\n cursor: pointer;\n transition: background-color 0.2s;\n\n &:hover {\n background-color: ", ";\n }\n"])), function (props) {
|
|
@@ -48775,6 +48971,12 @@ var Details = function Details(_ref) {
|
|
|
48775
48971
|
return Promise.reject(e);
|
|
48776
48972
|
}
|
|
48777
48973
|
};
|
|
48974
|
+
var channelMetadata = React.useMemo(function () {
|
|
48975
|
+
if (isJSON(activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.metadata)) {
|
|
48976
|
+
return JSON.parse(activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.metadata);
|
|
48977
|
+
}
|
|
48978
|
+
return activeChannel === null || activeChannel === void 0 ? void 0 : activeChannel.metadata;
|
|
48979
|
+
}, [activeChannel]);
|
|
48778
48980
|
return /*#__PURE__*/React__default.createElement(Container$v, {
|
|
48779
48981
|
backgroundColor: backgroundColor,
|
|
48780
48982
|
mounted: mounted,
|
|
@@ -48860,11 +49062,11 @@ var Details = function Details(_ref) {
|
|
|
48860
49062
|
color: textSecondary,
|
|
48861
49063
|
fontSize: channelMembersFontSize,
|
|
48862
49064
|
lineHeight: channelMembersLineHeight
|
|
48863
|
-
}, activeChannel && activeChannel.memberCount, " ", displayMemberText)))), showAboutChannel && activeChannel &&
|
|
49065
|
+
}, activeChannel && activeChannel.memberCount, " ", displayMemberText)))), showAboutChannel && activeChannel && channelMetadata && (channelMetadata === null || channelMetadata === void 0 ? void 0 : channelMetadata.d) && (/*#__PURE__*/React__default.createElement(AboutChannel, null, showAboutChannelTitle && /*#__PURE__*/React__default.createElement(AboutChannelTitle, {
|
|
48864
49066
|
color: textFootnote
|
|
48865
49067
|
}, "About"), /*#__PURE__*/React__default.createElement(AboutChannelText, {
|
|
48866
49068
|
color: textPrimary
|
|
48867
|
-
},
|
|
49069
|
+
}, channelMetadata !== null && channelMetadata !== void 0 && channelMetadata.d ? channelMetadata === null || channelMetadata === void 0 ? void 0 : channelMetadata.d : '')))), activeChannel && activeChannel.userRole && (/*#__PURE__*/React__default.createElement(Actions, {
|
|
48868
49070
|
setActionsHeight: setActionsHeight,
|
|
48869
49071
|
theme: theme,
|
|
48870
49072
|
showMuteUnmuteNotifications: showMuteUnmuteNotifications,
|