sceyt-chat-react-uikit 1.6.9-beta.16 → 1.6.9-beta.18
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/ChannelList/index.d.ts +1 -0
- package/index.js +276 -185
- package/index.modern.js +276 -185
- package/package.json +1 -1
package/index.modern.js
CHANGED
|
@@ -10054,18 +10054,29 @@ function updateMessageOnMap(channelId, updatedMessage) {
|
|
|
10054
10054
|
}
|
|
10055
10055
|
}
|
|
10056
10056
|
}
|
|
10057
|
+
var updatedMessageData = null;
|
|
10057
10058
|
if (messagesMap[channelId]) {
|
|
10058
|
-
messagesMap[channelId]
|
|
10059
|
+
messagesMap[channelId].map(function (mes) {
|
|
10059
10060
|
if (mes.tid === updatedMessage.messageId || mes.id === updatedMessage.messageId) {
|
|
10060
10061
|
if (updatedMessage.params.state === MESSAGE_STATUS.DELETE) {
|
|
10061
|
-
|
|
10062
|
+
updatedMessageData = _extends({}, updatedMessage.params);
|
|
10063
|
+
return updatedMessageData;
|
|
10062
10064
|
} else {
|
|
10063
|
-
|
|
10065
|
+
var _updatedMessage$param;
|
|
10066
|
+
updatedMessageData = _extends({}, mes, updatedMessage.params, {
|
|
10067
|
+
attachments: [].concat(mes.attachments, ((_updatedMessage$param = updatedMessage.params) === null || _updatedMessage$param === void 0 ? void 0 : _updatedMessage$param.attachments) || []).filter(function (att, index, self) {
|
|
10068
|
+
return index === self.findIndex(function (t) {
|
|
10069
|
+
return t.url === att.url && t.type === att.type && t.name === att.name;
|
|
10070
|
+
});
|
|
10071
|
+
})
|
|
10072
|
+
});
|
|
10073
|
+
return updatedMessage;
|
|
10064
10074
|
}
|
|
10065
10075
|
}
|
|
10066
10076
|
return mes;
|
|
10067
10077
|
});
|
|
10068
10078
|
}
|
|
10079
|
+
return updatedMessageData;
|
|
10069
10080
|
}
|
|
10070
10081
|
function addReactionToMessageOnMap(channelId, message, reaction, isSelf) {
|
|
10071
10082
|
if (messagesMap[channelId]) {
|
|
@@ -10309,7 +10320,6 @@ var messageSlice = createSlice({
|
|
|
10309
10320
|
reducers: {
|
|
10310
10321
|
addMessage: function addMessage(state, action) {
|
|
10311
10322
|
var message = action.payload.message;
|
|
10312
|
-
log.info('addMessage ... ', message);
|
|
10313
10323
|
state.activeChannelMessages.push(message);
|
|
10314
10324
|
},
|
|
10315
10325
|
deleteMessageFromList: function deleteMessageFromList(state, action) {
|
|
@@ -10427,11 +10437,48 @@ var messageSlice = createSlice({
|
|
|
10427
10437
|
state.activeChannelMessages.push(params);
|
|
10428
10438
|
}
|
|
10429
10439
|
},
|
|
10430
|
-
|
|
10440
|
+
updateMessageAttachment: function updateMessageAttachment(state, action) {
|
|
10431
10441
|
var _action$payload4 = action.payload,
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10442
|
+
url = _action$payload4.url,
|
|
10443
|
+
messageId = _action$payload4.messageId,
|
|
10444
|
+
params = _action$payload4.params;
|
|
10445
|
+
state.activeChannelMessages = state.activeChannelMessages.map(function (message) {
|
|
10446
|
+
if (message.id === messageId) {
|
|
10447
|
+
for (var index = 0; index < message.attachments.length; index++) {
|
|
10448
|
+
var attachment = message.attachments[index];
|
|
10449
|
+
if (attachment.url === url) {
|
|
10450
|
+
message.attachments[index] = _extends({}, attachment, params);
|
|
10451
|
+
}
|
|
10452
|
+
}
|
|
10453
|
+
}
|
|
10454
|
+
if (message.attachments.length) {
|
|
10455
|
+
var detachedAttachments = message.attachments.map(function (att) {
|
|
10456
|
+
var _att$user, _att$user2;
|
|
10457
|
+
return _extends({}, att, {
|
|
10458
|
+
user: _extends({}, att.user, {
|
|
10459
|
+
metadata: _extends({}, ((_att$user = att.user) === null || _att$user === void 0 ? void 0 : _att$user.metadata) || {}),
|
|
10460
|
+
presence: _extends({}, ((_att$user2 = att.user) === null || _att$user2 === void 0 ? void 0 : _att$user2.presence) || {})
|
|
10461
|
+
})
|
|
10462
|
+
});
|
|
10463
|
+
});
|
|
10464
|
+
updateMessageOnAllMessages(messageId, {
|
|
10465
|
+
attachments: detachedAttachments
|
|
10466
|
+
});
|
|
10467
|
+
updateMessageOnMap(message.channelId, {
|
|
10468
|
+
messageId: messageId,
|
|
10469
|
+
params: {
|
|
10470
|
+
attachments: detachedAttachments
|
|
10471
|
+
}
|
|
10472
|
+
});
|
|
10473
|
+
}
|
|
10474
|
+
return message;
|
|
10475
|
+
});
|
|
10476
|
+
},
|
|
10477
|
+
addReactionToMessage: function addReactionToMessage(state, action) {
|
|
10478
|
+
var _action$payload5 = action.payload,
|
|
10479
|
+
message = _action$payload5.message,
|
|
10480
|
+
reaction = _action$payload5.reaction,
|
|
10481
|
+
isSelf = _action$payload5.isSelf;
|
|
10435
10482
|
state.activeChannelMessages = state.activeChannelMessages.map(function (msg) {
|
|
10436
10483
|
if (msg.id === message.id) {
|
|
10437
10484
|
var slfReactions = [].concat(msg.userReactions);
|
|
@@ -10451,10 +10498,10 @@ var messageSlice = createSlice({
|
|
|
10451
10498
|
});
|
|
10452
10499
|
},
|
|
10453
10500
|
deleteReactionFromMessage: function deleteReactionFromMessage(state, action) {
|
|
10454
|
-
var _action$
|
|
10455
|
-
reaction = _action$
|
|
10456
|
-
message = _action$
|
|
10457
|
-
isSelf = _action$
|
|
10501
|
+
var _action$payload6 = action.payload,
|
|
10502
|
+
reaction = _action$payload6.reaction,
|
|
10503
|
+
message = _action$payload6.message,
|
|
10504
|
+
isSelf = _action$payload6.isSelf;
|
|
10458
10505
|
state.activeChannelMessages = state.activeChannelMessages.map(function (msg) {
|
|
10459
10506
|
if (msg.id === message.id) {
|
|
10460
10507
|
var userReactions = msg.userReactions;
|
|
@@ -10503,9 +10550,9 @@ var messageSlice = createSlice({
|
|
|
10503
10550
|
(_state$activeTabAttac = state.activeTabAttachments).push.apply(_state$activeTabAttac, action.payload.attachments);
|
|
10504
10551
|
},
|
|
10505
10552
|
addAttachmentsForPopup: function addAttachmentsForPopup(state, action) {
|
|
10506
|
-
var _action$
|
|
10507
|
-
attachments = _action$
|
|
10508
|
-
direction = _action$
|
|
10553
|
+
var _action$payload7 = action.payload,
|
|
10554
|
+
attachments = _action$payload7.attachments,
|
|
10555
|
+
direction = _action$payload7.direction;
|
|
10509
10556
|
if (direction === 'prev') {
|
|
10510
10557
|
var _state$attachmentsFor;
|
|
10511
10558
|
(_state$attachmentsFor = state.attachmentsForPopup).push.apply(_state$attachmentsFor, attachments);
|
|
@@ -10521,11 +10568,11 @@ var messageSlice = createSlice({
|
|
|
10521
10568
|
state.attachmentForPopupHasNext = action.payload.hasPrev;
|
|
10522
10569
|
},
|
|
10523
10570
|
updateUploadProgress: function updateUploadProgress(state, action) {
|
|
10524
|
-
var _action$
|
|
10525
|
-
uploaded = _action$
|
|
10526
|
-
total = _action$
|
|
10527
|
-
attachmentId = _action$
|
|
10528
|
-
progress = _action$
|
|
10571
|
+
var _action$payload8 = action.payload,
|
|
10572
|
+
uploaded = _action$payload8.uploaded,
|
|
10573
|
+
total = _action$payload8.total,
|
|
10574
|
+
attachmentId = _action$payload8.attachmentId,
|
|
10575
|
+
progress = _action$payload8.progress;
|
|
10529
10576
|
var updateData = {
|
|
10530
10577
|
uploaded: uploaded,
|
|
10531
10578
|
total: total,
|
|
@@ -10549,23 +10596,23 @@ var messageSlice = createSlice({
|
|
|
10549
10596
|
state.messageForReply = action.payload.message;
|
|
10550
10597
|
},
|
|
10551
10598
|
uploadAttachmentCompilation: function uploadAttachmentCompilation(state, action) {
|
|
10552
|
-
var _action$
|
|
10553
|
-
attachmentUploadingState = _action$
|
|
10554
|
-
attachmentId = _action$
|
|
10599
|
+
var _action$payload9 = action.payload,
|
|
10600
|
+
attachmentUploadingState = _action$payload9.attachmentUploadingState,
|
|
10601
|
+
attachmentId = _action$payload9.attachmentId;
|
|
10555
10602
|
state.attachmentsUploadingState[attachmentId] = attachmentUploadingState;
|
|
10556
10603
|
},
|
|
10557
10604
|
setReactionsList: function setReactionsList(state, action) {
|
|
10558
|
-
var _action$
|
|
10559
|
-
reactions = _action$
|
|
10560
|
-
hasNext = _action$
|
|
10605
|
+
var _action$payload0 = action.payload,
|
|
10606
|
+
reactions = _action$payload0.reactions,
|
|
10607
|
+
hasNext = _action$payload0.hasNext;
|
|
10561
10608
|
state.reactionsHasNext = hasNext;
|
|
10562
10609
|
state.reactionsList = [].concat(reactions);
|
|
10563
10610
|
},
|
|
10564
10611
|
addReactionsToList: function addReactionsToList(state, action) {
|
|
10565
10612
|
var _state$reactionsList;
|
|
10566
|
-
var _action$
|
|
10567
|
-
reactions = _action$
|
|
10568
|
-
hasNext = _action$
|
|
10613
|
+
var _action$payload1 = action.payload,
|
|
10614
|
+
reactions = _action$payload1.reactions,
|
|
10615
|
+
hasNext = _action$payload1.hasNext;
|
|
10569
10616
|
state.reactionsHasNext = hasNext;
|
|
10570
10617
|
(_state$reactionsList = state.reactionsList).push.apply(_state$reactionsList, reactions);
|
|
10571
10618
|
},
|
|
@@ -10626,6 +10673,7 @@ var _messageSlice$actions = messageSlice.actions,
|
|
|
10626
10673
|
addMessages = _messageSlice$actions.addMessages,
|
|
10627
10674
|
updateMessagesStatus = _messageSlice$actions.updateMessagesStatus,
|
|
10628
10675
|
updateMessage = _messageSlice$actions.updateMessage,
|
|
10676
|
+
updateMessageAttachment = _messageSlice$actions.updateMessageAttachment,
|
|
10629
10677
|
addReactionToMessage = _messageSlice$actions.addReactionToMessage,
|
|
10630
10678
|
deleteReactionFromMessage = _messageSlice$actions.deleteReactionFromMessage,
|
|
10631
10679
|
setHasPrevMessages = _messageSlice$actions.setHasPrevMessages,
|
|
@@ -11717,6 +11765,13 @@ function setMessagesHasNextAC(hasNext) {
|
|
|
11717
11765
|
hasNext: hasNext
|
|
11718
11766
|
});
|
|
11719
11767
|
}
|
|
11768
|
+
function setUpdateMessageAttachmentAC(url, messageId, params) {
|
|
11769
|
+
return updateMessageAttachment({
|
|
11770
|
+
url: url,
|
|
11771
|
+
messageId: messageId,
|
|
11772
|
+
params: params
|
|
11773
|
+
});
|
|
11774
|
+
}
|
|
11720
11775
|
function updateMessageAC(messageId, params, addIfNotExists) {
|
|
11721
11776
|
return updateMessage({
|
|
11722
11777
|
messageId: messageId,
|
|
@@ -17132,12 +17187,6 @@ var addPendingMessage = function addPendingMessage(message, messageCopy, channel
|
|
|
17132
17187
|
addMessageToMap(channel.id, messageToAdd);
|
|
17133
17188
|
addAllMessages([messageToAdd], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
17134
17189
|
setPendingMessages(channel.id, [messageToAdd]);
|
|
17135
|
-
var hasNextMessages = store.getState().MessageReducer.messagesHasNext;
|
|
17136
|
-
var activeChannelMessages = store.getState().MessageReducer.activeChannelMessages;
|
|
17137
|
-
var isLatestMessageInChannelMessages = activeChannelMessages[activeChannelMessages.length - 1].id === channel.lastMessage.id;
|
|
17138
|
-
if (hasNextMessages || !isLatestMessageInChannelMessages) {
|
|
17139
|
-
store.dispatch(getMessagesAC(channel, true, channel.lastMessage.id, undefined, undefined, false));
|
|
17140
|
-
}
|
|
17141
17190
|
store.dispatch(scrollToNewMessageAC(true));
|
|
17142
17191
|
store.dispatch(addMessageAC(messageToAdd));
|
|
17143
17192
|
return Promise.resolve();
|
|
@@ -18311,27 +18360,26 @@ function editMessage(action) {
|
|
|
18311
18360
|
}, _marked6$1, null, [[0, 5]]);
|
|
18312
18361
|
}
|
|
18313
18362
|
function getMessagesQuery(action) {
|
|
18314
|
-
var _action$payload, channel, loadWithLastMessage, messageId, limit, withDeliveredMessages, highlight, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, allMessages, havLastMessage, secondResult, sentMessages, messagesMap, filteredSentMessages, _allMessages, messageIndex, maxLengthPart, _secondResult, thirdResult, _secondResult2, _thirdResult, _secondResult3, _secondResult4, pendingMessages, _messagesMap, filteredPendingMessages, index, mes, _t9;
|
|
18363
|
+
var _action$payload, channel, loadWithLastMessage, messageId, limit, withDeliveredMessages, highlight, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, allMessages, havLastMessage, secondResult, sentMessages, messagesMap, filteredSentMessages, _allMessages, messageIndex, maxLengthPart, _secondResult, thirdResult, _secondResult2, _thirdResult, _secondResult3, _secondResult4, updatedMessages, pendingMessages, _messagesMap, filteredPendingMessages, index, mes, _t9;
|
|
18315
18364
|
return _regenerator().w(function (_context9) {
|
|
18316
18365
|
while (1) switch (_context9.p = _context9.n) {
|
|
18317
18366
|
case 0:
|
|
18318
|
-
|
|
18319
|
-
_context9.
|
|
18320
|
-
_context9.n = 2;
|
|
18367
|
+
_context9.p = 0;
|
|
18368
|
+
_context9.n = 1;
|
|
18321
18369
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
18322
|
-
case
|
|
18370
|
+
case 1:
|
|
18323
18371
|
_action$payload = action.payload, channel = _action$payload.channel, loadWithLastMessage = _action$payload.loadWithLastMessage, messageId = _action$payload.messageId, limit = _action$payload.limit, withDeliveredMessages = _action$payload.withDeliveredMessages, highlight = _action$payload.highlight;
|
|
18324
18372
|
if (!(channel.id && !channel.isMockChannel)) {
|
|
18325
|
-
_context9.n =
|
|
18373
|
+
_context9.n = 48;
|
|
18326
18374
|
break;
|
|
18327
18375
|
}
|
|
18328
18376
|
SceytChatClient = getClient();
|
|
18329
18377
|
messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channel.id);
|
|
18330
18378
|
messageQueryBuilder.limit(limit || MESSAGES_MAX_LENGTH);
|
|
18331
18379
|
messageQueryBuilder.reverse(true);
|
|
18332
|
-
_context9.n =
|
|
18380
|
+
_context9.n = 2;
|
|
18333
18381
|
return call(messageQueryBuilder.build);
|
|
18334
|
-
case
|
|
18382
|
+
case 2:
|
|
18335
18383
|
messageQuery = _context9.v;
|
|
18336
18384
|
query.messageQuery = messageQuery;
|
|
18337
18385
|
cachedMessages = getMessagesFromMap(channel.id);
|
|
@@ -18340,33 +18388,33 @@ function getMessagesQuery(action) {
|
|
|
18340
18388
|
hasNext: false
|
|
18341
18389
|
};
|
|
18342
18390
|
if (!loadWithLastMessage) {
|
|
18343
|
-
_context9.n =
|
|
18391
|
+
_context9.n = 13;
|
|
18344
18392
|
break;
|
|
18345
18393
|
}
|
|
18346
18394
|
allMessages = getAllMessages();
|
|
18347
18395
|
havLastMessage = allMessages && allMessages.length && channel.lastMessage && allMessages[allMessages.length - 1] && allMessages[allMessages.length - 1].id === channel.lastMessage.id;
|
|
18348
18396
|
if (!(channel.newMessageCount && channel.newMessageCount > 0 || !havLastMessage)) {
|
|
18349
|
-
_context9.n =
|
|
18397
|
+
_context9.n = 8;
|
|
18350
18398
|
break;
|
|
18351
18399
|
}
|
|
18352
18400
|
setHasPrevCached(false);
|
|
18353
18401
|
setAllMessages([]);
|
|
18354
|
-
_context9.n =
|
|
18402
|
+
_context9.n = 3;
|
|
18355
18403
|
return call(messageQuery.loadPreviousMessageId, '0');
|
|
18356
|
-
case
|
|
18404
|
+
case 3:
|
|
18357
18405
|
result = _context9.v;
|
|
18358
18406
|
if (!(result.messages.length === 50)) {
|
|
18359
|
-
_context9.n =
|
|
18407
|
+
_context9.n = 5;
|
|
18360
18408
|
break;
|
|
18361
18409
|
}
|
|
18362
18410
|
messageQuery.limit = 30;
|
|
18363
|
-
_context9.n =
|
|
18411
|
+
_context9.n = 4;
|
|
18364
18412
|
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
18365
|
-
case
|
|
18413
|
+
case 4:
|
|
18366
18414
|
secondResult = _context9.v;
|
|
18367
18415
|
result.messages = [].concat(secondResult.messages, result.messages);
|
|
18368
18416
|
result.hasNext = secondResult.hasNext;
|
|
18369
|
-
case
|
|
18417
|
+
case 5:
|
|
18370
18418
|
sentMessages = [];
|
|
18371
18419
|
if (withDeliveredMessages) {
|
|
18372
18420
|
sentMessages = getFromAllMessagesByMessageId('', '', true);
|
|
@@ -18379,43 +18427,40 @@ function getMessagesQuery(action) {
|
|
|
18379
18427
|
return !messagesMap[msg.tid || ''];
|
|
18380
18428
|
});
|
|
18381
18429
|
result.messages = [].concat(result.messages, filteredSentMessages).slice(filteredSentMessages.length);
|
|
18382
|
-
_context9.n =
|
|
18430
|
+
_context9.n = 6;
|
|
18383
18431
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
18384
|
-
case
|
|
18432
|
+
case 6:
|
|
18385
18433
|
setMessagesToMap(channel.id, result.messages);
|
|
18386
18434
|
setAllMessages(result.messages);
|
|
18387
|
-
_context9.n =
|
|
18435
|
+
_context9.n = 7;
|
|
18388
18436
|
return put(setMessagesHasPrevAC(true));
|
|
18437
|
+
case 7:
|
|
18438
|
+
_context9.n = 10;
|
|
18439
|
+
break;
|
|
18389
18440
|
case 8:
|
|
18441
|
+
result.messages = getFromAllMessagesByMessageId('', '', true);
|
|
18390
18442
|
_context9.n = 9;
|
|
18391
|
-
return put(
|
|
18443
|
+
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
18392
18444
|
case 9:
|
|
18393
|
-
_context9.n =
|
|
18394
|
-
|
|
18445
|
+
_context9.n = 10;
|
|
18446
|
+
return put(setMessagesHasPrevAC(true));
|
|
18395
18447
|
case 10:
|
|
18396
|
-
result.messages = getFromAllMessagesByMessageId('', '', true);
|
|
18397
18448
|
_context9.n = 11;
|
|
18398
|
-
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
18399
|
-
case 11:
|
|
18400
|
-
_context9.n = 12;
|
|
18401
|
-
return put(setMessagesHasPrevAC(true));
|
|
18402
|
-
case 12:
|
|
18403
|
-
_context9.n = 13;
|
|
18404
18449
|
return put(setMessagesHasNextAC(false));
|
|
18405
|
-
case
|
|
18450
|
+
case 11:
|
|
18406
18451
|
setHasNextCached(false);
|
|
18407
18452
|
if (!messageId) {
|
|
18408
|
-
_context9.n =
|
|
18453
|
+
_context9.n = 12;
|
|
18409
18454
|
break;
|
|
18410
18455
|
}
|
|
18411
|
-
_context9.n =
|
|
18456
|
+
_context9.n = 12;
|
|
18412
18457
|
return put(setScrollToMessagesAC(messageId, highlight));
|
|
18413
|
-
case
|
|
18414
|
-
_context9.n =
|
|
18458
|
+
case 12:
|
|
18459
|
+
_context9.n = 45;
|
|
18415
18460
|
break;
|
|
18416
|
-
case
|
|
18461
|
+
case 13:
|
|
18417
18462
|
if (!messageId) {
|
|
18418
|
-
_context9.n =
|
|
18463
|
+
_context9.n = 25;
|
|
18419
18464
|
break;
|
|
18420
18465
|
}
|
|
18421
18466
|
_allMessages = getAllMessages();
|
|
@@ -18424,176 +18469,183 @@ function getMessagesQuery(action) {
|
|
|
18424
18469
|
});
|
|
18425
18470
|
maxLengthPart = MESSAGES_MAX_LENGTH / 2;
|
|
18426
18471
|
if (!(messageIndex >= maxLengthPart)) {
|
|
18427
|
-
_context9.n =
|
|
18472
|
+
_context9.n = 15;
|
|
18428
18473
|
break;
|
|
18429
18474
|
}
|
|
18430
18475
|
result.messages = _allMessages.slice(messageIndex - maxLengthPart, messageIndex + maxLengthPart);
|
|
18431
|
-
_context9.n =
|
|
18476
|
+
_context9.n = 14;
|
|
18432
18477
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
18433
|
-
case
|
|
18478
|
+
case 14:
|
|
18434
18479
|
setHasPrevCached(messageIndex > maxLengthPart);
|
|
18435
18480
|
setHasNextCached(_allMessages.length > maxLengthPart);
|
|
18436
|
-
_context9.n =
|
|
18481
|
+
_context9.n = 22;
|
|
18437
18482
|
break;
|
|
18438
|
-
case
|
|
18483
|
+
case 15:
|
|
18439
18484
|
messageQuery.limit = MESSAGES_MAX_LENGTH;
|
|
18440
18485
|
log.info('load by message id from server ...............', messageId);
|
|
18441
|
-
_context9.n =
|
|
18486
|
+
_context9.n = 16;
|
|
18442
18487
|
return call(messageQuery.loadNearMessageId, messageId);
|
|
18443
|
-
case
|
|
18488
|
+
case 16:
|
|
18444
18489
|
result = _context9.v;
|
|
18445
18490
|
if (!(result.messages.length === 50)) {
|
|
18446
|
-
_context9.n =
|
|
18491
|
+
_context9.n = 19;
|
|
18447
18492
|
break;
|
|
18448
18493
|
}
|
|
18449
18494
|
messageQuery.limit = (MESSAGES_MAX_LENGTH - 50) / 2;
|
|
18450
|
-
_context9.n =
|
|
18495
|
+
_context9.n = 17;
|
|
18451
18496
|
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
18452
|
-
case
|
|
18497
|
+
case 17:
|
|
18453
18498
|
_secondResult = _context9.v;
|
|
18454
18499
|
messageQuery.reverse = false;
|
|
18455
|
-
_context9.n =
|
|
18500
|
+
_context9.n = 18;
|
|
18456
18501
|
return call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
|
|
18457
|
-
case
|
|
18502
|
+
case 18:
|
|
18458
18503
|
thirdResult = _context9.v;
|
|
18459
18504
|
result.messages = [].concat(_secondResult.messages, result.messages, thirdResult.messages);
|
|
18460
18505
|
result.hasNext = _secondResult.hasNext;
|
|
18461
18506
|
messageQuery.reverse = true;
|
|
18462
|
-
case
|
|
18507
|
+
case 19:
|
|
18463
18508
|
log.info('result from server ....... ', result);
|
|
18464
|
-
_context9.n =
|
|
18509
|
+
_context9.n = 20;
|
|
18465
18510
|
return put(setMessagesHasNextAC(true));
|
|
18466
|
-
case
|
|
18467
|
-
_context9.n =
|
|
18511
|
+
case 20:
|
|
18512
|
+
_context9.n = 21;
|
|
18468
18513
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
18469
|
-
case
|
|
18514
|
+
case 21:
|
|
18470
18515
|
setAllMessages([].concat(result.messages));
|
|
18471
18516
|
setHasPrevCached(false);
|
|
18472
18517
|
setHasNextCached(false);
|
|
18473
|
-
case
|
|
18474
|
-
_context9.n =
|
|
18518
|
+
case 22:
|
|
18519
|
+
_context9.n = 23;
|
|
18475
18520
|
return put(setScrollToMessagesAC(messageId));
|
|
18476
|
-
case
|
|
18477
|
-
_context9.n =
|
|
18521
|
+
case 23:
|
|
18522
|
+
_context9.n = 24;
|
|
18478
18523
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
18479
|
-
case
|
|
18480
|
-
_context9.n =
|
|
18524
|
+
case 24:
|
|
18525
|
+
_context9.n = 45;
|
|
18481
18526
|
break;
|
|
18482
|
-
case
|
|
18527
|
+
case 25:
|
|
18483
18528
|
if (!(channel.newMessageCount && channel.lastDisplayedMessageId)) {
|
|
18484
|
-
_context9.n =
|
|
18529
|
+
_context9.n = 38;
|
|
18485
18530
|
break;
|
|
18486
18531
|
}
|
|
18487
18532
|
setAllMessages([]);
|
|
18488
18533
|
messageQuery.limit = MESSAGES_MAX_LENGTH;
|
|
18489
18534
|
if (!Number(channel.lastDisplayedMessageId)) {
|
|
18490
|
-
_context9.n =
|
|
18535
|
+
_context9.n = 31;
|
|
18491
18536
|
break;
|
|
18492
18537
|
}
|
|
18493
|
-
_context9.n =
|
|
18538
|
+
_context9.n = 26;
|
|
18494
18539
|
return call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
|
|
18495
|
-
case
|
|
18540
|
+
case 26:
|
|
18496
18541
|
result = _context9.v;
|
|
18497
18542
|
if (!(result.messages.length === 50)) {
|
|
18498
|
-
_context9.n =
|
|
18543
|
+
_context9.n = 30;
|
|
18499
18544
|
break;
|
|
18500
18545
|
}
|
|
18501
18546
|
messageQuery.limit = channel.newMessageCount > 25 ? (MESSAGES_MAX_LENGTH - 50) / 2 : MESSAGES_MAX_LENGTH - 50;
|
|
18502
|
-
_context9.n =
|
|
18547
|
+
_context9.n = 27;
|
|
18503
18548
|
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
18504
|
-
case
|
|
18549
|
+
case 27:
|
|
18505
18550
|
_secondResult2 = _context9.v;
|
|
18506
18551
|
if (!(channel.newMessageCount > 25)) {
|
|
18507
|
-
_context9.n =
|
|
18552
|
+
_context9.n = 29;
|
|
18508
18553
|
break;
|
|
18509
18554
|
}
|
|
18510
18555
|
messageQuery.reverse = false;
|
|
18511
|
-
_context9.n =
|
|
18556
|
+
_context9.n = 28;
|
|
18512
18557
|
return call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
|
|
18513
|
-
case
|
|
18558
|
+
case 28:
|
|
18514
18559
|
_thirdResult = _context9.v;
|
|
18515
18560
|
result.messages = [].concat(_secondResult2.messages, result.messages, _thirdResult.messages);
|
|
18516
18561
|
messageQuery.reverse = true;
|
|
18517
|
-
_context9.n =
|
|
18562
|
+
_context9.n = 30;
|
|
18518
18563
|
break;
|
|
18519
|
-
case
|
|
18564
|
+
case 29:
|
|
18520
18565
|
result.messages = [].concat(_secondResult2.messages, result.messages);
|
|
18521
|
-
case
|
|
18522
|
-
_context9.n = 36;
|
|
18523
|
-
break;
|
|
18524
|
-
case 33:
|
|
18566
|
+
case 30:
|
|
18525
18567
|
_context9.n = 34;
|
|
18568
|
+
break;
|
|
18569
|
+
case 31:
|
|
18570
|
+
_context9.n = 32;
|
|
18526
18571
|
return call(messageQuery.loadPrevious);
|
|
18527
|
-
case
|
|
18572
|
+
case 32:
|
|
18528
18573
|
result = _context9.v;
|
|
18529
18574
|
if (!(result.messages.length === 50)) {
|
|
18530
|
-
_context9.n =
|
|
18575
|
+
_context9.n = 34;
|
|
18531
18576
|
break;
|
|
18532
18577
|
}
|
|
18533
18578
|
messageQuery.limit = MESSAGES_MAX_LENGTH - 50;
|
|
18534
|
-
_context9.n =
|
|
18579
|
+
_context9.n = 33;
|
|
18535
18580
|
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
18536
|
-
case
|
|
18581
|
+
case 33:
|
|
18537
18582
|
_secondResult3 = _context9.v;
|
|
18538
18583
|
result.messages = [].concat(_secondResult3.messages, result.messages);
|
|
18539
18584
|
result.hasNext = _secondResult3.hasNext;
|
|
18540
|
-
case
|
|
18585
|
+
case 34:
|
|
18541
18586
|
setMessagesToMap(channel.id, result.messages);
|
|
18542
|
-
_context9.n =
|
|
18587
|
+
_context9.n = 35;
|
|
18543
18588
|
return put(setMessagesHasPrevAC(true));
|
|
18544
|
-
case
|
|
18545
|
-
_context9.n =
|
|
18589
|
+
case 35:
|
|
18590
|
+
_context9.n = 36;
|
|
18546
18591
|
return put(setMessagesHasNextAC(channel.lastMessage && result.messages.length > 0 && channel.lastMessage.id !== result.messages[result.messages.length - 1].id));
|
|
18547
|
-
case
|
|
18592
|
+
case 36:
|
|
18548
18593
|
setAllMessages([].concat(result.messages));
|
|
18549
|
-
_context9.n =
|
|
18594
|
+
_context9.n = 37;
|
|
18550
18595
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
18551
|
-
case
|
|
18552
|
-
_context9.n =
|
|
18596
|
+
case 37:
|
|
18597
|
+
_context9.n = 45;
|
|
18553
18598
|
break;
|
|
18554
|
-
case
|
|
18599
|
+
case 38:
|
|
18555
18600
|
setAllMessages([]);
|
|
18556
18601
|
if (!(cachedMessages && cachedMessages.length)) {
|
|
18557
|
-
_context9.n =
|
|
18602
|
+
_context9.n = 39;
|
|
18558
18603
|
break;
|
|
18559
18604
|
}
|
|
18560
18605
|
setAllMessages([].concat(cachedMessages));
|
|
18561
|
-
_context9.n =
|
|
18606
|
+
_context9.n = 39;
|
|
18562
18607
|
return put(setMessagesAC(JSON.parse(JSON.stringify(cachedMessages))));
|
|
18563
|
-
case
|
|
18608
|
+
case 39:
|
|
18564
18609
|
log.info('load message from server');
|
|
18565
|
-
_context9.n =
|
|
18610
|
+
_context9.n = 40;
|
|
18566
18611
|
return call(messageQuery.loadPrevious);
|
|
18567
|
-
case
|
|
18612
|
+
case 40:
|
|
18568
18613
|
result = _context9.v;
|
|
18569
18614
|
if (!(result.messages.length === 50)) {
|
|
18570
|
-
_context9.n =
|
|
18615
|
+
_context9.n = 42;
|
|
18571
18616
|
break;
|
|
18572
18617
|
}
|
|
18573
18618
|
messageQuery.limit = MESSAGES_MAX_LENGTH - 50;
|
|
18574
|
-
_context9.n =
|
|
18619
|
+
_context9.n = 41;
|
|
18575
18620
|
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
18576
|
-
case
|
|
18621
|
+
case 41:
|
|
18577
18622
|
_secondResult4 = _context9.v;
|
|
18578
18623
|
result.messages = [].concat(_secondResult4.messages, result.messages);
|
|
18579
18624
|
result.hasNext = _secondResult4.hasNext;
|
|
18580
|
-
case
|
|
18625
|
+
case 42:
|
|
18626
|
+
updatedMessages = [];
|
|
18581
18627
|
result.messages.forEach(function (msg) {
|
|
18582
|
-
updateMessageOnMap(channel.id, {
|
|
18628
|
+
var updatedMessage = updateMessageOnMap(channel.id, {
|
|
18583
18629
|
messageId: msg.id,
|
|
18584
18630
|
params: msg
|
|
18585
18631
|
});
|
|
18586
|
-
updateMessageOnAllMessages(msg.id, msg);
|
|
18632
|
+
updateMessageOnAllMessages(msg.id, updatedMessage || msg);
|
|
18633
|
+
updatedMessages.push(updatedMessage || msg);
|
|
18587
18634
|
});
|
|
18588
|
-
|
|
18635
|
+
setMessagesToMap(channel.id, updatedMessages);
|
|
18636
|
+
setAllMessages([].concat(updatedMessages));
|
|
18637
|
+
_context9.n = 43;
|
|
18638
|
+
return put(setMessagesAC(JSON.parse(JSON.stringify(updatedMessages))));
|
|
18639
|
+
case 43:
|
|
18640
|
+
_context9.n = 44;
|
|
18589
18641
|
return put(setMessagesHasPrevAC(result.hasNext));
|
|
18590
|
-
case
|
|
18591
|
-
_context9.n =
|
|
18642
|
+
case 44:
|
|
18643
|
+
_context9.n = 45;
|
|
18592
18644
|
return put(setMessagesHasNextAC(false));
|
|
18593
|
-
case
|
|
18645
|
+
case 45:
|
|
18594
18646
|
pendingMessages = getPendingMessages(channel.id);
|
|
18595
18647
|
if (!(pendingMessages && pendingMessages.length)) {
|
|
18596
|
-
_context9.n =
|
|
18648
|
+
_context9.n = 47;
|
|
18597
18649
|
break;
|
|
18598
18650
|
}
|
|
18599
18651
|
_messagesMap = {};
|
|
@@ -18603,40 +18655,40 @@ function getMessagesQuery(action) {
|
|
|
18603
18655
|
filteredPendingMessages = pendingMessages.filter(function (msg) {
|
|
18604
18656
|
return !_messagesMap[msg.tid || ''];
|
|
18605
18657
|
});
|
|
18606
|
-
_context9.n =
|
|
18658
|
+
_context9.n = 46;
|
|
18607
18659
|
return put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
18608
|
-
case
|
|
18660
|
+
case 46:
|
|
18609
18661
|
for (index = 0; index < filteredPendingMessages.length; index++) {
|
|
18610
18662
|
mes = filteredPendingMessages[index];
|
|
18611
18663
|
removePendingMessageFromMap(channel === null || channel === void 0 ? void 0 : channel.id, mes.tid || mes.id);
|
|
18612
18664
|
}
|
|
18613
|
-
case
|
|
18614
|
-
_context9.n =
|
|
18665
|
+
case 47:
|
|
18666
|
+
_context9.n = 49;
|
|
18615
18667
|
break;
|
|
18616
|
-
case
|
|
18668
|
+
case 48:
|
|
18617
18669
|
if (!channel.isMockChannel) {
|
|
18618
|
-
_context9.n =
|
|
18670
|
+
_context9.n = 49;
|
|
18619
18671
|
break;
|
|
18620
18672
|
}
|
|
18621
|
-
_context9.n =
|
|
18673
|
+
_context9.n = 49;
|
|
18622
18674
|
return put(setMessagesAC([]));
|
|
18623
|
-
case
|
|
18624
|
-
_context9.n =
|
|
18675
|
+
case 49:
|
|
18676
|
+
_context9.n = 51;
|
|
18625
18677
|
break;
|
|
18626
|
-
case
|
|
18627
|
-
_context9.p =
|
|
18678
|
+
case 50:
|
|
18679
|
+
_context9.p = 50;
|
|
18628
18680
|
_t9 = _context9.v;
|
|
18629
18681
|
log.error('error in message query', _t9);
|
|
18630
|
-
case
|
|
18631
|
-
_context9.p =
|
|
18632
|
-
_context9.n =
|
|
18682
|
+
case 51:
|
|
18683
|
+
_context9.p = 51;
|
|
18684
|
+
_context9.n = 52;
|
|
18633
18685
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
18686
|
+
case 52:
|
|
18687
|
+
return _context9.f(51);
|
|
18634
18688
|
case 53:
|
|
18635
|
-
return _context9.f(52);
|
|
18636
|
-
case 54:
|
|
18637
18689
|
return _context9.a(2);
|
|
18638
18690
|
}
|
|
18639
|
-
}, _marked7$1, null, [[
|
|
18691
|
+
}, _marked7$1, null, [[0, 50, 51, 53]]);
|
|
18640
18692
|
}
|
|
18641
18693
|
function loadMoreMessages(action) {
|
|
18642
18694
|
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _t0;
|
|
@@ -23112,7 +23164,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
23112
23164
|
channelAvatarSize = _ref.channelAvatarSize,
|
|
23113
23165
|
channelAvatarTextSize = _ref.channelAvatarTextSize,
|
|
23114
23166
|
searchChannelInputFontSize = _ref.searchChannelInputFontSize,
|
|
23115
|
-
searchedChannelsTitleFontSize = _ref.searchedChannelsTitleFontSize
|
|
23167
|
+
searchedChannelsTitleFontSize = _ref.searchedChannelsTitleFontSize,
|
|
23168
|
+
searchChannelsPadding = _ref.searchChannelsPadding;
|
|
23116
23169
|
var _useColor = useColors(),
|
|
23117
23170
|
background = _useColor[THEME_COLORS.BACKGROUND],
|
|
23118
23171
|
textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
|
|
@@ -23349,7 +23402,8 @@ var ChannelList = function ChannelList(_ref) {
|
|
|
23349
23402
|
}, /*#__PURE__*/React__default.createElement(ChannelListHeader, {
|
|
23350
23403
|
withCustomList: !!List,
|
|
23351
23404
|
maxWidth: channelListRef.current && ((_channelListRef$curre2 = channelListRef.current) === null || _channelListRef$curre2 === void 0 ? void 0 : _channelListRef$curre2.clientWidth) || 0,
|
|
23352
|
-
borderColor: borderColor
|
|
23405
|
+
borderColor: borderColor,
|
|
23406
|
+
padding: searchChannelsPadding
|
|
23353
23407
|
}, Profile, showSearch && searchChannelsPosition === 'inline' ? (/*#__PURE__*/React__default.createElement(ChannelSearch, {
|
|
23354
23408
|
inline: true,
|
|
23355
23409
|
borderRadius: searchInputBorderRadius,
|
|
@@ -23672,8 +23726,10 @@ var NoData = styled.div(_templateObject8$4 || (_templateObject8$4 = _taggedTempl
|
|
|
23672
23726
|
return props.color;
|
|
23673
23727
|
});
|
|
23674
23728
|
var LoadingWrapper = styled.div(_templateObject9$4 || (_templateObject9$4 = _taggedTemplateLiteralLoose(["\n position: absolute;\n left: calc(50% - 20px);\n top: calc(50% - 20px);\n"])));
|
|
23675
|
-
var ChannelListHeader = styled.div(_templateObject0$3 || (_templateObject0$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n max-width: ", ";\n padding:
|
|
23729
|
+
var ChannelListHeader = styled.div(_templateObject0$3 || (_templateObject0$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n max-width: ", ";\n padding: ", ";\n padding-left: 22px;\n box-sizing: border-box;\n padding-left: ", ";\n border-right: ", ";\n"])), function (props) {
|
|
23676
23730
|
return props.maxWidth ? props.maxWidth + "px" : 'inherit';
|
|
23731
|
+
}, function (props) {
|
|
23732
|
+
return props.padding || '12px';
|
|
23677
23733
|
}, function (props) {
|
|
23678
23734
|
return props.withoutProfile && '52px';
|
|
23679
23735
|
}, function (props) {
|
|
@@ -24699,7 +24755,7 @@ var VolumeSlide = styled.input(_templateObject9$6 || (_templateObject9$6 = _tagg
|
|
|
24699
24755
|
var Progress = styled.input(_templateObject0$5 || (_templateObject0$5 = _taggedTemplateLiteralLoose(["\n -webkit-appearance: none;\n margin-right: 15px;\n width: 100%;\n height: 4px;\n background: rgba(255, 255, 255, 0.6);\n border-radius: 5px;\n background-image: linear-gradient(#fff, #fff);\n //background-size: 70% 100%;\n background-repeat: no-repeat;\n cursor: pointer;\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n &::-moz-range-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n\n &::-ms-thumb {\n -webkit-appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer;\n box-shadow: 0 0 2px 0 #555;\n transition: all 0.3s ease-in-out;\n }\n\n &::-webkit-slider-thumb:hover {\n background: #fff;\n }\n &::-moz-range-thumb:hover {\n background: #fff;\n }\n &::-ms-thumb:hover {\n background: #fff;\n }\n\n &::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n\n &::-moz-range-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n &::-ms-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n transition: all 0.3s ease-in-out;\n }\n"])));
|
|
24700
24756
|
var FullScreenWrapper = styled.div(_templateObject1$3 || (_templateObject1$3 = _taggedTemplateLiteralLoose(["\n display: flex;\n margin-left: 16px;\n cursor: pointer;\n @media (max-width: 768px) {\n margin-left: 12px;\n & > svg {\n width: 18px;\n height: 18px;\n }\n }\n @media (max-width: 480px) {\n margin-left: auto;\n & > svg {\n width: 16px;\n height: 16px;\n }\n }\n"])));
|
|
24701
24757
|
|
|
24702
|
-
var _templateObject$l, _templateObject2$i, _templateObject3$e, _templateObject4$c, _templateObject5$a, _templateObject6$8, _templateObject7$7, _templateObject8$7, _templateObject9$7, _templateObject0$6;
|
|
24758
|
+
var _templateObject$l, _templateObject2$i, _templateObject3$e, _templateObject4$c, _templateObject5$a, _templateObject6$8, _templateObject7$7, _templateObject8$7, _templateObject9$7, _templateObject0$6, _templateObject1$4;
|
|
24703
24759
|
function ForwardMessagePopup(_ref) {
|
|
24704
24760
|
var title = _ref.title,
|
|
24705
24761
|
buttonText = _ref.buttonText,
|
|
@@ -24949,7 +25005,9 @@ function ForwardMessagePopup(_ref) {
|
|
|
24949
25005
|
backgroundColor: 'transparent',
|
|
24950
25006
|
checkedBackgroundColor: accentColor
|
|
24951
25007
|
}));
|
|
24952
|
-
})))
|
|
25008
|
+
}))), !searchedChannels.chats_groups.length && !searchedChannels.channels.length && (/*#__PURE__*/React__default.createElement(NoResults, {
|
|
25009
|
+
color: textSecondary
|
|
25010
|
+
}, "No channels found")))) : channels.map(function (channel) {
|
|
24953
25011
|
var _channel$metadata3;
|
|
24954
25012
|
var isDirectChannel = channel.type === DEFAULT_CHANNEL_TYPE.DIRECT;
|
|
24955
25013
|
var isSelfChannel = isDirectChannel && ((_channel$metadata3 = channel.metadata) === null || _channel$metadata3 === void 0 ? void 0 : _channel$metadata3.s);
|
|
@@ -25033,6 +25091,9 @@ var SelectedChannelName = styled.span(_templateObject9$7 || (_templateObject9$7
|
|
|
25033
25091
|
return props.color;
|
|
25034
25092
|
});
|
|
25035
25093
|
var StyledSubtractSvg$1 = styled(SvgCross)(_templateObject0$6 || (_templateObject0$6 = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin-left: 4px;\n transform: translate(2px, 0);\n"])));
|
|
25094
|
+
var NoResults = styled.div(_templateObject1$4 || (_templateObject1$4 = _taggedTemplateLiteralLoose(["\n font-size: 15px;\n line-height: 16px;\n font-weight: 500;\n text-align: center;\n margin-top: 20px;\n color: ", ";\n"])), function (props) {
|
|
25095
|
+
return props.color;
|
|
25096
|
+
});
|
|
25036
25097
|
|
|
25037
25098
|
var _templateObject$m, _templateObject2$j;
|
|
25038
25099
|
var CustomRadio = function CustomRadio(_ref) {
|
|
@@ -25206,7 +25267,7 @@ var DeleteOptionItem = styled.div(_templateObject2$k || (_templateObject2$k = _t
|
|
|
25206
25267
|
return props.color;
|
|
25207
25268
|
});
|
|
25208
25269
|
|
|
25209
|
-
var _templateObject$o, _templateObject2$l, _templateObject3$f, _templateObject4$d, _templateObject5$b, _templateObject6$9, _templateObject7$8, _templateObject8$8, _templateObject9$8, _templateObject0$7, _templateObject1$
|
|
25270
|
+
var _templateObject$o, _templateObject2$l, _templateObject3$f, _templateObject4$d, _templateObject5$b, _templateObject6$9, _templateObject7$8, _templateObject8$8, _templateObject9$8, _templateObject0$7, _templateObject1$5, _templateObject10$2, _templateObject11$2, _templateObject12$2, _templateObject13$2;
|
|
25210
25271
|
var SliderPopup = function SliderPopup(_ref) {
|
|
25211
25272
|
var channel = _ref.channel,
|
|
25212
25273
|
setIsSliderOpen = _ref.setIsSliderOpen,
|
|
@@ -25747,7 +25808,7 @@ var FileSize = styled.span(_templateObject9$8 || (_templateObject9$8 = _taggedTe
|
|
|
25747
25808
|
var UserName = styled.h4(_templateObject0$7 || (_templateObject0$7 = _taggedTemplateLiteralLoose(["\n margin: 0;\n color: ", ";\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n"])), function (props) {
|
|
25748
25809
|
return props.color;
|
|
25749
25810
|
});
|
|
25750
|
-
var ActionsWrapper = styled.div(_templateObject1$
|
|
25811
|
+
var ActionsWrapper = styled.div(_templateObject1$5 || (_templateObject1$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n"])));
|
|
25751
25812
|
var IconWrapper = styled.span(_templateObject10$2 || (_templateObject10$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n cursor: pointer;\n color: ", ";\n margin: ", ";\n\n & > svg {\n width: 28px;\n height: 28px;\n }\n\n ", "\n"])), function (props) {
|
|
25752
25813
|
return props.color;
|
|
25753
25814
|
}, function (props) {
|
|
@@ -29092,7 +29153,7 @@ var Timer$1 = styled.div(_templateObject6$c || (_templateObject6$c = _taggedTemp
|
|
|
29092
29153
|
return props.color;
|
|
29093
29154
|
});
|
|
29094
29155
|
|
|
29095
|
-
var _templateObject$u, _templateObject2$q, _templateObject3$k, _templateObject4$h, _templateObject5$f, _templateObject6$d, _templateObject7$b, _templateObject8$a, _templateObject9$a, _templateObject0$9, _templateObject1$
|
|
29156
|
+
var _templateObject$u, _templateObject2$q, _templateObject3$k, _templateObject4$h, _templateObject5$f, _templateObject6$d, _templateObject7$b, _templateObject8$a, _templateObject9$a, _templateObject0$9, _templateObject1$6, _templateObject10$3, _templateObject11$3;
|
|
29096
29157
|
var Attachment = function Attachment(_ref) {
|
|
29097
29158
|
var attachment = _ref.attachment,
|
|
29098
29159
|
_ref$isPreview = _ref.isPreview,
|
|
@@ -29205,7 +29266,15 @@ var Attachment = function Attachment(_ref) {
|
|
|
29205
29266
|
if (downloadIsCancelled) {
|
|
29206
29267
|
setDownloadIsCancelled(false);
|
|
29207
29268
|
if (customDownloader) {
|
|
29208
|
-
customDownloader(attachment.url, false, function () {
|
|
29269
|
+
customDownloader(attachment.url, false, function (progress) {
|
|
29270
|
+
var loadedRes = progress.loaded && progress.loaded / progress.total;
|
|
29271
|
+
var uploadPercent = loadedRes && loadedRes * 100;
|
|
29272
|
+
setSizeProgress({
|
|
29273
|
+
loaded: progress.loaded || 0,
|
|
29274
|
+
total: progress.total || 0
|
|
29275
|
+
});
|
|
29276
|
+
setProgress(uploadPercent);
|
|
29277
|
+
}, messageType).then(function (url) {
|
|
29209
29278
|
downloadImage(url);
|
|
29210
29279
|
});
|
|
29211
29280
|
} else {
|
|
@@ -29333,23 +29402,35 @@ var Attachment = function Attachment(_ref) {
|
|
|
29333
29402
|
}
|
|
29334
29403
|
}, [attachmentUrl]);
|
|
29335
29404
|
useEffect(function () {
|
|
29336
|
-
if (connectionStatus === CONNECTION_STATUS.CONNECTED && attachment.id && !(attachment.type === attachmentTypes.file || attachment.type === attachmentTypes.link)) {
|
|
29405
|
+
if (!attachment.attachmentUrl && connectionStatus === CONNECTION_STATUS.CONNECTED && attachment.id && !(attachment.type === attachmentTypes.file || attachment.type === attachmentTypes.link)) {
|
|
29337
29406
|
getAttachmentUrlFromCache(attachment.url).then(function (cachedUrl) {
|
|
29338
29407
|
try {
|
|
29339
29408
|
if (attachment.type === 'image' && !isPreview) {
|
|
29340
29409
|
if (cachedUrl) {
|
|
29341
29410
|
setAttachmentUrl(cachedUrl);
|
|
29411
|
+
dispatch(setUpdateMessageAttachmentAC(attachment.url, attachment.messageId, {
|
|
29412
|
+
attachmentUrl: cachedUrl
|
|
29413
|
+
}));
|
|
29342
29414
|
setIsCached(true);
|
|
29343
29415
|
} else {
|
|
29344
29416
|
setIsCached(false);
|
|
29345
29417
|
setDownloadingFile(true);
|
|
29346
29418
|
if (customDownloader) {
|
|
29347
|
-
customDownloader(attachment.url, false, function () {
|
|
29419
|
+
customDownloader(attachment.url, false, function (progress) {
|
|
29420
|
+
var loadedRes = progress.loaded && progress.loaded / progress.total;
|
|
29421
|
+
var uploadPercent = loadedRes && loadedRes * 100;
|
|
29422
|
+
setSizeProgress({
|
|
29423
|
+
loaded: progress.loaded || 0,
|
|
29424
|
+
total: progress.total || 0
|
|
29425
|
+
});
|
|
29426
|
+
setProgress(uploadPercent);
|
|
29427
|
+
}, messageType).then(function (url) {
|
|
29348
29428
|
try {
|
|
29349
29429
|
downloadImage(url);
|
|
29350
29430
|
return Promise.resolve(fetch(url)).then(function (response) {
|
|
29351
29431
|
setAttachmentToCache(attachment.url, response);
|
|
29352
29432
|
setIsCached(true);
|
|
29433
|
+
setDownloadingFile(false);
|
|
29353
29434
|
});
|
|
29354
29435
|
} catch (e) {
|
|
29355
29436
|
return Promise.reject(e);
|
|
@@ -29388,7 +29469,15 @@ var Attachment = function Attachment(_ref) {
|
|
|
29388
29469
|
log.info('error on get attachment url from cache. .. ', e);
|
|
29389
29470
|
if (customDownloader) {
|
|
29390
29471
|
setDownloadingFile(true);
|
|
29391
|
-
customDownloader(attachment.url,
|
|
29472
|
+
customDownloader(attachment.url, true, function (progress) {
|
|
29473
|
+
var loadedRes = progress.loaded && progress.loaded / progress.total;
|
|
29474
|
+
var uploadPercent = loadedRes && loadedRes * 100;
|
|
29475
|
+
setSizeProgress({
|
|
29476
|
+
loaded: progress.loaded || 0,
|
|
29477
|
+
total: progress.total || 0
|
|
29478
|
+
});
|
|
29479
|
+
setProgress(uploadPercent);
|
|
29480
|
+
}, messageType).then(function (url) {
|
|
29392
29481
|
try {
|
|
29393
29482
|
return Promise.resolve(fetch(url)).then(function (response) {
|
|
29394
29483
|
setAttachmentToCache(attachment.url, response);
|
|
@@ -29493,7 +29582,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29493
29582
|
imageMinWidth: imageMinWidth,
|
|
29494
29583
|
withPrefix: withPrefix,
|
|
29495
29584
|
borderColor: borderColor
|
|
29496
|
-
}, /*#__PURE__*/React__default.createElement(UploadPercent, {
|
|
29585
|
+
}, !isPreview && (isInUploadingState || downloadingFile) && sizeProgress && sizeProgress.loaded < sizeProgress.total && (/*#__PURE__*/React__default.createElement(UploadPercent, {
|
|
29497
29586
|
isRepliedMessage: isRepliedMessage,
|
|
29498
29587
|
isDetailsView: isDetailsView,
|
|
29499
29588
|
backgroundColor: overlayBackground2
|
|
@@ -29523,7 +29612,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
29523
29612
|
}
|
|
29524
29613
|
})), sizeProgress && (/*#__PURE__*/React__default.createElement(SizeProgress, {
|
|
29525
29614
|
color: textOnPrimary
|
|
29526
|
-
}, bytesToSize(sizeProgress.loaded, 1), " / ", bytesToSize(sizeProgress.total, 1)))))))) : null, isPreview && (/*#__PURE__*/React__default.createElement(RemoveChosenFile, {
|
|
29615
|
+
}, bytesToSize(sizeProgress.loaded, 1), " / ", bytesToSize(sizeProgress.total, 1))))))))) : null, isPreview && (/*#__PURE__*/React__default.createElement(RemoveChosenFile, {
|
|
29527
29616
|
backgroundColor: background,
|
|
29528
29617
|
color: iconInactive,
|
|
29529
29618
|
onClick: function onClick() {
|
|
@@ -29759,7 +29848,7 @@ var AttachmentSize = styled.span(_templateObject0$9 || (_templateObject0$9 = _ta
|
|
|
29759
29848
|
}, function (props) {
|
|
29760
29849
|
return props.errorColor;
|
|
29761
29850
|
});
|
|
29762
|
-
var AttachmentFileInfo = styled.div(_templateObject1$
|
|
29851
|
+
var AttachmentFileInfo = styled.div(_templateObject1$6 || (_templateObject1$6 = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n ", "\n"])), function (props) {
|
|
29763
29852
|
return props.isPreview && "line-height: 14px;\n max-width: calc(100% - 44px);\n ";
|
|
29764
29853
|
});
|
|
29765
29854
|
var AttachmentImg$1 = styled.img(_templateObject10$3 || (_templateObject10$3 = _taggedTemplateLiteralLoose(["\n position: ", ";\n border-radius: ", ";\n padding: ", ";\n box-sizing: border-box;\n max-width: 100%;\n max-height: ", ";\n width: ", ";\n height: ", ";\n min-height: ", ";\n min-width: ", ";\n object-fit: cover;\n visibility: ", ";\n z-index: 2;\n"])), function (props) {
|
|
@@ -31504,7 +31593,7 @@ var FrequentlyEmojisContainer = styled.div(_templateObject5$i || (_templateObjec
|
|
|
31504
31593
|
return props.rtlDirection && '0';
|
|
31505
31594
|
});
|
|
31506
31595
|
|
|
31507
|
-
var _templateObject$C, _templateObject2$x, _templateObject3$r, _templateObject4$n, _templateObject5$j, _templateObject6$g, _templateObject7$e, _templateObject8$d, _templateObject9$b, _templateObject0$a, _templateObject1$
|
|
31596
|
+
var _templateObject$C, _templateObject2$x, _templateObject3$r, _templateObject4$n, _templateObject5$j, _templateObject6$g, _templateObject7$e, _templateObject8$d, _templateObject9$b, _templateObject0$a, _templateObject1$7, _templateObject10$4, _templateObject11$4, _templateObject12$3;
|
|
31508
31597
|
var Message$1 = function Message(_ref) {
|
|
31509
31598
|
var message = _ref.message,
|
|
31510
31599
|
channel = _ref.channel,
|
|
@@ -31833,7 +31922,6 @@ var Message$1 = function Message(_ref) {
|
|
|
31833
31922
|
if (isVisible && message.incoming && !(message.userMarkers && message.userMarkers.length && message.userMarkers.find(function (marker) {
|
|
31834
31923
|
return marker.name === MESSAGE_DELIVERY_STATUS.READ;
|
|
31835
31924
|
})) && channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED) {
|
|
31836
|
-
log.info('send displayed marker for message ... ', message);
|
|
31837
31925
|
dispatch(markMessagesAsReadAC(channel.id, [message.id]));
|
|
31838
31926
|
}
|
|
31839
31927
|
};
|
|
@@ -32282,7 +32370,7 @@ var ReactionsContainer = styled.div(_templateObject9$b || (_templateObject9$b =
|
|
|
32282
32370
|
var MessageReactionsCont = styled.div(_templateObject0$a || (_templateObject0$a = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-flex;\n max-width: 300px;\n direction: ", ";\n cursor: pointer;\n"])), function (props) {
|
|
32283
32371
|
return props.rtlDirection && 'ltr';
|
|
32284
32372
|
});
|
|
32285
|
-
var MessageStatus$1 = styled.span(_templateObject1$
|
|
32373
|
+
var MessageStatus$1 = styled.span(_templateObject1$7 || (_templateObject1$7 = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n margin-left: 4px;\n text-align: right;\n height: ", ";\n & > svg {\n height: 16px;\n width: 16px;\n }\n"])), function (props) {
|
|
32286
32374
|
return props.height || '14px';
|
|
32287
32375
|
});
|
|
32288
32376
|
var HiddenMessageTime$1 = styled.span(_templateObject10$4 || (_templateObject10$4 = _taggedTemplateLiteralLoose(["\n display: ", ";\n font-weight: 400;\n font-size: ", ";\n color: ", ";\n"])), function (props) {
|
|
@@ -32327,7 +32415,7 @@ var HiddenMessageProperty;
|
|
|
32327
32415
|
HiddenMessageProperty["hideAfterSendMessage"] = "hideAfterSendMessage";
|
|
32328
32416
|
})(HiddenMessageProperty || (HiddenMessageProperty = {}));
|
|
32329
32417
|
|
|
32330
|
-
var _templateObject$D, _templateObject2$y, _templateObject3$s, _templateObject4$o, _templateObject5$k, _templateObject6$h, _templateObject7$f, _templateObject8$e, _templateObject9$c, _templateObject0$b, _templateObject1$
|
|
32418
|
+
var _templateObject$D, _templateObject2$y, _templateObject3$s, _templateObject4$o, _templateObject5$k, _templateObject6$h, _templateObject7$f, _templateObject8$e, _templateObject9$c, _templateObject0$b, _templateObject1$8;
|
|
32331
32419
|
var loadFromServer = false;
|
|
32332
32420
|
var loadDirection = '';
|
|
32333
32421
|
var nextDisable = false;
|
|
@@ -32918,7 +33006,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
32918
33006
|
clearVisibleMessagesMap();
|
|
32919
33007
|
}
|
|
32920
33008
|
if (channel) {
|
|
32921
|
-
dispatch(getMessagesAC(channel,
|
|
33009
|
+
dispatch(getMessagesAC(channel, undefined, undefined, undefined, true));
|
|
32922
33010
|
}
|
|
32923
33011
|
if (channel.id) {
|
|
32924
33012
|
if (channel.newMessageCount && channel.newMessageCount > 0) {
|
|
@@ -33377,7 +33465,7 @@ var NoMessagesContainer = styled.div(_templateObject9$c || (_templateObject9$c =
|
|
|
33377
33465
|
var NoMessagesTitle = styled.h4(_templateObject0$b || (_templateObject0$b = _taggedTemplateLiteralLoose(["\n margin: 12px 0 8px;\n font-family: Inter, sans-serif;\n text-align: center;\n font-size: 20px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px;\n color: ", ";\n"])), function (props) {
|
|
33378
33466
|
return props.color;
|
|
33379
33467
|
});
|
|
33380
|
-
var NoMessagesText = styled.p(_templateObject1$
|
|
33468
|
+
var NoMessagesText = styled.p(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n margin: 0;\n text-align: center;\n font-feature-settings:\n 'clig' off,\n 'liga' off;\n font-family: Inter, sans-serif;\n font-size: 15px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n color: ", ";\n"])), function (props) {
|
|
33381
33469
|
return props.color;
|
|
33382
33470
|
});
|
|
33383
33471
|
|
|
@@ -35962,7 +36050,7 @@ var RecordingAnimation = function RecordingAnimation(_ref2) {
|
|
|
35962
36050
|
}));
|
|
35963
36051
|
};
|
|
35964
36052
|
|
|
35965
|
-
var _templateObject$J, _templateObject2$E, _templateObject3$x, _templateObject4$s, _templateObject5$o, _templateObject6$k, _templateObject7$i, _templateObject8$g, _templateObject9$d, _templateObject0$c, _templateObject1$
|
|
36053
|
+
var _templateObject$J, _templateObject2$E, _templateObject3$x, _templateObject4$s, _templateObject5$o, _templateObject6$k, _templateObject7$i, _templateObject8$g, _templateObject9$d, _templateObject0$c, _templateObject1$9, _templateObject10$5, _templateObject11$5, _templateObject12$4, _templateObject13$3, _templateObject14$2, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$1, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1;
|
|
35966
36054
|
function AutoFocusPlugin(_ref) {
|
|
35967
36055
|
var messageForReply = _ref.messageForReply;
|
|
35968
36056
|
var _useLexicalComposerCo = useLexicalComposerContext(),
|
|
@@ -37586,7 +37674,7 @@ var AddAttachmentIcon = styled.span(_templateObject0$c || (_templateObject0$c =
|
|
|
37586
37674
|
}, function (props) {
|
|
37587
37675
|
return props.hoverColor;
|
|
37588
37676
|
});
|
|
37589
|
-
var SendMessageInputContainer = styled.div(_templateObject1$
|
|
37677
|
+
var SendMessageInputContainer = styled.div(_templateObject1$9 || (_templateObject1$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n position: relative;\n min-height: ", ";\n box-sizing: border-box;\n border-radius: ", ";\n\n & .dropdown-trigger.open {\n color: #ccc;\n\n & ", " {\n & > svg {\n color: ", ";\n }\n ;\n }\n }\n}\n"])), function (props) {
|
|
37590
37678
|
return props.minHeight || '36px';
|
|
37591
37679
|
}, function (props) {
|
|
37592
37680
|
return props.messageForReply ? '0 0 4px 4px' : '4px';
|
|
@@ -37882,7 +37970,7 @@ function SvgUnpin(props) {
|
|
|
37882
37970
|
})));
|
|
37883
37971
|
}
|
|
37884
37972
|
|
|
37885
|
-
var _templateObject$K, _templateObject2$F, _templateObject3$y, _templateObject4$t, _templateObject5$p, _templateObject6$l, _templateObject7$j, _templateObject8$h, _templateObject9$e, _templateObject0$d, _templateObject1$
|
|
37973
|
+
var _templateObject$K, _templateObject2$F, _templateObject3$y, _templateObject4$t, _templateObject5$p, _templateObject6$l, _templateObject7$j, _templateObject8$h, _templateObject9$e, _templateObject0$d, _templateObject1$a, _templateObject10$6, _templateObject11$6, _templateObject12$5, _templateObject13$4, _templateObject14$3, _templateObject15$3, _templateObject16$3;
|
|
37886
37974
|
var Actions = function Actions(_ref) {
|
|
37887
37975
|
var _channel$metadata;
|
|
37888
37976
|
var setActionsHeight = _ref.setActionsHeight,
|
|
@@ -38361,7 +38449,7 @@ var DefaultStarIcon = styled(SvgStar)(_templateObject7$j || (_templateObject7$j
|
|
|
38361
38449
|
var DefaultUnpinIcon = styled(SvgUnpin)(_templateObject8$h || (_templateObject8$h = _taggedTemplateLiteralLoose([""])));
|
|
38362
38450
|
var DefaultPinIcon = styled(SvgPin)(_templateObject9$e || (_templateObject9$e = _taggedTemplateLiteralLoose([""])));
|
|
38363
38451
|
var DefaultMarkAsRead = styled(SvgMarkAsRead)(_templateObject0$d || (_templateObject0$d = _taggedTemplateLiteralLoose([""])));
|
|
38364
|
-
var DefaultMarkAsUnRead = styled(SvgMarkAsUnRead)(_templateObject1$
|
|
38452
|
+
var DefaultMarkAsUnRead = styled(SvgMarkAsUnRead)(_templateObject1$a || (_templateObject1$a = _taggedTemplateLiteralLoose([""])));
|
|
38365
38453
|
var DefaultBlockIcon = styled(SvgBlockChannel)(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose([""])));
|
|
38366
38454
|
var DefaultReportIcon = styled(SvgReport)(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose([""])));
|
|
38367
38455
|
var DefaultClearIcon = styled(SvgClear)(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose([""])));
|
|
@@ -39907,7 +39995,7 @@ var EditChannel = function EditChannel(_ref) {
|
|
|
39907
39995
|
})));
|
|
39908
39996
|
};
|
|
39909
39997
|
|
|
39910
|
-
var _templateObject$V, _templateObject2$O, _templateObject3$F, _templateObject4$z, _templateObject5$u, _templateObject6$p, _templateObject7$n, _templateObject8$l, _templateObject9$g, _templateObject0$e, _templateObject1$
|
|
39998
|
+
var _templateObject$V, _templateObject2$O, _templateObject3$F, _templateObject4$z, _templateObject5$u, _templateObject6$p, _templateObject7$n, _templateObject8$l, _templateObject9$g, _templateObject0$e, _templateObject1$b, _templateObject10$7;
|
|
39911
39999
|
var Details = function Details(_ref) {
|
|
39912
40000
|
var _activeChannel$metada;
|
|
39913
40001
|
var detailsTitleText = _ref.detailsTitleText,
|
|
@@ -40339,7 +40427,7 @@ var ChannelName$1 = styled(SectionHeader)(_templateObject0$e || (_templateObject
|
|
|
40339
40427
|
}, function (props) {
|
|
40340
40428
|
return props.uppercase && 'uppercase';
|
|
40341
40429
|
});
|
|
40342
|
-
var ChannelNameWrapper = styled.div(_templateObject1$
|
|
40430
|
+
var ChannelNameWrapper = styled.div(_templateObject1$b || (_templateObject1$b = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n"])));
|
|
40343
40431
|
var EditButton = styled.span(_templateObject10$7 || (_templateObject10$7 = _taggedTemplateLiteralLoose(["\n margin-left: 6px;\n cursor: pointer;\n color: #b2b6be;\n"])));
|
|
40344
40432
|
|
|
40345
40433
|
var _templateObject$W;
|
|
@@ -40621,7 +40709,10 @@ var MessagesScrollToBottomButton = function MessagesScrollToBottomButton(_ref) {
|
|
|
40621
40709
|
var showScrollToNewMessageButton = useSelector(showScrollToNewMessageButtonSelector);
|
|
40622
40710
|
var messages = useSelector(activeChannelMessagesSelector) || [];
|
|
40623
40711
|
var handleScrollToBottom = function handleScrollToBottom() {
|
|
40624
|
-
|
|
40712
|
+
var user = getClient().user;
|
|
40713
|
+
if (channel.lastMessage.user.id !== user.id) {
|
|
40714
|
+
dispatch(markMessagesAsReadAC(channel.id, [channel.lastMessage.id]));
|
|
40715
|
+
}
|
|
40625
40716
|
handleScrollToLastMessage(channel.lastMessage.id);
|
|
40626
40717
|
};
|
|
40627
40718
|
var handleScrollToLastMessage = function handleScrollToLastMessage(messageId) {
|