sceyt-chat-react-uikit 1.7.6-beta.15 → 1.7.6-beta.16
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/assets/svg/document_icon.svg +6 -0
- package/components/ChannelDetails/DetailsTab/MonthHeader.d.ts +10 -0
- package/index.js +564 -758
- package/index.modern.js +564 -758
- package/package.json +1 -1
- package/assets/svg/file_icon.svg +0 -4
package/index.modern.js
CHANGED
|
@@ -10056,7 +10056,10 @@ var queryDirection = {
|
|
|
10056
10056
|
NEAR: 'near'
|
|
10057
10057
|
};
|
|
10058
10058
|
|
|
10059
|
-
function sendMessageAC(message, channelId, connectionState, sendAttachmentsAsSeparateMessage, isResend) {
|
|
10059
|
+
function sendMessageAC(message, channelId, connectionState, sendAttachmentsAsSeparateMessage, isResend, isAddToPendingMessagesMap) {
|
|
10060
|
+
if (isAddToPendingMessagesMap === void 0) {
|
|
10061
|
+
isAddToPendingMessagesMap = true;
|
|
10062
|
+
}
|
|
10060
10063
|
return {
|
|
10061
10064
|
type: SEND_MESSAGE,
|
|
10062
10065
|
payload: {
|
|
@@ -10064,17 +10067,22 @@ function sendMessageAC(message, channelId, connectionState, sendAttachmentsAsSep
|
|
|
10064
10067
|
channelId: channelId,
|
|
10065
10068
|
connectionState: connectionState,
|
|
10066
10069
|
sendAttachmentsAsSeparateMessage: sendAttachmentsAsSeparateMessage,
|
|
10067
|
-
isResend: isResend
|
|
10070
|
+
isResend: isResend,
|
|
10071
|
+
isAddToPendingMessagesMap: isAddToPendingMessagesMap
|
|
10068
10072
|
}
|
|
10069
10073
|
};
|
|
10070
10074
|
}
|
|
10071
|
-
function sendTextMessageAC(message, channelId, connectionState) {
|
|
10075
|
+
function sendTextMessageAC(message, channelId, connectionState, isAddToPendingMessagesMap) {
|
|
10076
|
+
if (isAddToPendingMessagesMap === void 0) {
|
|
10077
|
+
isAddToPendingMessagesMap = true;
|
|
10078
|
+
}
|
|
10072
10079
|
return {
|
|
10073
10080
|
type: SEND_TEXT_MESSAGE,
|
|
10074
10081
|
payload: {
|
|
10075
10082
|
message: message,
|
|
10076
10083
|
channelId: channelId,
|
|
10077
|
-
connectionState: connectionState
|
|
10084
|
+
connectionState: connectionState,
|
|
10085
|
+
isAddToPendingMessagesMap: isAddToPendingMessagesMap
|
|
10078
10086
|
}
|
|
10079
10087
|
};
|
|
10080
10088
|
}
|
|
@@ -10088,17 +10096,21 @@ function resendMessageAC(message, channelId, connectionState) {
|
|
|
10088
10096
|
}
|
|
10089
10097
|
};
|
|
10090
10098
|
}
|
|
10091
|
-
function forwardMessageAC(message, channelId, connectionState, isForward) {
|
|
10099
|
+
function forwardMessageAC(message, channelId, connectionState, isForward, isAddToPendingMessagesMap) {
|
|
10092
10100
|
if (isForward === void 0) {
|
|
10093
10101
|
isForward = true;
|
|
10094
10102
|
}
|
|
10103
|
+
if (isAddToPendingMessagesMap === void 0) {
|
|
10104
|
+
isAddToPendingMessagesMap = true;
|
|
10105
|
+
}
|
|
10095
10106
|
return {
|
|
10096
10107
|
type: FORWARD_MESSAGE,
|
|
10097
10108
|
payload: {
|
|
10098
10109
|
message: message,
|
|
10099
10110
|
channelId: channelId,
|
|
10100
10111
|
connectionState: connectionState,
|
|
10101
|
-
isForward: isForward
|
|
10112
|
+
isForward: isForward,
|
|
10113
|
+
isAddToPendingMessagesMap: isAddToPendingMessagesMap
|
|
10102
10114
|
}
|
|
10103
10115
|
};
|
|
10104
10116
|
}
|
|
@@ -10815,17 +10827,20 @@ function setMessagesToMap(channelId, messages) {
|
|
|
10815
10827
|
messagesMap[channelId] = {};
|
|
10816
10828
|
}
|
|
10817
10829
|
messages.forEach(function (msg) {
|
|
10818
|
-
messagesMap[channelId][msg.
|
|
10830
|
+
if (msg.tid && messagesMap[channelId][msg.tid]) {
|
|
10831
|
+
delete messagesMap[channelId][msg.tid];
|
|
10832
|
+
}
|
|
10833
|
+
messagesMap[channelId][msg.id || msg.tid] = msg;
|
|
10819
10834
|
});
|
|
10820
10835
|
}
|
|
10821
10836
|
function addMessageToMap(channelId, message) {
|
|
10822
10837
|
if (!messagesMap[channelId]) {
|
|
10823
10838
|
messagesMap[channelId] = {};
|
|
10824
10839
|
}
|
|
10825
|
-
messagesMap[channelId][message.
|
|
10826
|
-
|
|
10827
|
-
setPendingMessage(channelId, message);
|
|
10840
|
+
if (message.tid && messagesMap[channelId][message.tid]) {
|
|
10841
|
+
delete messagesMap[channelId][message.tid];
|
|
10828
10842
|
}
|
|
10843
|
+
messagesMap[channelId][message.id || message.tid] = message;
|
|
10829
10844
|
}
|
|
10830
10845
|
function updateMessageOnMap(channelId, updatedMessage, voteDetails) {
|
|
10831
10846
|
var pendingMessagesMap = store.getState().MessageReducer.pendingMessagesMap;
|
|
@@ -10876,7 +10891,10 @@ function updateMessageOnMap(channelId, updatedMessage, voteDetails) {
|
|
|
10876
10891
|
if (!messagesMap[channelId]) {
|
|
10877
10892
|
messagesMap[channelId] = {};
|
|
10878
10893
|
}
|
|
10879
|
-
messagesMap[channelId][msg.
|
|
10894
|
+
if (msg.tid && messagesMap[channelId][msg.tid]) {
|
|
10895
|
+
delete messagesMap[channelId][msg.tid];
|
|
10896
|
+
}
|
|
10897
|
+
messagesMap[channelId][msg.id || msg.tid] = msg;
|
|
10880
10898
|
});
|
|
10881
10899
|
}
|
|
10882
10900
|
return updatedMessageData;
|
|
@@ -10892,7 +10910,10 @@ function addReactionToMessageOnMap(channelId, message, reaction, isSelf) {
|
|
|
10892
10910
|
slfReactions = [reaction];
|
|
10893
10911
|
}
|
|
10894
10912
|
}
|
|
10895
|
-
messagesMap[channelId][message.
|
|
10913
|
+
if (message.tid && messagesMap[channelId][message.tid]) {
|
|
10914
|
+
delete messagesMap[channelId][message.tid];
|
|
10915
|
+
}
|
|
10916
|
+
messagesMap[channelId][message.id || message.tid] = _extends({}, messageShouldBeUpdated, {
|
|
10896
10917
|
userReactions: slfReactions,
|
|
10897
10918
|
reactionTotals: message.reactionTotals
|
|
10898
10919
|
});
|
|
@@ -10926,7 +10947,10 @@ function removeReactionToMessageOnMap(channelId, message, reaction, isSelf) {
|
|
|
10926
10947
|
return selfReaction.key !== reaction.key;
|
|
10927
10948
|
});
|
|
10928
10949
|
}
|
|
10929
|
-
messagesMap[channelId][message.
|
|
10950
|
+
if (message.tid && messagesMap[channelId][message.tid]) {
|
|
10951
|
+
delete messagesMap[channelId][message.tid];
|
|
10952
|
+
}
|
|
10953
|
+
messagesMap[channelId][message.id || message.tid] = _extends({}, messageShouldBeUpdated, {
|
|
10930
10954
|
reactionTotals: message.reactionTotals,
|
|
10931
10955
|
userReactions: userReactions
|
|
10932
10956
|
});
|
|
@@ -10961,6 +10985,9 @@ function updateMessageStatusOnMap(channelId, newMarkers) {
|
|
|
10961
10985
|
var messageShouldBeUpdated = messagesMap[channelId][messageId];
|
|
10962
10986
|
if (messageShouldBeUpdated) {
|
|
10963
10987
|
var statusUpdatedMessage = updateMessageDeliveryStatusAndMarkers(messageShouldBeUpdated, newMarkers.name);
|
|
10988
|
+
if (messageShouldBeUpdated.tid && messagesMap[channelId][messageShouldBeUpdated.tid]) {
|
|
10989
|
+
delete messagesMap[channelId][messageShouldBeUpdated.tid];
|
|
10990
|
+
}
|
|
10964
10991
|
messagesMap[channelId][messageId] = _extends({}, messageShouldBeUpdated, statusUpdatedMessage);
|
|
10965
10992
|
}
|
|
10966
10993
|
});
|
|
@@ -10994,13 +11021,6 @@ function clearMessagesMap() {
|
|
|
10994
11021
|
function checkChannelExistsOnMessagesMap(channelId) {
|
|
10995
11022
|
return !!messagesMap[channelId];
|
|
10996
11023
|
}
|
|
10997
|
-
var pendingVideoAttachmentsThumbs = {};
|
|
10998
|
-
var getVideoThumb = function getVideoThumb(attachmentId) {
|
|
10999
|
-
return pendingVideoAttachmentsThumbs[attachmentId];
|
|
11000
|
-
};
|
|
11001
|
-
var deleteVideoThumb = function deleteVideoThumb(attachmentId) {
|
|
11002
|
-
delete pendingVideoAttachmentsThumbs[attachmentId];
|
|
11003
|
-
};
|
|
11004
11024
|
var setPendingAttachment = function setPendingAttachment(attachmentId, data) {
|
|
11005
11025
|
pendingAttachments[attachmentId] = _extends({}, pendingAttachments[attachmentId], data);
|
|
11006
11026
|
};
|
|
@@ -16205,7 +16225,7 @@ function getChannels(action) {
|
|
|
16205
16225
|
case 23:
|
|
16206
16226
|
_context2.p = 23;
|
|
16207
16227
|
_t4 = _context2.v;
|
|
16208
|
-
log.error(_t4, 'Error on get channels');
|
|
16228
|
+
log.error(JSON.stringify(_t4), 'Error on get channels');
|
|
16209
16229
|
case 24:
|
|
16210
16230
|
return _context2.a(2);
|
|
16211
16231
|
}
|
|
@@ -18381,7 +18401,7 @@ var base64ToBinary = function base64ToBinary(base64) {
|
|
|
18381
18401
|
var binaryThumbHashToDataURL = function binaryThumbHashToDataURL(binaryThumbHash) {
|
|
18382
18402
|
return thumbHashToDataURL(binaryThumbHash);
|
|
18383
18403
|
};
|
|
18384
|
-
var
|
|
18404
|
+
var base64ToDataURL = function base64ToDataURL(base64) {
|
|
18385
18405
|
try {
|
|
18386
18406
|
var thumbHashFromBase64 = base64ToBinary(base64);
|
|
18387
18407
|
if (thumbHashFromBase64.length === 0) {
|
|
@@ -18455,106 +18475,6 @@ function calculateSize(width, height, maxWidth, maxHeight) {
|
|
|
18455
18475
|
return [width, height];
|
|
18456
18476
|
}
|
|
18457
18477
|
|
|
18458
|
-
var activeChannelMessagesSelector = function activeChannelMessagesSelector(store) {
|
|
18459
|
-
return store.MessageReducer.activeChannelMessages;
|
|
18460
|
-
};
|
|
18461
|
-
var messagesLoadingState = function messagesLoadingState(store) {
|
|
18462
|
-
return store.MessageReducer.messagesLoadingState;
|
|
18463
|
-
};
|
|
18464
|
-
var messagesHasNextSelector = function messagesHasNextSelector(store) {
|
|
18465
|
-
return store.MessageReducer.messagesHasNext;
|
|
18466
|
-
};
|
|
18467
|
-
var messagesHasPrevSelector = function messagesHasPrevSelector(store) {
|
|
18468
|
-
return store.MessageReducer.messagesHasPrev;
|
|
18469
|
-
};
|
|
18470
|
-
var attachmentCompilationStateSelector = function attachmentCompilationStateSelector(store) {
|
|
18471
|
-
return store.MessageReducer.attachmentsUploadingState;
|
|
18472
|
-
};
|
|
18473
|
-
var attachmentsUploadProgressSelector = function attachmentsUploadProgressSelector(store) {
|
|
18474
|
-
return store.MessageReducer.attachmentsUploadingProgress;
|
|
18475
|
-
};
|
|
18476
|
-
var activeTabAttachmentsSelector = function activeTabAttachmentsSelector(store) {
|
|
18477
|
-
return store.MessageReducer.activeTabAttachments;
|
|
18478
|
-
};
|
|
18479
|
-
var activeTabAttachmentsHasNextSelector = function activeTabAttachmentsHasNextSelector(store) {
|
|
18480
|
-
return store.MessageReducer.attachmentHasNext;
|
|
18481
|
-
};
|
|
18482
|
-
var attachmentsForPopupSelector = function attachmentsForPopupSelector(store) {
|
|
18483
|
-
return store.MessageReducer.attachmentsForPopup;
|
|
18484
|
-
};
|
|
18485
|
-
var messageForReplySelector = function messageForReplySelector(store) {
|
|
18486
|
-
return store.MessageReducer.messageForReply;
|
|
18487
|
-
};
|
|
18488
|
-
var messageToEditSelector = function messageToEditSelector(store) {
|
|
18489
|
-
return store.MessageReducer.messageToEdit;
|
|
18490
|
-
};
|
|
18491
|
-
var scrollToNewMessageSelector = function scrollToNewMessageSelector(store) {
|
|
18492
|
-
return store.MessageReducer.scrollToNewMessage;
|
|
18493
|
-
};
|
|
18494
|
-
var scrollToMentionedMessageSelector = function scrollToMentionedMessageSelector(store) {
|
|
18495
|
-
return store.MessageReducer.scrollToMentionedMessage;
|
|
18496
|
-
};
|
|
18497
|
-
var showScrollToNewMessageButtonSelector = function showScrollToNewMessageButtonSelector(store) {
|
|
18498
|
-
return store.MessageReducer.showScrollToNewMessageButton;
|
|
18499
|
-
};
|
|
18500
|
-
var sendMessageInputHeightSelector = function sendMessageInputHeightSelector(store) {
|
|
18501
|
-
return store.MessageReducer.sendMessageInputHeight;
|
|
18502
|
-
};
|
|
18503
|
-
var scrollToMessageSelector = function scrollToMessageSelector(store) {
|
|
18504
|
-
return store.MessageReducer.scrollToMessage;
|
|
18505
|
-
};
|
|
18506
|
-
var scrollToMessageHighlightSelector = function scrollToMessageHighlightSelector(store) {
|
|
18507
|
-
return store.MessageReducer.scrollToMessageHighlight;
|
|
18508
|
-
};
|
|
18509
|
-
var scrollToMessageBehaviorSelector = function scrollToMessageBehaviorSelector(store) {
|
|
18510
|
-
return store.MessageReducer.scrollToMessageBehavior;
|
|
18511
|
-
};
|
|
18512
|
-
var reactionsListSelector = function reactionsListSelector(store) {
|
|
18513
|
-
return store.MessageReducer.reactionsList;
|
|
18514
|
-
};
|
|
18515
|
-
var reactionsHasNextSelector = function reactionsHasNextSelector(store) {
|
|
18516
|
-
return store.MessageReducer.reactionsHasNext;
|
|
18517
|
-
};
|
|
18518
|
-
var reactionsLoadingStateSelector = function reactionsLoadingStateSelector(store) {
|
|
18519
|
-
return store.MessageReducer.reactionsLoadingState;
|
|
18520
|
-
};
|
|
18521
|
-
var openedMessageMenuSelector = function openedMessageMenuSelector(store) {
|
|
18522
|
-
return store.MessageReducer.openedMessageMenu;
|
|
18523
|
-
};
|
|
18524
|
-
var playingAudioIdSelector = function playingAudioIdSelector(store) {
|
|
18525
|
-
return store.MessageReducer.playingAudioId;
|
|
18526
|
-
};
|
|
18527
|
-
var selectedMessagesMapSelector = function selectedMessagesMapSelector(store) {
|
|
18528
|
-
return store.MessageReducer.selectedMessagesMap;
|
|
18529
|
-
};
|
|
18530
|
-
var attachmentUpdatedMapSelector = function attachmentUpdatedMapSelector(store) {
|
|
18531
|
-
return store.MessageReducer.attachmentUpdatedMap;
|
|
18532
|
-
};
|
|
18533
|
-
var messageMarkersSelector = function messageMarkersSelector(store) {
|
|
18534
|
-
return store.MessageReducer.messageMarkers;
|
|
18535
|
-
};
|
|
18536
|
-
var messagesMarkersLoadingStateSelector = function messagesMarkersLoadingStateSelector(store) {
|
|
18537
|
-
return store.MessageReducer.messagesMarkersLoadingState;
|
|
18538
|
-
};
|
|
18539
|
-
var pollVotesListSelector = function pollVotesListSelector(store) {
|
|
18540
|
-
return store.MessageReducer.pollVotesList;
|
|
18541
|
-
};
|
|
18542
|
-
var pollVotesHasMoreSelector = function pollVotesHasMoreSelector(store) {
|
|
18543
|
-
return store.MessageReducer.pollVotesHasMore;
|
|
18544
|
-
};
|
|
18545
|
-
var pollVotesLoadingStateSelector = function pollVotesLoadingStateSelector(store) {
|
|
18546
|
-
return store.MessageReducer.pollVotesLoadingState;
|
|
18547
|
-
};
|
|
18548
|
-
var pendingPollActionsSelector = function pendingPollActionsSelector(store) {
|
|
18549
|
-
return store.MessageReducer.pendingPollActions;
|
|
18550
|
-
};
|
|
18551
|
-
var pendingMessagesMapSelector = function pendingMessagesMapSelector(store) {
|
|
18552
|
-
return store.MessageReducer.pendingMessagesMap;
|
|
18553
|
-
};
|
|
18554
|
-
var unreadScrollToSelector = function unreadScrollToSelector(store) {
|
|
18555
|
-
return store.MessageReducer.unreadScrollTo;
|
|
18556
|
-
};
|
|
18557
|
-
|
|
18558
18478
|
var getFrame = function getFrame(videoSrc, time) {
|
|
18559
18479
|
try {
|
|
18560
18480
|
var video = document.createElement('video');
|
|
@@ -18724,28 +18644,43 @@ var handleUploadAttachments = function handleUploadAttachments(attachments, mess
|
|
|
18724
18644
|
};
|
|
18725
18645
|
var addPendingMessage = function addPendingMessage(message, messageCopy, channel) {
|
|
18726
18646
|
try {
|
|
18727
|
-
var messageToAdd =
|
|
18647
|
+
var messageToAdd = _extends({}, messageCopy, {
|
|
18728
18648
|
createdAt: new Date(Date.now()),
|
|
18729
18649
|
mentionedUsers: message.mentionedUsers,
|
|
18730
18650
|
parentMessage: message.parentMessage
|
|
18731
|
-
})
|
|
18651
|
+
});
|
|
18732
18652
|
addMessageToMap(channel.id, messageToAdd);
|
|
18733
|
-
|
|
18653
|
+
var activeChannelId = getActiveChannelId();
|
|
18654
|
+
if (activeChannelId === channel.id) {
|
|
18655
|
+
addAllMessages([messageToAdd], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
18656
|
+
}
|
|
18734
18657
|
setPendingMessage(channel.id, messageToAdd);
|
|
18735
18658
|
store.dispatch(scrollToNewMessageAC(true));
|
|
18736
|
-
|
|
18659
|
+
if (activeChannelId === channel.id) {
|
|
18660
|
+
store.dispatch(addMessageAC(messageToAdd));
|
|
18661
|
+
}
|
|
18737
18662
|
return Promise.resolve();
|
|
18738
18663
|
} catch (e) {
|
|
18739
18664
|
return Promise.reject(e);
|
|
18740
18665
|
}
|
|
18741
18666
|
};
|
|
18667
|
+
var updatePendingMessage$1 = function updatePendingMessage(message, channel, updatedMessage) {
|
|
18668
|
+
var messageToUpdate = _extends({}, message, updatedMessage);
|
|
18669
|
+
updateMessageOnMap(channel.id, {
|
|
18670
|
+
messageId: message.tid,
|
|
18671
|
+
params: messageToUpdate
|
|
18672
|
+
});
|
|
18673
|
+
updateMessageOnAllMessages(message.tid, messageToUpdate);
|
|
18674
|
+
updatePendingMessageOnMap(channel.id, message.tid, messageToUpdate);
|
|
18675
|
+
store.dispatch(updateMessageAC(message.tid, messageToUpdate, false));
|
|
18676
|
+
};
|
|
18742
18677
|
function sendMessage(action) {
|
|
18743
|
-
var payload, message, connectionState, channelId, sendAttachmentsAsSeparateMessage, channel, SceytChatClient, createChannelData, mentionedUserIds, customUploader, linkAttachment, attachmentsToSend, messagesToSend, mediaAttachments, _loop, i, messageBuilder, messageToSend, messageCopy, _loop2, _i, _t2;
|
|
18678
|
+
var payload, message, connectionState, channelId, sendAttachmentsAsSeparateMessage, isAddToPendingMessagesMap, channel, SceytChatClient, createChannelData, mentionedUserIds, customUploader, linkAttachment, attachmentsToSend, messagesToSend, mediaAttachments, _loop, i, messageBuilder, messageToSend, messageCopy, _loop2, _i, _t2;
|
|
18744
18679
|
return _regenerator().w(function (_context3) {
|
|
18745
18680
|
while (1) switch (_context3.p = _context3.n) {
|
|
18746
18681
|
case 0:
|
|
18747
18682
|
payload = action.payload;
|
|
18748
|
-
message = payload.message, connectionState = payload.connectionState, channelId = payload.channelId, sendAttachmentsAsSeparateMessage = payload.sendAttachmentsAsSeparateMessage;
|
|
18683
|
+
message = payload.message, connectionState = payload.connectionState, channelId = payload.channelId, sendAttachmentsAsSeparateMessage = payload.sendAttachmentsAsSeparateMessage, isAddToPendingMessagesMap = payload.isAddToPendingMessagesMap;
|
|
18749
18684
|
_context3.p = 1;
|
|
18750
18685
|
_context3.n = 2;
|
|
18751
18686
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
@@ -18789,7 +18724,7 @@ function sendMessage(action) {
|
|
|
18789
18724
|
}) : [];
|
|
18790
18725
|
customUploader = getCustomUploader();
|
|
18791
18726
|
if (!(message.attachments && message.attachments.length)) {
|
|
18792
|
-
_context3.n =
|
|
18727
|
+
_context3.n = 22;
|
|
18793
18728
|
break;
|
|
18794
18729
|
}
|
|
18795
18730
|
linkAttachment = null;
|
|
@@ -18802,7 +18737,7 @@ function sendMessage(action) {
|
|
|
18802
18737
|
return att.type !== attachmentTypes.link;
|
|
18803
18738
|
});
|
|
18804
18739
|
if (!(mediaAttachments && mediaAttachments.length)) {
|
|
18805
|
-
_context3.n =
|
|
18740
|
+
_context3.n = 18;
|
|
18806
18741
|
break;
|
|
18807
18742
|
}
|
|
18808
18743
|
_loop = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
@@ -18843,7 +18778,9 @@ function sendMessage(action) {
|
|
|
18843
18778
|
}
|
|
18844
18779
|
};
|
|
18845
18780
|
} else if (customUploader && attachment) {
|
|
18846
|
-
attachment
|
|
18781
|
+
attachment = _extends({}, attachment, {
|
|
18782
|
+
url: attachment.data
|
|
18783
|
+
});
|
|
18847
18784
|
}
|
|
18848
18785
|
messageAttachment.tid = attachment.tid;
|
|
18849
18786
|
messageAttachment.attachmentUrl = attachment.attachmentUrl;
|
|
@@ -18851,7 +18788,7 @@ function sendMessage(action) {
|
|
|
18851
18788
|
messageAttachment.url = attachment.data;
|
|
18852
18789
|
}
|
|
18853
18790
|
if (!sendAttachmentsAsSeparateMessage) {
|
|
18854
|
-
_context.n =
|
|
18791
|
+
_context.n = 4;
|
|
18855
18792
|
break;
|
|
18856
18793
|
}
|
|
18857
18794
|
_messageBuilder = channel.createMessageBuilder();
|
|
@@ -18871,22 +18808,34 @@ function sendMessage(action) {
|
|
|
18871
18808
|
attachments: [messageAttachment]
|
|
18872
18809
|
});
|
|
18873
18810
|
messagesToSend.push(messageForSend);
|
|
18874
|
-
messageForSendCopy =
|
|
18811
|
+
messageForSendCopy = messageForSend;
|
|
18812
|
+
if (!isAddToPendingMessagesMap) {
|
|
18813
|
+
_context.n = 2;
|
|
18814
|
+
break;
|
|
18815
|
+
}
|
|
18875
18816
|
_context.n = 1;
|
|
18876
|
-
return call(addPendingMessage, message, messageForSendCopy,
|
|
18817
|
+
return call(addPendingMessage, message, _extends({}, messageForSendCopy, {
|
|
18818
|
+
attachments: [attachment]
|
|
18819
|
+
}), channel);
|
|
18877
18820
|
case 1:
|
|
18878
18821
|
_context.n = 3;
|
|
18879
18822
|
break;
|
|
18880
18823
|
case 2:
|
|
18881
|
-
|
|
18824
|
+
_context.n = 3;
|
|
18825
|
+
return call(updatePendingMessage$1, message, channel, messageForSendCopy);
|
|
18882
18826
|
case 3:
|
|
18827
|
+
_context.n = 5;
|
|
18828
|
+
break;
|
|
18829
|
+
case 4:
|
|
18830
|
+
attachmentsToSend.push(messageAttachment);
|
|
18831
|
+
case 5:
|
|
18883
18832
|
if (!(!messageAttachment.cachedUrl && customUploader)) {
|
|
18884
|
-
_context.n =
|
|
18833
|
+
_context.n = 6;
|
|
18885
18834
|
break;
|
|
18886
18835
|
}
|
|
18887
|
-
_context.n =
|
|
18836
|
+
_context.n = 6;
|
|
18888
18837
|
return put(updateAttachmentUploadingStateAC(UPLOAD_STATE.UPLOADING, messageAttachment.tid));
|
|
18889
|
-
case
|
|
18838
|
+
case 6:
|
|
18890
18839
|
return _context.a(2);
|
|
18891
18840
|
}
|
|
18892
18841
|
}, _callee);
|
|
@@ -18904,7 +18853,7 @@ function sendMessage(action) {
|
|
|
18904
18853
|
break;
|
|
18905
18854
|
case 10:
|
|
18906
18855
|
if (sendAttachmentsAsSeparateMessage) {
|
|
18907
|
-
_context3.n =
|
|
18856
|
+
_context3.n = 18;
|
|
18908
18857
|
break;
|
|
18909
18858
|
}
|
|
18910
18859
|
messageBuilder = channel.createMessageBuilder();
|
|
@@ -18916,27 +18865,53 @@ function sendMessage(action) {
|
|
|
18916
18865
|
messageBuilder.setReplyInThread();
|
|
18917
18866
|
}
|
|
18918
18867
|
messageToSend = messageBuilder.create();
|
|
18919
|
-
messageCopy =
|
|
18868
|
+
messageCopy = messageToSend;
|
|
18920
18869
|
if (!customUploader) {
|
|
18921
|
-
_context3.n =
|
|
18870
|
+
_context3.n = 14;
|
|
18922
18871
|
break;
|
|
18923
18872
|
}
|
|
18924
18873
|
if (sendAttachmentsAsSeparateMessage) {
|
|
18925
|
-
_context3.n =
|
|
18874
|
+
_context3.n = 13;
|
|
18875
|
+
break;
|
|
18876
|
+
}
|
|
18877
|
+
if (!isAddToPendingMessagesMap) {
|
|
18878
|
+
_context3.n = 12;
|
|
18926
18879
|
break;
|
|
18927
18880
|
}
|
|
18928
18881
|
_context3.n = 11;
|
|
18929
|
-
return call(addPendingMessage, message, messageCopy,
|
|
18882
|
+
return call(addPendingMessage, message, _extends({}, messageCopy, {
|
|
18883
|
+
attachments: message.attachments
|
|
18884
|
+
}), channel);
|
|
18930
18885
|
case 11:
|
|
18931
18886
|
_context3.n = 13;
|
|
18932
18887
|
break;
|
|
18933
18888
|
case 12:
|
|
18934
|
-
|
|
18935
|
-
return call(addPendingMessage, message, messageCopy, channel);
|
|
18889
|
+
updatePendingMessage$1(message, channel, messageCopy);
|
|
18936
18890
|
case 13:
|
|
18891
|
+
_context3.n = 17;
|
|
18892
|
+
break;
|
|
18893
|
+
case 14:
|
|
18894
|
+
if (!isAddToPendingMessagesMap) {
|
|
18895
|
+
_context3.n = 16;
|
|
18896
|
+
break;
|
|
18897
|
+
}
|
|
18898
|
+
_context3.n = 15;
|
|
18899
|
+
return call(addPendingMessage, message, messageCopy, channel);
|
|
18900
|
+
case 15:
|
|
18901
|
+
_context3.n = 17;
|
|
18902
|
+
break;
|
|
18903
|
+
case 16:
|
|
18904
|
+
updatePendingMessage$1(message, channel, messageCopy);
|
|
18905
|
+
case 17:
|
|
18937
18906
|
messageToSend.attachments = attachmentsToSend;
|
|
18938
18907
|
messagesToSend.push(messageToSend);
|
|
18939
|
-
case
|
|
18908
|
+
case 18:
|
|
18909
|
+
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
18910
|
+
_context3.n = 19;
|
|
18911
|
+
break;
|
|
18912
|
+
}
|
|
18913
|
+
throw new Error('Connection is required to send message');
|
|
18914
|
+
case 19:
|
|
18940
18915
|
_loop2 = /*#__PURE__*/_regenerator().m(function _callee2() {
|
|
18941
18916
|
var messageAttachment, messageToSend, _messageCopy, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, messageToUpdate, channelUpdateParam, _t;
|
|
18942
18917
|
return _regenerator().w(function (_context2) {
|
|
@@ -19004,6 +18979,9 @@ function sendMessage(action) {
|
|
|
19004
18979
|
_context2.n = 5;
|
|
19005
18980
|
break;
|
|
19006
18981
|
case 8:
|
|
18982
|
+
if (!isAddToPendingMessagesMap) {
|
|
18983
|
+
store.dispatch(removePendingMessageAC(channel.id, messageToSend.tid));
|
|
18984
|
+
}
|
|
19007
18985
|
attachmentsToUpdate = [];
|
|
19008
18986
|
if (messageResponse.attachments && messageResponse.attachments.length > 0) {
|
|
19009
18987
|
currentAttachmentsMap = {};
|
|
@@ -19098,35 +19076,35 @@ function sendMessage(action) {
|
|
|
19098
19076
|
}, _callee2, null, [[1, 14]]);
|
|
19099
19077
|
});
|
|
19100
19078
|
_i = 0;
|
|
19101
|
-
case
|
|
19079
|
+
case 20:
|
|
19102
19080
|
if (!(_i < messagesToSend.length)) {
|
|
19103
|
-
_context3.n =
|
|
19081
|
+
_context3.n = 22;
|
|
19104
19082
|
break;
|
|
19105
19083
|
}
|
|
19106
|
-
return _context3.d(_regeneratorValues(_loop2()),
|
|
19107
|
-
case
|
|
19084
|
+
return _context3.d(_regeneratorValues(_loop2()), 21);
|
|
19085
|
+
case 21:
|
|
19108
19086
|
_i++;
|
|
19109
|
-
_context3.n =
|
|
19087
|
+
_context3.n = 20;
|
|
19110
19088
|
break;
|
|
19111
|
-
case
|
|
19112
|
-
_context3.n =
|
|
19089
|
+
case 22:
|
|
19090
|
+
_context3.n = 24;
|
|
19113
19091
|
break;
|
|
19114
|
-
case
|
|
19115
|
-
_context3.p =
|
|
19092
|
+
case 23:
|
|
19093
|
+
_context3.p = 23;
|
|
19116
19094
|
_t2 = _context3.v;
|
|
19117
19095
|
log.error('error on send message ... ', _t2);
|
|
19118
|
-
case
|
|
19096
|
+
case 24:
|
|
19119
19097
|
return _context3.a(2);
|
|
19120
19098
|
}
|
|
19121
|
-
}, _marked$3, null, [[1,
|
|
19099
|
+
}, _marked$3, null, [[1, 23]]);
|
|
19122
19100
|
}
|
|
19123
19101
|
function sendTextMessage(action) {
|
|
19124
|
-
var payload, message, connectionState, channelId, channel, sendMessageTid, activeChannelId, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, _messageResponse, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t3;
|
|
19102
|
+
var payload, message, connectionState, channelId, isAddToPendingMessagesMap, channel, sendMessageTid, activeChannelId, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, _messageResponse, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t3;
|
|
19125
19103
|
return _regenerator().w(function (_context4) {
|
|
19126
19104
|
while (1) switch (_context4.p = _context4.n) {
|
|
19127
19105
|
case 0:
|
|
19128
19106
|
payload = action.payload;
|
|
19129
|
-
message = payload.message, connectionState = payload.connectionState, channelId = payload.channelId;
|
|
19107
|
+
message = payload.message, connectionState = payload.connectionState, channelId = payload.channelId, isAddToPendingMessagesMap = payload.isAddToPendingMessagesMap;
|
|
19130
19108
|
_context4.n = 1;
|
|
19131
19109
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
19132
19110
|
case 1:
|
|
@@ -19194,32 +19172,41 @@ function sendTextMessage(action) {
|
|
|
19194
19172
|
pendingMessage.metadata = JSON.parse(pendingMessage.metadata);
|
|
19195
19173
|
}
|
|
19196
19174
|
if (!(activeChannelId === channel.id)) {
|
|
19197
|
-
_context4.n =
|
|
19175
|
+
_context4.n = 10;
|
|
19176
|
+
break;
|
|
19177
|
+
}
|
|
19178
|
+
if (!isAddToPendingMessagesMap) {
|
|
19179
|
+
_context4.n = 9;
|
|
19198
19180
|
break;
|
|
19199
19181
|
}
|
|
19200
19182
|
_context4.n = 8;
|
|
19201
19183
|
return call(addPendingMessage, message, pendingMessage, channel);
|
|
19202
19184
|
case 8:
|
|
19185
|
+
_context4.n = 10;
|
|
19186
|
+
break;
|
|
19187
|
+
case 9:
|
|
19188
|
+
updatePendingMessage$1(message, channel, pendingMessage);
|
|
19189
|
+
case 10:
|
|
19203
19190
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19204
|
-
_context4.n =
|
|
19191
|
+
_context4.n = 18;
|
|
19205
19192
|
break;
|
|
19206
19193
|
}
|
|
19207
19194
|
if (!sendMessageHandler) {
|
|
19208
|
-
_context4.n =
|
|
19195
|
+
_context4.n = 12;
|
|
19209
19196
|
break;
|
|
19210
19197
|
}
|
|
19211
|
-
_context4.n =
|
|
19198
|
+
_context4.n = 11;
|
|
19212
19199
|
return call(sendMessageHandler, messageToSend, channel.id);
|
|
19213
|
-
case
|
|
19200
|
+
case 11:
|
|
19214
19201
|
messageResponse = _context4.v;
|
|
19215
|
-
_context4.n =
|
|
19202
|
+
_context4.n = 14;
|
|
19216
19203
|
break;
|
|
19217
|
-
case
|
|
19218
|
-
_context4.n =
|
|
19204
|
+
case 12:
|
|
19205
|
+
_context4.n = 13;
|
|
19219
19206
|
return call(channel.sendMessage, messageToSend);
|
|
19220
|
-
case
|
|
19207
|
+
case 13:
|
|
19221
19208
|
messageResponse = _context4.v;
|
|
19222
|
-
case
|
|
19209
|
+
case 14:
|
|
19223
19210
|
messageUpdateData = {
|
|
19224
19211
|
id: messageResponse.id,
|
|
19225
19212
|
body: messageResponse.body,
|
|
@@ -19238,12 +19225,12 @@ function sendTextMessage(action) {
|
|
|
19238
19225
|
channelId: channel.id
|
|
19239
19226
|
};
|
|
19240
19227
|
if (!(activeChannelId === channel.id)) {
|
|
19241
|
-
_context4.n =
|
|
19228
|
+
_context4.n = 15;
|
|
19242
19229
|
break;
|
|
19243
19230
|
}
|
|
19244
|
-
_context4.n =
|
|
19231
|
+
_context4.n = 15;
|
|
19245
19232
|
return put(updateMessageAC(messageToSend.tid, messageUpdateData));
|
|
19246
|
-
case
|
|
19233
|
+
case 15:
|
|
19247
19234
|
updateMessageOnMap(channel.id, {
|
|
19248
19235
|
messageId: messageToSend.tid,
|
|
19249
19236
|
params: messageUpdateData
|
|
@@ -19257,30 +19244,33 @@ function sendTextMessage(action) {
|
|
|
19257
19244
|
lastMessage: messageToUpdate,
|
|
19258
19245
|
lastReactedMessage: null
|
|
19259
19246
|
};
|
|
19260
|
-
_context4.n =
|
|
19247
|
+
_context4.n = 16;
|
|
19261
19248
|
return put(updateChannelDataAC(channel.id, channelUpdateParam, true));
|
|
19262
|
-
case
|
|
19249
|
+
case 16:
|
|
19263
19250
|
updateChannelOnAllChannels(channel.id, channelUpdateParam);
|
|
19264
19251
|
if (!channel.unread) {
|
|
19265
|
-
_context4.n =
|
|
19252
|
+
_context4.n = 17;
|
|
19266
19253
|
break;
|
|
19267
19254
|
}
|
|
19268
|
-
_context4.n =
|
|
19255
|
+
_context4.n = 17;
|
|
19269
19256
|
return put(markChannelAsReadAC(channel.id));
|
|
19270
|
-
case
|
|
19257
|
+
case 17:
|
|
19271
19258
|
channel.lastMessage = messageToUpdate;
|
|
19272
|
-
|
|
19259
|
+
if (!isAddToPendingMessagesMap) {
|
|
19260
|
+
store.dispatch(removePendingMessageAC(channel.id, messageToSend.tid));
|
|
19261
|
+
}
|
|
19262
|
+
_context4.n = 19;
|
|
19273
19263
|
break;
|
|
19274
|
-
case
|
|
19264
|
+
case 18:
|
|
19275
19265
|
throw new Error('Connection required to send message');
|
|
19276
|
-
case
|
|
19277
|
-
_context4.n =
|
|
19266
|
+
case 19:
|
|
19267
|
+
_context4.n = 20;
|
|
19278
19268
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19279
|
-
case
|
|
19280
|
-
_context4.n =
|
|
19269
|
+
case 20:
|
|
19270
|
+
_context4.n = 23;
|
|
19281
19271
|
break;
|
|
19282
|
-
case
|
|
19283
|
-
_context4.p =
|
|
19272
|
+
case 21:
|
|
19273
|
+
_context4.p = 21;
|
|
19284
19274
|
_t3 = _context4.v;
|
|
19285
19275
|
log.error('error on send text message ... ', _t3);
|
|
19286
19276
|
updateMessageOnMap(channel.id, {
|
|
@@ -19290,32 +19280,32 @@ function sendTextMessage(action) {
|
|
|
19290
19280
|
}
|
|
19291
19281
|
});
|
|
19292
19282
|
if (!(activeChannelId === channel.id)) {
|
|
19293
|
-
_context4.n =
|
|
19283
|
+
_context4.n = 22;
|
|
19294
19284
|
break;
|
|
19295
19285
|
}
|
|
19296
19286
|
updateMessageOnAllMessages(sendMessageTid, {
|
|
19297
19287
|
state: MESSAGE_STATUS.FAILED
|
|
19298
19288
|
});
|
|
19299
|
-
_context4.n =
|
|
19289
|
+
_context4.n = 22;
|
|
19300
19290
|
return put(updateMessageAC(sendMessageTid, {
|
|
19301
19291
|
state: MESSAGE_STATUS.FAILED
|
|
19302
19292
|
}));
|
|
19303
|
-
case
|
|
19304
|
-
_context4.n =
|
|
19293
|
+
case 22:
|
|
19294
|
+
_context4.n = 23;
|
|
19305
19295
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19306
|
-
case
|
|
19296
|
+
case 23:
|
|
19307
19297
|
return _context4.a(2);
|
|
19308
19298
|
}
|
|
19309
|
-
}, _marked2$2, null, [[3,
|
|
19299
|
+
}, _marked2$2, null, [[3, 21]]);
|
|
19310
19300
|
}
|
|
19311
19301
|
function forwardMessage(action) {
|
|
19312
|
-
var payload, message, channelId, connectionState, isForward, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, pollDetails, messageToSend, pendingMessage, activeChannelId,
|
|
19302
|
+
var payload, message, channelId, connectionState, isForward, isAddToPendingMessagesMap, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, pollDetails, messageToSend, pendingMessage, activeChannelId, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t4;
|
|
19313
19303
|
return _regenerator().w(function (_context5) {
|
|
19314
19304
|
while (1) switch (_context5.p = _context5.n) {
|
|
19315
19305
|
case 0:
|
|
19316
19306
|
_context5.p = 0;
|
|
19317
19307
|
payload = action.payload;
|
|
19318
|
-
message = payload.message, channelId = payload.channelId, connectionState = payload.connectionState, isForward = payload.isForward;
|
|
19308
|
+
message = payload.message, channelId = payload.channelId, connectionState = payload.connectionState, isForward = payload.isForward, isAddToPendingMessagesMap = payload.isAddToPendingMessagesMap;
|
|
19319
19309
|
_context5.n = 1;
|
|
19320
19310
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
19321
19311
|
case 1:
|
|
@@ -19350,7 +19340,7 @@ function forwardMessage(action) {
|
|
|
19350
19340
|
}) : [];
|
|
19351
19341
|
attachments = message.attachments;
|
|
19352
19342
|
if ((channel.type === DEFAULT_CHANNEL_TYPE.BROADCAST || channel.type === DEFAULT_CHANNEL_TYPE.PUBLIC) && !(channel.userRole === 'admin' || channel.userRole === 'owner')) {
|
|
19353
|
-
_context5.n =
|
|
19343
|
+
_context5.n = 16;
|
|
19354
19344
|
break;
|
|
19355
19345
|
}
|
|
19356
19346
|
if (message.attachments && message.attachments.length) {
|
|
@@ -19378,9 +19368,9 @@ function forwardMessage(action) {
|
|
|
19378
19368
|
}
|
|
19379
19369
|
messageBuilder.setBody(message.body).setBodyAttributes(message.bodyAttributes).setAttachments(attachments).setMentionUserIds(mentionedUserIds).setType(message.type).setDisableMentionsCount(getDisableFrowardMentionsCount()).setMetadata(message.metadata ? JSON.stringify(message.metadata) : '').setForwardingMessageId(message.forwardingDetails ? message.forwardingDetails.messageId : message.id).setPollDetails(pollDetails);
|
|
19380
19370
|
messageToSend = messageBuilder.create();
|
|
19381
|
-
pendingMessage =
|
|
19371
|
+
pendingMessage = _extends({}, messageToSend, {
|
|
19382
19372
|
createdAt: new Date(Date.now())
|
|
19383
|
-
})
|
|
19373
|
+
});
|
|
19384
19374
|
if (isForward) {
|
|
19385
19375
|
if (message.forwardingDetails) {
|
|
19386
19376
|
pendingMessage.forwardingDetails.user = message.forwardingDetails.user;
|
|
@@ -19392,50 +19382,42 @@ function forwardMessage(action) {
|
|
|
19392
19382
|
pendingMessage.forwardingDetails.hops = message.forwardingDetails ? message.forwardingDetails.hops : 1;
|
|
19393
19383
|
}
|
|
19394
19384
|
activeChannelId = getActiveChannelId();
|
|
19395
|
-
isCachedChannel = checkChannelExistsOnMessagesMap(channelId);
|
|
19396
19385
|
if (!(channelId === activeChannelId)) {
|
|
19397
|
-
_context5.n =
|
|
19386
|
+
_context5.n = 7;
|
|
19398
19387
|
break;
|
|
19399
19388
|
}
|
|
19400
19389
|
hasNextMessages = store.getState().MessageReducer.messagesHasNext;
|
|
19401
19390
|
if (getHasNextCached()) {
|
|
19402
|
-
_context5.n =
|
|
19391
|
+
_context5.n = 7;
|
|
19403
19392
|
break;
|
|
19404
19393
|
}
|
|
19405
19394
|
if (!hasNextMessages) {
|
|
19406
|
-
_context5.n =
|
|
19395
|
+
_context5.n = 7;
|
|
19407
19396
|
break;
|
|
19408
19397
|
}
|
|
19409
19398
|
_context5.n = 7;
|
|
19410
19399
|
return put(getMessagesAC(channel));
|
|
19411
19400
|
case 7:
|
|
19412
|
-
|
|
19413
|
-
|
|
19401
|
+
if (!isAddToPendingMessagesMap) {
|
|
19402
|
+
_context5.n = 9;
|
|
19403
|
+
break;
|
|
19404
|
+
}
|
|
19405
|
+
_context5.n = 8;
|
|
19406
|
+
return call(addPendingMessage, message, pendingMessage, channel);
|
|
19414
19407
|
case 8:
|
|
19415
|
-
_context5.n =
|
|
19416
|
-
|
|
19408
|
+
_context5.n = 10;
|
|
19409
|
+
break;
|
|
19417
19410
|
case 9:
|
|
19418
|
-
addMessageToMap(channelId, pendingMessage);
|
|
19419
|
-
addAllMessages([pendingMessage], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
19420
19411
|
_context5.n = 10;
|
|
19421
|
-
return
|
|
19412
|
+
return call(updatePendingMessage$1, message, channel, pendingMessage);
|
|
19422
19413
|
case 10:
|
|
19423
|
-
_context5.n = 12;
|
|
19424
|
-
break;
|
|
19425
|
-
case 11:
|
|
19426
|
-
if (isCachedChannel) {
|
|
19427
|
-
addMessageToMap(channelId, pendingMessage);
|
|
19428
|
-
} else {
|
|
19429
|
-
setPendingMessage(channelId, pendingMessage);
|
|
19430
|
-
}
|
|
19431
|
-
case 12:
|
|
19432
19414
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19433
|
-
_context5.n =
|
|
19415
|
+
_context5.n = 16;
|
|
19434
19416
|
break;
|
|
19435
19417
|
}
|
|
19436
|
-
_context5.n =
|
|
19418
|
+
_context5.n = 11;
|
|
19437
19419
|
return call(channel.sendMessage, messageToSend);
|
|
19438
|
-
case
|
|
19420
|
+
case 11:
|
|
19439
19421
|
messageResponse = _context5.v;
|
|
19440
19422
|
messageUpdateData = {
|
|
19441
19423
|
id: messageResponse.id,
|
|
@@ -19452,409 +19434,75 @@ function forwardMessage(action) {
|
|
|
19452
19434
|
channelId: channel.id
|
|
19453
19435
|
};
|
|
19454
19436
|
if (!(channelId === activeChannelId)) {
|
|
19455
|
-
_context5.n =
|
|
19437
|
+
_context5.n = 13;
|
|
19456
19438
|
break;
|
|
19457
19439
|
}
|
|
19458
|
-
_context5.n =
|
|
19440
|
+
_context5.n = 12;
|
|
19459
19441
|
return put(updateMessageAC(messageToSend.tid, JSON.parse(JSON.stringify(messageUpdateData))));
|
|
19460
|
-
case
|
|
19461
|
-
updateMessageOnMap(channel.id, {
|
|
19462
|
-
messageId: messageToSend.tid,
|
|
19463
|
-
params: messageUpdateData
|
|
19464
|
-
});
|
|
19442
|
+
case 12:
|
|
19465
19443
|
updateMessageOnAllMessages(messageToSend.tid, messageUpdateData);
|
|
19466
|
-
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
_context5.n = 16;
|
|
19471
|
-
break;
|
|
19472
|
-
}
|
|
19444
|
+
case 13:
|
|
19445
|
+
_context5.n = 14;
|
|
19446
|
+
return put(removePendingMessageAC(channel.id, messageToSend.tid || messageToSend.id));
|
|
19447
|
+
case 14:
|
|
19473
19448
|
updateMessageOnMap(channel.id, {
|
|
19474
19449
|
messageId: messageToSend.tid,
|
|
19475
19450
|
params: messageUpdateData
|
|
19476
19451
|
});
|
|
19477
|
-
_context5.n = 17;
|
|
19478
|
-
break;
|
|
19479
|
-
case 16:
|
|
19480
|
-
_context5.n = 17;
|
|
19481
|
-
return put(removePendingMessageAC(channelId, messageToSend.tid || messageToSend.id));
|
|
19482
|
-
case 17:
|
|
19483
19452
|
messageToUpdate = JSON.parse(JSON.stringify(messageResponse));
|
|
19484
19453
|
updateChannelLastMessageOnAllChannels(channel.id, messageToUpdate);
|
|
19485
19454
|
channelUpdateParam = {
|
|
19486
19455
|
lastMessage: messageToUpdate,
|
|
19487
19456
|
lastReactedMessage: null
|
|
19488
19457
|
};
|
|
19489
|
-
_context5.n =
|
|
19458
|
+
_context5.n = 15;
|
|
19490
19459
|
return put(updateChannelDataAC(channel.id, channelUpdateParam, true));
|
|
19491
|
-
case
|
|
19460
|
+
case 15:
|
|
19492
19461
|
updateChannelOnAllChannels(channel.id, channelUpdateParam);
|
|
19493
19462
|
if (!channel.unread) {
|
|
19494
|
-
_context5.n =
|
|
19463
|
+
_context5.n = 16;
|
|
19495
19464
|
break;
|
|
19496
19465
|
}
|
|
19497
|
-
_context5.n =
|
|
19466
|
+
_context5.n = 16;
|
|
19498
19467
|
return put(markChannelAsReadAC(channel.id));
|
|
19499
|
-
case
|
|
19500
|
-
_context5.n =
|
|
19468
|
+
case 16:
|
|
19469
|
+
_context5.n = 18;
|
|
19501
19470
|
break;
|
|
19502
|
-
case
|
|
19503
|
-
_context5.p =
|
|
19471
|
+
case 17:
|
|
19472
|
+
_context5.p = 17;
|
|
19504
19473
|
_t4 = _context5.v;
|
|
19505
19474
|
log.error('error on forward message ... ', _t4);
|
|
19506
|
-
case
|
|
19507
|
-
_context5.n =
|
|
19475
|
+
case 18:
|
|
19476
|
+
_context5.n = 19;
|
|
19508
19477
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19509
|
-
case
|
|
19478
|
+
case 19:
|
|
19510
19479
|
return _context5.a(2);
|
|
19511
19480
|
}
|
|
19512
|
-
}, _marked3$1, null, [[0,
|
|
19481
|
+
}, _marked3$1, null, [[0, 17]]);
|
|
19513
19482
|
}
|
|
19514
19483
|
function resendMessage(action) {
|
|
19515
|
-
var payload, message, connectionState, channelId,
|
|
19484
|
+
var payload, message, connectionState, channelId, sendAttachmentsAsSeparateMessage, isVoiceMessage;
|
|
19516
19485
|
return _regenerator().w(function (_context6) {
|
|
19517
|
-
while (1) switch (_context6.
|
|
19486
|
+
while (1) switch (_context6.n) {
|
|
19518
19487
|
case 0:
|
|
19519
19488
|
payload = action.payload;
|
|
19520
19489
|
message = payload.message, connectionState = payload.connectionState, channelId = payload.channelId;
|
|
19521
|
-
|
|
19522
|
-
|
|
19523
|
-
|
|
19524
|
-
|
|
19525
|
-
|
|
19526
|
-
|
|
19527
|
-
channel = _context6.v;
|
|
19528
|
-
_context6.p = 3;
|
|
19529
|
-
if (!channel) {
|
|
19530
|
-
channel = getChannelFromAllChannels(channelId);
|
|
19531
|
-
if (channel) {
|
|
19532
|
-
setChannelInMap(channel);
|
|
19533
|
-
}
|
|
19534
|
-
}
|
|
19535
|
-
_context6.n = 4;
|
|
19536
|
-
return put(addChannelAC(JSON.parse(JSON.stringify(channel))));
|
|
19537
|
-
case 4:
|
|
19538
|
-
customUploader = getCustomUploader();
|
|
19539
|
-
_context6.n = 5;
|
|
19540
|
-
return put(updateMessageAC(message.tid, {
|
|
19541
|
-
state: MESSAGE_STATUS.UNMODIFIED
|
|
19542
|
-
}));
|
|
19543
|
-
case 5:
|
|
19544
|
-
updateMessageOnMap(channel.id, {
|
|
19545
|
-
messageId: message.tid,
|
|
19546
|
-
params: {
|
|
19547
|
-
state: MESSAGE_STATUS.UNMODIFIED
|
|
19548
|
-
}
|
|
19549
|
-
});
|
|
19550
|
-
updateMessageOnAllMessages(message.tid, {
|
|
19551
|
-
state: MESSAGE_STATUS.UNMODIFIED
|
|
19552
|
-
});
|
|
19553
|
-
if (!(message.attachments && message.attachments.length && message.state === MESSAGE_STATUS.FAILED)) {
|
|
19554
|
-
_context6.n = 26;
|
|
19555
|
-
break;
|
|
19556
|
-
}
|
|
19557
|
-
_context6.n = 6;
|
|
19558
|
-
return select(attachmentCompilationStateSelector);
|
|
19559
|
-
case 6:
|
|
19560
|
-
attachmentCompilation = _context6.v;
|
|
19561
|
-
messageAttachment = _extends({}, message.attachments[0]);
|
|
19562
|
-
messageCopy = _extends({}, message, {
|
|
19563
|
-
attachments: [messageAttachment]
|
|
19564
|
-
});
|
|
19565
|
-
log.info('attachmentCompilation. .. . .', attachmentCompilation);
|
|
19566
|
-
if (!(connectionState === CONNECTION_STATUS.CONNECTED && attachmentCompilation[messageAttachment.tid] && attachmentCompilation[messageAttachment.tid] === UPLOAD_STATE.FAIL)) {
|
|
19567
|
-
_context6.n = 25;
|
|
19568
|
-
break;
|
|
19569
|
-
}
|
|
19570
|
-
_context6.n = 7;
|
|
19571
|
-
return put(updateAttachmentUploadingStateAC(UPLOAD_STATE.UPLOADING, messageAttachment.tid));
|
|
19572
|
-
case 7:
|
|
19573
|
-
if (!customUploader) {
|
|
19574
|
-
_context6.n = 25;
|
|
19575
|
-
break;
|
|
19576
|
-
}
|
|
19577
|
-
handleUploadProgress = function handleUploadProgress(_ref2) {
|
|
19578
|
-
var loaded = _ref2.loaded,
|
|
19579
|
-
total = _ref2.total;
|
|
19580
|
-
log.info('progress ... ', loaded / total);
|
|
19581
|
-
};
|
|
19582
|
-
_context6.p = 8;
|
|
19583
|
-
handleUpdateLocalPath = function handleUpdateLocalPath(updatedLink) {
|
|
19584
|
-
filePath = updatedLink;
|
|
19585
|
-
thumbnailMetas = getVideoThumb(messageAttachment.tid);
|
|
19586
|
-
messageCopy.attachments[0] = _extends({}, messageCopy.attachments[0], {
|
|
19587
|
-
attachmentUrl: updatedLink
|
|
19588
|
-
});
|
|
19589
|
-
var updateAttachmentPath = {
|
|
19590
|
-
attachments: [_extends({}, messageCopy.attachments[0], {
|
|
19591
|
-
attachmentUrl: updatedLink
|
|
19592
|
-
})]
|
|
19593
|
-
};
|
|
19594
|
-
store.dispatch(updateMessageAC(message.tid, updateAttachmentPath));
|
|
19595
|
-
};
|
|
19596
|
-
pendingAttachment = getPendingAttachment(message.attachments[0].tid);
|
|
19597
|
-
log.info('pendingAttachment ... ', pendingAttachment);
|
|
19598
|
-
if (!messageAttachment.cachedUrl) {
|
|
19599
|
-
_context6.n = 9;
|
|
19600
|
-
break;
|
|
19601
|
-
}
|
|
19602
|
-
uri = pendingAttachment.file;
|
|
19603
|
-
_context6.n = 11;
|
|
19604
|
-
break;
|
|
19605
|
-
case 9:
|
|
19606
|
-
messageAttachment.data = pendingAttachment.file;
|
|
19607
|
-
messageAttachment.url = pendingAttachment.file;
|
|
19608
|
-
_context6.n = 10;
|
|
19609
|
-
return call(customUpload, messageAttachment, handleUploadProgress, message.type, handleUpdateLocalPath);
|
|
19610
|
-
case 10:
|
|
19611
|
-
uri = _context6.v;
|
|
19612
|
-
case 11:
|
|
19613
|
-
log.info('messageAttachment ... ', messageAttachment);
|
|
19614
|
-
_context6.n = 12;
|
|
19615
|
-
return put(updateAttachmentUploadingStateAC(UPLOAD_STATE.SUCCESS, messageAttachment.tid));
|
|
19616
|
-
case 12:
|
|
19617
|
-
delete messageCopy.createdAt;
|
|
19618
|
-
thumbnailMetas = {};
|
|
19619
|
-
fileSize = messageAttachment.cachedUrl ? messageAttachment.size : pendingAttachment.file.size;
|
|
19620
|
-
log.info('uri ... ', uri);
|
|
19621
|
-
if (!(!messageAttachment.cachedUrl && messageAttachment.url.type.split('/')[0] === 'image')) {
|
|
19622
|
-
_context6.n = 15;
|
|
19623
|
-
break;
|
|
19624
|
-
}
|
|
19625
|
-
_context6.n = 13;
|
|
19626
|
-
return call(getImageSize, filePath);
|
|
19627
|
-
case 13:
|
|
19628
|
-
fileSize = _context6.v;
|
|
19629
|
-
_context6.n = 14;
|
|
19630
|
-
return call(createImageThumbnail, null, filePath, messageAttachment.type === 'file' ? 50 : undefined, messageAttachment.type === 'file' ? 50 : undefined);
|
|
19631
|
-
case 14:
|
|
19632
|
-
thumbnailMetas = _context6.v;
|
|
19633
|
-
_context6.n = 17;
|
|
19634
|
-
break;
|
|
19635
|
-
case 15:
|
|
19636
|
-
if (!(!messageAttachment.cachedUrl && messageAttachment.url.type.split('/')[0] === 'video')) {
|
|
19637
|
-
_context6.n = 17;
|
|
19638
|
-
break;
|
|
19639
|
-
}
|
|
19640
|
-
if (!filePath) {
|
|
19641
|
-
_context6.n = 17;
|
|
19642
|
-
break;
|
|
19643
|
-
}
|
|
19644
|
-
_context6.n = 16;
|
|
19645
|
-
return call(getFrame, filePath);
|
|
19646
|
-
case 16:
|
|
19647
|
-
meta = _context6.v;
|
|
19648
|
-
thumbnailMetas = {
|
|
19649
|
-
thumbnail: meta.thumb,
|
|
19650
|
-
imageWidth: meta.width,
|
|
19651
|
-
imageHeight: meta.height,
|
|
19652
|
-
duration: meta.duration
|
|
19653
|
-
};
|
|
19654
|
-
case 17:
|
|
19655
|
-
if (messageAttachment.cachedUrl) {
|
|
19656
|
-
attachmentMeta = messageAttachment.metadata;
|
|
19490
|
+
if (message.forwardingDetails) {
|
|
19491
|
+
store.dispatch(forwardMessageAC(message, channelId, connectionState, false, false));
|
|
19492
|
+
} else if (message.attachments && message.attachments.length) {
|
|
19493
|
+
sendAttachmentsAsSeparateMessage = getSendAttachmentsAsSeparateMessages();
|
|
19494
|
+
isVoiceMessage = message.attachments[0].type === attachmentTypes.voice;
|
|
19495
|
+
store.dispatch(sendMessageAC(message, channelId, connectionState, isVoiceMessage ? false : sendAttachmentsAsSeparateMessage, false, false));
|
|
19657
19496
|
} else {
|
|
19658
|
-
|
|
19659
|
-
tmb: thumbnailMetas.thumbnail,
|
|
19660
|
-
szw: thumbnailMetas.imageWidth,
|
|
19661
|
-
szh: thumbnailMetas.imageHeight
|
|
19662
|
-
}, thumbnailMetas.duration ? {
|
|
19663
|
-
dur: thumbnailMetas.duration
|
|
19664
|
-
} : {})));
|
|
19665
|
-
}
|
|
19666
|
-
log.info('attachmentMeta ... ', attachmentMeta);
|
|
19667
|
-
attachmentBuilder = channel.createAttachmentBuilder(uri, messageAttachment.type);
|
|
19668
|
-
attachmentToSend = attachmentBuilder.setName(messageAttachment.name).setMetadata(attachmentMeta).setFileSize(fileSize).setUpload(false).create();
|
|
19669
|
-
log.info('attachmentToSend ... ', attachmentToSend);
|
|
19670
|
-
attachmentToSend.tid = messageAttachment.tid;
|
|
19671
|
-
attachmentToSend.attachmentUrl = messageAttachment.attachmentUrl;
|
|
19672
|
-
_context6.n = 18;
|
|
19673
|
-
return put(updateMessageAC(messageCopy.tid, JSON.parse(JSON.stringify(_extends({}, messageCopy, {
|
|
19674
|
-
attachments: [attachmentToSend]
|
|
19675
|
-
})))));
|
|
19676
|
-
case 18:
|
|
19677
|
-
messageCopy.attachments = [attachmentToSend];
|
|
19678
|
-
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19679
|
-
_context6.n = 22;
|
|
19680
|
-
break;
|
|
19497
|
+
store.dispatch(sendTextMessageAC(message, channelId, connectionState, false));
|
|
19681
19498
|
}
|
|
19682
|
-
|
|
19683
|
-
return call(channel.sendMessage, messageCopy);
|
|
19684
|
-
case 19:
|
|
19685
|
-
messageResponse = _context6.v;
|
|
19686
|
-
deletePendingAttachment(messageAttachment.tid);
|
|
19687
|
-
messageUpdateData = {
|
|
19688
|
-
id: messageResponse.id,
|
|
19689
|
-
body: messageResponse.body,
|
|
19690
|
-
type: messageResponse.type,
|
|
19691
|
-
state: messageResponse.state,
|
|
19692
|
-
displayCount: messageResponse.displayCount,
|
|
19693
|
-
deliveryStatus: messageResponse.deliveryStatus,
|
|
19694
|
-
attachments: [_extends({}, messageResponse.attachments[0], {
|
|
19695
|
-
attachmentUrl: attachmentToSend.attachmentUrl,
|
|
19696
|
-
tid: attachmentToSend.tid
|
|
19697
|
-
})],
|
|
19698
|
-
mentionedUsers: messageResponse.mentionedUsers,
|
|
19699
|
-
metadata: messageResponse.metadata,
|
|
19700
|
-
parentMessage: messageResponse.parentMessage,
|
|
19701
|
-
repliedInThread: messageResponse.repliedInThread,
|
|
19702
|
-
bodyAttributes: messageResponse.bodyAttributes,
|
|
19703
|
-
createdAt: messageResponse.createdAt,
|
|
19704
|
-
channelId: channel.id
|
|
19705
|
-
};
|
|
19706
|
-
_context6.n = 20;
|
|
19707
|
-
return put(removePendingMessageAC(channel.id, messageCopy.tid || messageCopy.id));
|
|
19708
|
-
case 20:
|
|
19709
|
-
_context6.n = 21;
|
|
19710
|
-
return put(updateMessageAC(messageCopy.tid, JSON.parse(JSON.stringify(messageUpdateData))));
|
|
19711
|
-
case 21:
|
|
19712
|
-
fileType = messageAttachment.data && messageAttachment.data.type ? messageAttachment.data.type.split('/')[0] : messageAttachment.type;
|
|
19713
|
-
if (fileType === 'video') {
|
|
19714
|
-
deleteVideoThumb(messageAttachment.tid);
|
|
19715
|
-
}
|
|
19716
|
-
updateMessageOnMap(channel.id, {
|
|
19717
|
-
messageId: messageCopy.tid,
|
|
19718
|
-
params: messageUpdateData
|
|
19719
|
-
});
|
|
19720
|
-
updateMessageOnAllMessages(messageCopy.tid, messageUpdateData);
|
|
19721
|
-
messageToUpdate = JSON.parse(JSON.stringify(messageResponse));
|
|
19722
|
-
updateChannelLastMessageOnAllChannels(channel.id, messageToUpdate);
|
|
19723
|
-
_context6.n = 22;
|
|
19724
|
-
return put(updateChannelLastMessageAC(messageToUpdate, {
|
|
19725
|
-
id: channel.id
|
|
19726
|
-
}));
|
|
19727
|
-
case 22:
|
|
19728
|
-
_context6.n = 25;
|
|
19729
|
-
break;
|
|
19730
|
-
case 23:
|
|
19731
|
-
_context6.p = 23;
|
|
19732
|
-
_t5 = _context6.v;
|
|
19733
|
-
log.error('fail upload attachment on resend message ... ', _t5);
|
|
19734
|
-
_context6.n = 24;
|
|
19735
|
-
return put(updateAttachmentUploadingStateAC(UPLOAD_STATE.FAIL, messageAttachment.tid));
|
|
19736
|
-
case 24:
|
|
19737
|
-
updateMessageOnMap(channel.id, {
|
|
19738
|
-
messageId: messageCopy.tid,
|
|
19739
|
-
params: {
|
|
19740
|
-
state: MESSAGE_STATUS.FAILED
|
|
19741
|
-
}
|
|
19742
|
-
});
|
|
19743
|
-
updateMessageOnAllMessages(messageCopy.tid, {
|
|
19744
|
-
state: MESSAGE_STATUS.FAILED
|
|
19745
|
-
});
|
|
19746
|
-
_context6.n = 25;
|
|
19747
|
-
return put(updateMessageAC(messageCopy.tid, {
|
|
19748
|
-
state: MESSAGE_STATUS.FAILED
|
|
19749
|
-
}));
|
|
19750
|
-
case 25:
|
|
19751
|
-
_context6.n = 33;
|
|
19752
|
-
break;
|
|
19753
|
-
case 26:
|
|
19754
|
-
if (!(message.state === MESSAGE_STATUS.FAILED)) {
|
|
19755
|
-
_context6.n = 33;
|
|
19756
|
-
break;
|
|
19757
|
-
}
|
|
19758
|
-
log.info('send failed message ...');
|
|
19759
|
-
_messageCopy2 = _extends({}, message);
|
|
19760
|
-
delete _messageCopy2.createdAt;
|
|
19761
|
-
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19762
|
-
_context6.n = 33;
|
|
19763
|
-
break;
|
|
19764
|
-
}
|
|
19765
|
-
_context6.n = 27;
|
|
19766
|
-
return call(channel.sendMessage, _messageCopy2);
|
|
19767
|
-
case 27:
|
|
19768
|
-
_messageResponse2 = _context6.v;
|
|
19769
|
-
_context6.n = 28;
|
|
19770
|
-
return put(removePendingMessageAC(channel.id, _messageCopy2.tid || _messageCopy2.id));
|
|
19771
|
-
case 28:
|
|
19772
|
-
_messageUpdateData = {
|
|
19773
|
-
id: _messageResponse2.id,
|
|
19774
|
-
body: _messageResponse2.body,
|
|
19775
|
-
type: _messageResponse2.type,
|
|
19776
|
-
state: _messageResponse2.state,
|
|
19777
|
-
displayCount: _messageResponse2.displayCount,
|
|
19778
|
-
deliveryStatus: _messageResponse2.deliveryStatus,
|
|
19779
|
-
attachments: [],
|
|
19780
|
-
mentionedUsers: _messageResponse2.mentionedUsers,
|
|
19781
|
-
metadata: _messageResponse2.metadata,
|
|
19782
|
-
parentMessage: _messageResponse2.parentMessage,
|
|
19783
|
-
repliedInThread: _messageResponse2.repliedInThread,
|
|
19784
|
-
bodyAttributes: _messageResponse2.bodyAttributes,
|
|
19785
|
-
createdAt: _messageResponse2.createdAt,
|
|
19786
|
-
channelId: channel.id
|
|
19787
|
-
};
|
|
19788
|
-
isInActiveChannel = getMessagesFromMap(channelId)[_messageCopy2.tid];
|
|
19789
|
-
if (!isInActiveChannel) {
|
|
19790
|
-
_context6.n = 29;
|
|
19791
|
-
break;
|
|
19792
|
-
}
|
|
19793
|
-
_context6.n = 29;
|
|
19794
|
-
return put(removePendingMessageAC(channel.id, _messageCopy2.tid || _messageCopy2.id));
|
|
19795
|
-
case 29:
|
|
19796
|
-
_context6.n = 30;
|
|
19797
|
-
return put(updateMessageAC(_messageCopy2.tid, _messageUpdateData));
|
|
19798
|
-
case 30:
|
|
19799
|
-
updateMessageOnMap(channel.id, {
|
|
19800
|
-
messageId: _messageCopy2.tid,
|
|
19801
|
-
params: _messageUpdateData
|
|
19802
|
-
});
|
|
19803
|
-
activeChannelId = getActiveChannelId();
|
|
19804
|
-
if (!(channelId === activeChannelId)) {
|
|
19805
|
-
_context6.n = 32;
|
|
19806
|
-
break;
|
|
19807
|
-
}
|
|
19808
|
-
_context6.n = 31;
|
|
19809
|
-
return put(updateMessageAC(_messageCopy2.tid, JSON.parse(JSON.stringify(_messageResponse2))));
|
|
19810
|
-
case 31:
|
|
19811
|
-
updateMessageOnMap(channel.id, {
|
|
19812
|
-
messageId: _messageCopy2.tid,
|
|
19813
|
-
params: _messageUpdateData
|
|
19814
|
-
});
|
|
19815
|
-
updateMessageOnAllMessages(_messageCopy2.tid, _messageUpdateData);
|
|
19816
|
-
case 32:
|
|
19817
|
-
updateChannelOnAllChannels(channel.id, channel);
|
|
19818
|
-
_messageToUpdate = JSON.parse(JSON.stringify(_messageResponse2));
|
|
19819
|
-
updateChannelLastMessageOnAllChannels(channel.id, _messageToUpdate);
|
|
19820
|
-
_context6.n = 33;
|
|
19821
|
-
return put(updateChannelLastMessageAC(_messageToUpdate, {
|
|
19822
|
-
id: channel.id
|
|
19823
|
-
}));
|
|
19824
|
-
case 33:
|
|
19825
|
-
_context6.n = 34;
|
|
19826
|
-
return put(scrollToNewMessageAC(true));
|
|
19827
|
-
case 34:
|
|
19828
|
-
_context6.n = 37;
|
|
19829
|
-
break;
|
|
19830
|
-
case 35:
|
|
19831
|
-
_context6.p = 35;
|
|
19832
|
-
_t6 = _context6.v;
|
|
19833
|
-
log.error('ERROR in resend message', _t6.message, 'channel.. . ', channel);
|
|
19834
|
-
_context6.n = 36;
|
|
19835
|
-
return put(updateMessageAC(message.tid, {
|
|
19836
|
-
state: MESSAGE_STATUS.FAILED
|
|
19837
|
-
}));
|
|
19838
|
-
case 36:
|
|
19839
|
-
updateMessageOnMap(channel.id, {
|
|
19840
|
-
messageId: message.tid,
|
|
19841
|
-
params: {
|
|
19842
|
-
state: MESSAGE_STATUS.FAILED
|
|
19843
|
-
}
|
|
19844
|
-
});
|
|
19845
|
-
updateMessageOnAllMessages(message.tid, {
|
|
19846
|
-
state: MESSAGE_STATUS.FAILED
|
|
19847
|
-
});
|
|
19848
|
-
case 37:
|
|
19849
|
-
_context6.n = 38;
|
|
19850
|
-
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19851
|
-
case 38:
|
|
19499
|
+
case 1:
|
|
19852
19500
|
return _context6.a(2);
|
|
19853
19501
|
}
|
|
19854
|
-
}, _marked4$1
|
|
19502
|
+
}, _marked4$1);
|
|
19855
19503
|
}
|
|
19856
19504
|
function deleteMessage(action) {
|
|
19857
|
-
var payload, messageId, channelId, deleteOption, channel, deletedMessage, messageToUpdate,
|
|
19505
|
+
var payload, messageId, channelId, deleteOption, channel, deletedMessage, messageToUpdate, _t5;
|
|
19858
19506
|
return _regenerator().w(function (_context7) {
|
|
19859
19507
|
while (1) switch (_context7.p = _context7.n) {
|
|
19860
19508
|
case 0:
|
|
@@ -19896,21 +19544,21 @@ function deleteMessage(action) {
|
|
|
19896
19544
|
break;
|
|
19897
19545
|
case 5:
|
|
19898
19546
|
_context7.p = 5;
|
|
19899
|
-
|
|
19900
|
-
log.error('ERROR in delete message',
|
|
19547
|
+
_t5 = _context7.v;
|
|
19548
|
+
log.error('ERROR in delete message', _t5.message);
|
|
19901
19549
|
case 6:
|
|
19902
19550
|
return _context7.a(2);
|
|
19903
19551
|
}
|
|
19904
19552
|
}, _marked5$1, null, [[0, 5]]);
|
|
19905
19553
|
}
|
|
19906
19554
|
function editMessage(action) {
|
|
19907
|
-
var payload,
|
|
19555
|
+
var payload, message, channelId, channel, linkAttachments, anotherAttachments, linkAttachmentsToSend, editedMessage, messageToUpdate, _t6;
|
|
19908
19556
|
return _regenerator().w(function (_context8) {
|
|
19909
19557
|
while (1) switch (_context8.p = _context8.n) {
|
|
19910
19558
|
case 0:
|
|
19911
19559
|
_context8.p = 0;
|
|
19912
19560
|
payload = action.payload;
|
|
19913
|
-
|
|
19561
|
+
message = payload.message, channelId = payload.channelId;
|
|
19914
19562
|
_context8.n = 1;
|
|
19915
19563
|
return call(getChannelFromMap, channelId);
|
|
19916
19564
|
case 1:
|
|
@@ -19921,11 +19569,11 @@ function editMessage(action) {
|
|
|
19921
19569
|
setChannelInMap(channel);
|
|
19922
19570
|
}
|
|
19923
19571
|
}
|
|
19924
|
-
if (
|
|
19925
|
-
linkAttachments =
|
|
19572
|
+
if (message.attachments.length > 0) {
|
|
19573
|
+
linkAttachments = message.attachments.filter(function (att) {
|
|
19926
19574
|
return att.type === attachmentTypes.link;
|
|
19927
19575
|
});
|
|
19928
|
-
anotherAttachments =
|
|
19576
|
+
anotherAttachments = message.attachments.filter(function (att) {
|
|
19929
19577
|
return att.type !== attachmentTypes.link;
|
|
19930
19578
|
});
|
|
19931
19579
|
linkAttachmentsToSend = [];
|
|
@@ -19934,12 +19582,12 @@ function editMessage(action) {
|
|
|
19934
19582
|
var linkAttachmentToSend = linkAttachmentBuilder.setName(linkAttachment.name).setUpload(linkAttachment.upload).create();
|
|
19935
19583
|
linkAttachmentsToSend.push(linkAttachmentToSend);
|
|
19936
19584
|
});
|
|
19937
|
-
|
|
19585
|
+
message.attachments = [].concat(anotherAttachments, linkAttachmentsToSend);
|
|
19938
19586
|
}
|
|
19939
19587
|
_context8.n = 2;
|
|
19940
|
-
return call(channel.editMessage, _extends({},
|
|
19941
|
-
metadata: isJSON(
|
|
19942
|
-
attachments:
|
|
19588
|
+
return call(channel.editMessage, _extends({}, message, {
|
|
19589
|
+
metadata: isJSON(message.metadata) ? message.metadata : JSON.stringify(message.metadata),
|
|
19590
|
+
attachments: message.attachments.map(function (att) {
|
|
19943
19591
|
return _extends({}, att, {
|
|
19944
19592
|
metadata: isJSON(att.metadata) ? att.metadata : JSON.stringify(att.metadata)
|
|
19945
19593
|
});
|
|
@@ -19954,8 +19602,8 @@ function editMessage(action) {
|
|
|
19954
19602
|
messageId: editedMessage.id,
|
|
19955
19603
|
params: editedMessage
|
|
19956
19604
|
});
|
|
19957
|
-
updateMessageOnAllMessages(
|
|
19958
|
-
if (!(channel.lastMessage.id ===
|
|
19605
|
+
updateMessageOnAllMessages(message.id, editedMessage);
|
|
19606
|
+
if (!(channel.lastMessage.id === message.id)) {
|
|
19959
19607
|
_context8.n = 4;
|
|
19960
19608
|
break;
|
|
19961
19609
|
}
|
|
@@ -19968,15 +19616,15 @@ function editMessage(action) {
|
|
|
19968
19616
|
break;
|
|
19969
19617
|
case 5:
|
|
19970
19618
|
_context8.p = 5;
|
|
19971
|
-
|
|
19972
|
-
log.error('ERROR in edit message',
|
|
19619
|
+
_t6 = _context8.v;
|
|
19620
|
+
log.error('ERROR in edit message', _t6.message);
|
|
19973
19621
|
case 6:
|
|
19974
19622
|
return _context8.a(2);
|
|
19975
19623
|
}
|
|
19976
19624
|
}, _marked6$1, null, [[0, 5]]);
|
|
19977
19625
|
}
|
|
19978
19626
|
function getMessagesQuery(action) {
|
|
19979
|
-
var _action$payload, channel, loadWithLastMessage, messageId, limit, withDeliveredMessages, highlight, behavior, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, allMessages, havLastMessage, secondResult, sentMessages, messagesMap, filteredSentMessages, _allMessages, messageIndex, maxLengthPart, _secondResult, thirdResult, _secondResult2, _thirdResult, _secondResult3, _Object$values, previousAllMessages, _secondResult4, updatedMessages, lastMessageId, _allMessages2, setMappedAllMessages, allMessagesAfterLastMessage, pendingMessages, _messagesMap, filteredPendingMessages,
|
|
19627
|
+
var _action$payload, channel, loadWithLastMessage, messageId, limit, withDeliveredMessages, highlight, behavior, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, allMessages, havLastMessage, secondResult, sentMessages, messagesMap, filteredSentMessages, _allMessages, messageIndex, maxLengthPart, _secondResult, thirdResult, _secondResult2, _thirdResult, _secondResult3, _Object$values, previousAllMessages, _secondResult4, updatedMessages, lastMessageId, _allMessages2, setMappedAllMessages, allMessagesAfterLastMessage, pendingMessages, _messagesMap, filteredPendingMessages, _t7;
|
|
19980
19628
|
return _regenerator().w(function (_context9) {
|
|
19981
19629
|
while (1) switch (_context9.p = _context9.n) {
|
|
19982
19630
|
case 0:
|
|
@@ -20317,8 +19965,8 @@ function getMessagesQuery(action) {
|
|
|
20317
19965
|
break;
|
|
20318
19966
|
case 50:
|
|
20319
19967
|
_context9.p = 50;
|
|
20320
|
-
|
|
20321
|
-
log.error('error in message query',
|
|
19968
|
+
_t7 = _context9.v;
|
|
19969
|
+
log.error('error in message query', _t7);
|
|
20322
19970
|
case 51:
|
|
20323
19971
|
_context9.p = 51;
|
|
20324
19972
|
_context9.n = 52;
|
|
@@ -20331,7 +19979,7 @@ function getMessagesQuery(action) {
|
|
|
20331
19979
|
}, _marked7$1, null, [[0, 50, 51, 53]]);
|
|
20332
19980
|
}
|
|
20333
19981
|
function getMessageQuery(action) {
|
|
20334
|
-
var payload, channelId, messageId, channel, messages, fetchedMessage,
|
|
19982
|
+
var payload, channelId, messageId, channel, messages, fetchedMessage, _t8;
|
|
20335
19983
|
return _regenerator().w(function (_context0) {
|
|
20336
19984
|
while (1) switch (_context0.p = _context0.n) {
|
|
20337
19985
|
case 0:
|
|
@@ -20380,15 +20028,15 @@ function getMessageQuery(action) {
|
|
|
20380
20028
|
break;
|
|
20381
20029
|
case 7:
|
|
20382
20030
|
_context0.p = 7;
|
|
20383
|
-
|
|
20384
|
-
log.error('error in message query',
|
|
20031
|
+
_t8 = _context0.v;
|
|
20032
|
+
log.error('error in message query', _t8);
|
|
20385
20033
|
case 8:
|
|
20386
20034
|
return _context0.a(2);
|
|
20387
20035
|
}
|
|
20388
20036
|
}, _marked8$1, null, [[0, 7]]);
|
|
20389
20037
|
}
|
|
20390
20038
|
function loadMoreMessages(action) {
|
|
20391
|
-
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result,
|
|
20039
|
+
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _t9;
|
|
20392
20040
|
return _regenerator().w(function (_context1) {
|
|
20393
20041
|
while (1) switch (_context1.p = _context1.n) {
|
|
20394
20042
|
case 0:
|
|
@@ -20501,15 +20149,15 @@ function loadMoreMessages(action) {
|
|
|
20501
20149
|
break;
|
|
20502
20150
|
case 18:
|
|
20503
20151
|
_context1.p = 18;
|
|
20504
|
-
|
|
20505
|
-
log.error('error in load more messages',
|
|
20152
|
+
_t9 = _context1.v;
|
|
20153
|
+
log.error('error in load more messages', _t9);
|
|
20506
20154
|
case 19:
|
|
20507
20155
|
return _context1.a(2);
|
|
20508
20156
|
}
|
|
20509
20157
|
}, _marked9$1, null, [[0, 18]]);
|
|
20510
20158
|
}
|
|
20511
20159
|
function addReaction(action) {
|
|
20512
|
-
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call,
|
|
20160
|
+
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam, _t0;
|
|
20513
20161
|
return _regenerator().w(function (_context10) {
|
|
20514
20162
|
while (1) switch (_context10.p = _context10.n) {
|
|
20515
20163
|
case 0:
|
|
@@ -20531,15 +20179,15 @@ function addReaction(action) {
|
|
|
20531
20179
|
return call(channel.addReaction, messageId, key, score, reason, enforceUnique);
|
|
20532
20180
|
case 2:
|
|
20533
20181
|
_yield$call = _context10.v;
|
|
20534
|
-
|
|
20182
|
+
message = _yield$call.message;
|
|
20535
20183
|
reaction = _yield$call.reaction;
|
|
20536
|
-
if (!(user.id ===
|
|
20184
|
+
if (!(user.id === message.user.id)) {
|
|
20537
20185
|
_context10.n = 4;
|
|
20538
20186
|
break;
|
|
20539
20187
|
}
|
|
20540
20188
|
channelUpdateParam = {
|
|
20541
20189
|
userMessageReactions: [reaction],
|
|
20542
|
-
lastReactedMessage:
|
|
20190
|
+
lastReactedMessage: message,
|
|
20543
20191
|
newReactions: [reaction]
|
|
20544
20192
|
};
|
|
20545
20193
|
_context10.n = 3;
|
|
@@ -20554,23 +20202,23 @@ function addReaction(action) {
|
|
|
20554
20202
|
return put(addReactionToListAC(reaction));
|
|
20555
20203
|
case 6:
|
|
20556
20204
|
_context10.n = 7;
|
|
20557
|
-
return put(addReactionToMessageAC(
|
|
20205
|
+
return put(addReactionToMessageAC(message, reaction, true));
|
|
20558
20206
|
case 7:
|
|
20559
|
-
addReactionToMessageOnMap(channelId,
|
|
20560
|
-
addReactionOnAllMessages(
|
|
20207
|
+
addReactionToMessageOnMap(channelId, message, reaction, true);
|
|
20208
|
+
addReactionOnAllMessages(message, reaction, true);
|
|
20561
20209
|
_context10.n = 9;
|
|
20562
20210
|
break;
|
|
20563
20211
|
case 8:
|
|
20564
20212
|
_context10.p = 8;
|
|
20565
|
-
|
|
20566
|
-
log.error('ERROR in add reaction',
|
|
20213
|
+
_t0 = _context10.v;
|
|
20214
|
+
log.error('ERROR in add reaction', _t0.message);
|
|
20567
20215
|
case 9:
|
|
20568
20216
|
return _context10.a(2);
|
|
20569
20217
|
}
|
|
20570
20218
|
}, _marked0$1, null, [[0, 8]]);
|
|
20571
20219
|
}
|
|
20572
20220
|
function deleteReaction(action) {
|
|
20573
|
-
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2,
|
|
20221
|
+
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam, _t1;
|
|
20574
20222
|
return _regenerator().w(function (_context11) {
|
|
20575
20223
|
while (1) switch (_context11.p = _context11.n) {
|
|
20576
20224
|
case 0:
|
|
@@ -20591,7 +20239,7 @@ function deleteReaction(action) {
|
|
|
20591
20239
|
return call(channel.deleteReaction, messageId, key);
|
|
20592
20240
|
case 2:
|
|
20593
20241
|
_yield$call2 = _context11.v;
|
|
20594
|
-
|
|
20242
|
+
message = _yield$call2.message;
|
|
20595
20243
|
reaction = _yield$call2.reaction;
|
|
20596
20244
|
if (!isLastReaction) {
|
|
20597
20245
|
_context11.n = 4;
|
|
@@ -20610,23 +20258,23 @@ function deleteReaction(action) {
|
|
|
20610
20258
|
return put(deleteReactionFromListAC(reaction));
|
|
20611
20259
|
case 5:
|
|
20612
20260
|
_context11.n = 6;
|
|
20613
|
-
return put(deleteReactionFromMessageAC(
|
|
20261
|
+
return put(deleteReactionFromMessageAC(message, reaction, true));
|
|
20614
20262
|
case 6:
|
|
20615
|
-
removeReactionToMessageOnMap(channelId,
|
|
20616
|
-
removeReactionOnAllMessages(
|
|
20263
|
+
removeReactionToMessageOnMap(channelId, message, reaction, true);
|
|
20264
|
+
removeReactionOnAllMessages(message, reaction, true);
|
|
20617
20265
|
_context11.n = 8;
|
|
20618
20266
|
break;
|
|
20619
20267
|
case 7:
|
|
20620
20268
|
_context11.p = 7;
|
|
20621
|
-
|
|
20622
|
-
log.error('ERROR in delete reaction',
|
|
20269
|
+
_t1 = _context11.v;
|
|
20270
|
+
log.error('ERROR in delete reaction', _t1.message);
|
|
20623
20271
|
case 8:
|
|
20624
20272
|
return _context11.a(2);
|
|
20625
20273
|
}
|
|
20626
20274
|
}, _marked1$1, null, [[0, 7]]);
|
|
20627
20275
|
}
|
|
20628
20276
|
function getReactions(action) {
|
|
20629
|
-
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result,
|
|
20277
|
+
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result, _t10;
|
|
20630
20278
|
return _regenerator().w(function (_context12) {
|
|
20631
20279
|
while (1) switch (_context12.p = _context12.n) {
|
|
20632
20280
|
case 0:
|
|
@@ -20661,15 +20309,15 @@ function getReactions(action) {
|
|
|
20661
20309
|
break;
|
|
20662
20310
|
case 6:
|
|
20663
20311
|
_context12.p = 6;
|
|
20664
|
-
|
|
20665
|
-
log.error('ERROR in get reactions',
|
|
20312
|
+
_t10 = _context12.v;
|
|
20313
|
+
log.error('ERROR in get reactions', _t10.message);
|
|
20666
20314
|
case 7:
|
|
20667
20315
|
return _context12.a(2);
|
|
20668
20316
|
}
|
|
20669
20317
|
}, _marked10$1, null, [[0, 6]]);
|
|
20670
20318
|
}
|
|
20671
20319
|
function loadMoreReactions(action) {
|
|
20672
|
-
var payload, limit, ReactionQuery, result,
|
|
20320
|
+
var payload, limit, ReactionQuery, result, _t11;
|
|
20673
20321
|
return _regenerator().w(function (_context13) {
|
|
20674
20322
|
while (1) switch (_context13.p = _context13.n) {
|
|
20675
20323
|
case 0:
|
|
@@ -20697,15 +20345,15 @@ function loadMoreReactions(action) {
|
|
|
20697
20345
|
break;
|
|
20698
20346
|
case 5:
|
|
20699
20347
|
_context13.p = 5;
|
|
20700
|
-
|
|
20701
|
-
log.error('ERROR in load more reactions',
|
|
20348
|
+
_t11 = _context13.v;
|
|
20349
|
+
log.error('ERROR in load more reactions', _t11.message);
|
|
20702
20350
|
case 6:
|
|
20703
20351
|
return _context13.a(2);
|
|
20704
20352
|
}
|
|
20705
20353
|
}, _marked11$1, null, [[0, 5]]);
|
|
20706
20354
|
}
|
|
20707
20355
|
function getMessageAttachments(action) {
|
|
20708
|
-
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result,
|
|
20356
|
+
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, _t12;
|
|
20709
20357
|
return _regenerator().w(function (_context14) {
|
|
20710
20358
|
while (1) switch (_context14.p = _context14.n) {
|
|
20711
20359
|
case 0:
|
|
@@ -20783,15 +20431,15 @@ function getMessageAttachments(action) {
|
|
|
20783
20431
|
break;
|
|
20784
20432
|
case 13:
|
|
20785
20433
|
_context14.p = 13;
|
|
20786
|
-
|
|
20787
|
-
log.error('error in message attachment query',
|
|
20434
|
+
_t12 = _context14.v;
|
|
20435
|
+
log.error('error in message attachment query', _t12);
|
|
20788
20436
|
case 14:
|
|
20789
20437
|
return _context14.a(2);
|
|
20790
20438
|
}
|
|
20791
20439
|
}, _marked12$1, null, [[0, 13]]);
|
|
20792
20440
|
}
|
|
20793
20441
|
function loadMoreMessageAttachments(action) {
|
|
20794
|
-
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext,
|
|
20442
|
+
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext, _t13;
|
|
20795
20443
|
return _regenerator().w(function (_context15) {
|
|
20796
20444
|
while (1) switch (_context15.p = _context15.n) {
|
|
20797
20445
|
case 0:
|
|
@@ -20835,15 +20483,15 @@ function loadMoreMessageAttachments(action) {
|
|
|
20835
20483
|
break;
|
|
20836
20484
|
case 8:
|
|
20837
20485
|
_context15.p = 8;
|
|
20838
|
-
|
|
20839
|
-
log.error('error in message attachment query',
|
|
20486
|
+
_t13 = _context15.v;
|
|
20487
|
+
log.error('error in message attachment query', _t13);
|
|
20840
20488
|
case 9:
|
|
20841
20489
|
return _context15.a(2);
|
|
20842
20490
|
}
|
|
20843
20491
|
}, _marked13$1, null, [[0, 8]]);
|
|
20844
20492
|
}
|
|
20845
20493
|
function pauseAttachmentUploading(action) {
|
|
20846
|
-
var attachmentId, isPaused,
|
|
20494
|
+
var attachmentId, isPaused, _t14;
|
|
20847
20495
|
return _regenerator().w(function (_context16) {
|
|
20848
20496
|
while (1) switch (_context16.p = _context16.n) {
|
|
20849
20497
|
case 0:
|
|
@@ -20865,15 +20513,15 @@ function pauseAttachmentUploading(action) {
|
|
|
20865
20513
|
break;
|
|
20866
20514
|
case 2:
|
|
20867
20515
|
_context16.p = 2;
|
|
20868
|
-
|
|
20869
|
-
log.error('error in pause attachment uploading',
|
|
20516
|
+
_t14 = _context16.v;
|
|
20517
|
+
log.error('error in pause attachment uploading', _t14);
|
|
20870
20518
|
case 3:
|
|
20871
20519
|
return _context16.a(2);
|
|
20872
20520
|
}
|
|
20873
20521
|
}, _marked14$1, null, [[0, 2]]);
|
|
20874
20522
|
}
|
|
20875
20523
|
function resumeAttachmentUploading(action) {
|
|
20876
|
-
var attachmentId, isResumed,
|
|
20524
|
+
var attachmentId, isResumed, _t15;
|
|
20877
20525
|
return _regenerator().w(function (_context17) {
|
|
20878
20526
|
while (1) switch (_context17.p = _context17.n) {
|
|
20879
20527
|
case 0:
|
|
@@ -20896,15 +20544,15 @@ function resumeAttachmentUploading(action) {
|
|
|
20896
20544
|
break;
|
|
20897
20545
|
case 2:
|
|
20898
20546
|
_context17.p = 2;
|
|
20899
|
-
|
|
20900
|
-
log.error('error in resume attachment uploading',
|
|
20547
|
+
_t15 = _context17.v;
|
|
20548
|
+
log.error('error in resume attachment uploading', _t15);
|
|
20901
20549
|
case 3:
|
|
20902
20550
|
return _context17.a(2);
|
|
20903
20551
|
}
|
|
20904
20552
|
}, _marked15$1, null, [[0, 2]]);
|
|
20905
20553
|
}
|
|
20906
20554
|
function getMessageMarkers(action) {
|
|
20907
|
-
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers,
|
|
20555
|
+
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers, _t16;
|
|
20908
20556
|
return _regenerator().w(function (_context18) {
|
|
20909
20557
|
while (1) switch (_context18.p = _context18.n) {
|
|
20910
20558
|
case 0:
|
|
@@ -20934,8 +20582,8 @@ function getMessageMarkers(action) {
|
|
|
20934
20582
|
break;
|
|
20935
20583
|
case 5:
|
|
20936
20584
|
_context18.p = 5;
|
|
20937
|
-
|
|
20938
|
-
log.error('error in get message markers',
|
|
20585
|
+
_t16 = _context18.v;
|
|
20586
|
+
log.error('error in get message markers', _t16);
|
|
20939
20587
|
case 6:
|
|
20940
20588
|
_context18.p = 6;
|
|
20941
20589
|
_context18.n = 7;
|
|
@@ -21073,13 +20721,13 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
|
21073
20721
|
}, _marked18$1);
|
|
21074
20722
|
}
|
|
21075
20723
|
function addPollVote(action) {
|
|
21076
|
-
var payload, channelId, pollId, optionId,
|
|
20724
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence2, connectionState, user, vote, pendingAction, conflictCheck, channel, _Object$values2, _store$getState$Messa, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj, _t17;
|
|
21077
20725
|
return _regenerator().w(function (_context21) {
|
|
21078
20726
|
while (1) switch (_context21.p = _context21.n) {
|
|
21079
20727
|
case 0:
|
|
21080
20728
|
_context21.p = 0;
|
|
21081
20729
|
payload = action.payload;
|
|
21082
|
-
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId,
|
|
20730
|
+
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, message = payload.message, isResend = payload.isResend;
|
|
21083
20731
|
sceytChatClient = getClient();
|
|
21084
20732
|
if (!sceytChatClient) {
|
|
21085
20733
|
_context21.n = 7;
|
|
@@ -21117,7 +20765,7 @@ function addPollVote(action) {
|
|
|
21117
20765
|
channelId: channelId,
|
|
21118
20766
|
pollId: pollId,
|
|
21119
20767
|
optionId: optionId,
|
|
21120
|
-
message:
|
|
20768
|
+
message: message
|
|
21121
20769
|
};
|
|
21122
20770
|
conflictCheck = checkPendingPollActionConflict(pendingAction);
|
|
21123
20771
|
if (!(conflictCheck.hasConflict && !conflictCheck.shouldSkip)) {
|
|
@@ -21133,11 +20781,11 @@ function addPollVote(action) {
|
|
|
21133
20781
|
break;
|
|
21134
20782
|
}
|
|
21135
20783
|
currentMessage = ((_Object$values2 = Object.values(getMessagesFromMap(channelId) || {})) === null || _Object$values2 === void 0 ? void 0 : _Object$values2.find(function (msg) {
|
|
21136
|
-
return msg.id ===
|
|
21137
|
-
})) ||
|
|
20784
|
+
return msg.id === message.id || msg.tid === message.id;
|
|
20785
|
+
})) || message;
|
|
21138
20786
|
hasNext = ((_store$getState$Messa = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa === void 0 ? void 0 : _store$getState$Messa[pollId]) || false;
|
|
21139
20787
|
_context21.n = 2;
|
|
21140
|
-
return put(addPollVotesToListAC(pollId, optionId, [(_currentMessage$pollD = currentMessage.pollDetails) === null || _currentMessage$pollD === void 0 ? void 0 : (_currentMessage$pollD2 = _currentMessage$pollD.voteDetails) === null || _currentMessage$pollD2 === void 0 ? void 0 : (_currentMessage$pollD3 = _currentMessage$pollD2.ownVotes) === null || _currentMessage$pollD3 === void 0 ? void 0 : _currentMessage$pollD3[0]], hasNext,
|
|
20788
|
+
return put(addPollVotesToListAC(pollId, optionId, [(_currentMessage$pollD = currentMessage.pollDetails) === null || _currentMessage$pollD === void 0 ? void 0 : (_currentMessage$pollD2 = _currentMessage$pollD.voteDetails) === null || _currentMessage$pollD2 === void 0 ? void 0 : (_currentMessage$pollD3 = _currentMessage$pollD2.ownVotes) === null || _currentMessage$pollD3 === void 0 ? void 0 : _currentMessage$pollD3[0]], hasNext, message.id));
|
|
21141
20789
|
case 2:
|
|
21142
20790
|
obj = {
|
|
21143
20791
|
type: 'addOwn',
|
|
@@ -21145,12 +20793,12 @@ function addPollVote(action) {
|
|
|
21145
20793
|
incrementVotesPerOptionCount: 1
|
|
21146
20794
|
};
|
|
21147
20795
|
updateMessageOnMap(channel.id, {
|
|
21148
|
-
messageId:
|
|
20796
|
+
messageId: message.id,
|
|
21149
20797
|
params: {}
|
|
21150
20798
|
}, obj);
|
|
21151
|
-
updateMessageOnAllMessages(
|
|
20799
|
+
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21152
20800
|
_context21.n = 3;
|
|
21153
|
-
return put(updateMessageAC(
|
|
20801
|
+
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21154
20802
|
case 3:
|
|
21155
20803
|
_context21.n = 5;
|
|
21156
20804
|
break;
|
|
@@ -21159,21 +20807,21 @@ function addPollVote(action) {
|
|
|
21159
20807
|
_context21.n = 5;
|
|
21160
20808
|
break;
|
|
21161
20809
|
}
|
|
21162
|
-
return _context21.d(_regeneratorValues(updateMessageOptimisticallyForAddPollVote(channelId,
|
|
20810
|
+
return _context21.d(_regeneratorValues(updateMessageOptimisticallyForAddPollVote(channelId, message, vote)), 5);
|
|
21163
20811
|
case 5:
|
|
21164
20812
|
if (!conflictCheck.shouldSkip) {
|
|
21165
20813
|
setPendingPollAction(pendingAction);
|
|
21166
20814
|
}
|
|
21167
20815
|
return _context21.a(2);
|
|
21168
20816
|
case 6:
|
|
21169
|
-
return _context21.d(_regeneratorValues(executeAddPollVote(channelId, pollId, optionId,
|
|
20817
|
+
return _context21.d(_regeneratorValues(executeAddPollVote(channelId, pollId, optionId, message, isResend)), 7);
|
|
21170
20818
|
case 7:
|
|
21171
20819
|
_context21.n = 9;
|
|
21172
20820
|
break;
|
|
21173
20821
|
case 8:
|
|
21174
20822
|
_context21.p = 8;
|
|
21175
|
-
|
|
21176
|
-
log.error('error in add poll vote',
|
|
20823
|
+
_t17 = _context21.v;
|
|
20824
|
+
log.error('error in add poll vote', _t17);
|
|
21177
20825
|
case 9:
|
|
21178
20826
|
return _context21.a(2);
|
|
21179
20827
|
}
|
|
@@ -21274,20 +20922,20 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
|
|
|
21274
20922
|
}, _marked21$1);
|
|
21275
20923
|
}
|
|
21276
20924
|
function deletePollVote(action) {
|
|
21277
|
-
var payload, channelId, pollId, optionId,
|
|
20925
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11, connectionState, vote, pendingAction, conflictCheck, channel, _Object$values3, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj, _t18;
|
|
21278
20926
|
return _regenerator().w(function (_context24) {
|
|
21279
20927
|
while (1) switch (_context24.p = _context24.n) {
|
|
21280
20928
|
case 0:
|
|
21281
20929
|
_context24.p = 0;
|
|
21282
20930
|
payload = action.payload;
|
|
21283
|
-
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId,
|
|
20931
|
+
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, message = payload.message, isResend = payload.isResend;
|
|
21284
20932
|
sceytChatClient = getClient();
|
|
21285
20933
|
if (!sceytChatClient) {
|
|
21286
20934
|
_context24.n = 8;
|
|
21287
20935
|
break;
|
|
21288
20936
|
}
|
|
21289
20937
|
connectionState = sceytChatClient.connectionState;
|
|
21290
|
-
vote = (
|
|
20938
|
+
vote = (_message$pollDetails1 = message.pollDetails) === null || _message$pollDetails1 === void 0 ? void 0 : (_message$pollDetails10 = _message$pollDetails1.voteDetails) === null || _message$pollDetails10 === void 0 ? void 0 : (_message$pollDetails11 = _message$pollDetails10.ownVotes) === null || _message$pollDetails11 === void 0 ? void 0 : _message$pollDetails11.find(function (vote) {
|
|
21291
20939
|
return vote.optionId === optionId;
|
|
21292
20940
|
});
|
|
21293
20941
|
if (vote) {
|
|
@@ -21305,7 +20953,7 @@ function deletePollVote(action) {
|
|
|
21305
20953
|
channelId: channelId,
|
|
21306
20954
|
pollId: pollId,
|
|
21307
20955
|
optionId: optionId,
|
|
21308
|
-
message:
|
|
20956
|
+
message: message
|
|
21309
20957
|
};
|
|
21310
20958
|
conflictCheck = checkPendingPollActionConflict(pendingAction);
|
|
21311
20959
|
if (!(conflictCheck.hasConflict && conflictCheck.shouldSkip)) {
|
|
@@ -21321,10 +20969,10 @@ function deletePollVote(action) {
|
|
|
21321
20969
|
break;
|
|
21322
20970
|
}
|
|
21323
20971
|
currentMessage = ((_Object$values3 = Object.values(getMessagesFromMap(channelId) || {})) === null || _Object$values3 === void 0 ? void 0 : _Object$values3.find(function (msg) {
|
|
21324
|
-
return msg.id ===
|
|
21325
|
-
})) ||
|
|
20972
|
+
return msg.id === message.id || msg.tid === message.id;
|
|
20973
|
+
})) || message;
|
|
21326
20974
|
_context24.n = 3;
|
|
21327
|
-
return put(deletePollVotesFromListAC(pollId, optionId, [(_currentMessage$pollD4 = currentMessage.pollDetails) === null || _currentMessage$pollD4 === void 0 ? void 0 : (_currentMessage$pollD5 = _currentMessage$pollD4.voteDetails) === null || _currentMessage$pollD5 === void 0 ? void 0 : (_currentMessage$pollD6 = _currentMessage$pollD5.ownVotes) === null || _currentMessage$pollD6 === void 0 ? void 0 : _currentMessage$pollD6[0]],
|
|
20975
|
+
return put(deletePollVotesFromListAC(pollId, optionId, [(_currentMessage$pollD4 = currentMessage.pollDetails) === null || _currentMessage$pollD4 === void 0 ? void 0 : (_currentMessage$pollD5 = _currentMessage$pollD4.voteDetails) === null || _currentMessage$pollD5 === void 0 ? void 0 : (_currentMessage$pollD6 = _currentMessage$pollD5.ownVotes) === null || _currentMessage$pollD6 === void 0 ? void 0 : _currentMessage$pollD6[0]], message.id));
|
|
21328
20976
|
case 3:
|
|
21329
20977
|
obj = {
|
|
21330
20978
|
type: 'deleteOwn',
|
|
@@ -21332,12 +20980,12 @@ function deletePollVote(action) {
|
|
|
21332
20980
|
incrementVotesPerOptionCount: -1
|
|
21333
20981
|
};
|
|
21334
20982
|
updateMessageOnMap(channel.id, {
|
|
21335
|
-
messageId:
|
|
20983
|
+
messageId: message.id,
|
|
21336
20984
|
params: {}
|
|
21337
20985
|
}, obj);
|
|
21338
|
-
updateMessageOnAllMessages(
|
|
20986
|
+
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21339
20987
|
_context24.n = 4;
|
|
21340
|
-
return put(updateMessageAC(
|
|
20988
|
+
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21341
20989
|
case 4:
|
|
21342
20990
|
_context24.n = 6;
|
|
21343
20991
|
break;
|
|
@@ -21346,21 +20994,21 @@ function deletePollVote(action) {
|
|
|
21346
20994
|
_context24.n = 6;
|
|
21347
20995
|
break;
|
|
21348
20996
|
}
|
|
21349
|
-
return _context24.d(_regeneratorValues(updateMessageOptimisticallyForDeletePollVote(channelId,
|
|
20997
|
+
return _context24.d(_regeneratorValues(updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)), 6);
|
|
21350
20998
|
case 6:
|
|
21351
20999
|
if (!conflictCheck.shouldSkip) {
|
|
21352
21000
|
setPendingPollAction(pendingAction);
|
|
21353
21001
|
}
|
|
21354
21002
|
return _context24.a(2);
|
|
21355
21003
|
case 7:
|
|
21356
|
-
return _context24.d(_regeneratorValues(executeDeletePollVote(channelId, pollId, optionId,
|
|
21004
|
+
return _context24.d(_regeneratorValues(executeDeletePollVote(channelId, pollId, optionId, message, isResend)), 8);
|
|
21357
21005
|
case 8:
|
|
21358
21006
|
_context24.n = 10;
|
|
21359
21007
|
break;
|
|
21360
21008
|
case 9:
|
|
21361
21009
|
_context24.p = 9;
|
|
21362
|
-
|
|
21363
|
-
log.error('error in delete poll vote',
|
|
21010
|
+
_t18 = _context24.v;
|
|
21011
|
+
log.error('error in delete poll vote', _t18);
|
|
21364
21012
|
case 10:
|
|
21365
21013
|
return _context24.a(2);
|
|
21366
21014
|
}
|
|
@@ -21438,13 +21086,13 @@ function updateMessageOptimisticallyForClosePoll(channelId, message) {
|
|
|
21438
21086
|
}, _marked24$1);
|
|
21439
21087
|
}
|
|
21440
21088
|
function closePoll(action) {
|
|
21441
|
-
var payload, channelId, pollId,
|
|
21089
|
+
var payload, channelId, pollId, message, sceytChatClient, connectionState, _t19;
|
|
21442
21090
|
return _regenerator().w(function (_context27) {
|
|
21443
21091
|
while (1) switch (_context27.p = _context27.n) {
|
|
21444
21092
|
case 0:
|
|
21445
21093
|
_context27.p = 0;
|
|
21446
21094
|
payload = action.payload;
|
|
21447
|
-
channelId = payload.channelId, pollId = payload.pollId,
|
|
21095
|
+
channelId = payload.channelId, pollId = payload.pollId, message = payload.message;
|
|
21448
21096
|
sceytChatClient = getClient();
|
|
21449
21097
|
if (!sceytChatClient) {
|
|
21450
21098
|
_context27.n = 3;
|
|
@@ -21455,24 +21103,24 @@ function closePoll(action) {
|
|
|
21455
21103
|
_context27.n = 2;
|
|
21456
21104
|
break;
|
|
21457
21105
|
}
|
|
21458
|
-
return _context27.d(_regeneratorValues(updateMessageOptimisticallyForClosePoll(channelId,
|
|
21106
|
+
return _context27.d(_regeneratorValues(updateMessageOptimisticallyForClosePoll(channelId, message)), 1);
|
|
21459
21107
|
case 1:
|
|
21460
21108
|
setPendingPollAction({
|
|
21461
21109
|
type: 'CLOSE_POLL',
|
|
21462
21110
|
channelId: channelId,
|
|
21463
21111
|
pollId: pollId,
|
|
21464
|
-
message:
|
|
21112
|
+
message: message
|
|
21465
21113
|
});
|
|
21466
21114
|
return _context27.a(2);
|
|
21467
21115
|
case 2:
|
|
21468
|
-
return _context27.d(_regeneratorValues(executeClosePoll(channelId, pollId,
|
|
21116
|
+
return _context27.d(_regeneratorValues(executeClosePoll(channelId, pollId, message)), 3);
|
|
21469
21117
|
case 3:
|
|
21470
21118
|
_context27.n = 5;
|
|
21471
21119
|
break;
|
|
21472
21120
|
case 4:
|
|
21473
21121
|
_context27.p = 4;
|
|
21474
|
-
|
|
21475
|
-
log.error('error in close poll',
|
|
21122
|
+
_t19 = _context27.v;
|
|
21123
|
+
log.error('error in close poll', _t19);
|
|
21476
21124
|
case 5:
|
|
21477
21125
|
return _context27.a(2);
|
|
21478
21126
|
}
|
|
@@ -21561,13 +21209,13 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
|
|
|
21561
21209
|
}, _marked27$1);
|
|
21562
21210
|
}
|
|
21563
21211
|
function retractPollVote(action) {
|
|
21564
|
-
var payload, channelId, pollId,
|
|
21212
|
+
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator4, _step4, _message$pollDetails12, _message$pollDetails13, vote, _t20;
|
|
21565
21213
|
return _regenerator().w(function (_context30) {
|
|
21566
21214
|
while (1) switch (_context30.p = _context30.n) {
|
|
21567
21215
|
case 0:
|
|
21568
21216
|
_context30.p = 0;
|
|
21569
21217
|
payload = action.payload;
|
|
21570
|
-
channelId = payload.channelId, pollId = payload.pollId,
|
|
21218
|
+
channelId = payload.channelId, pollId = payload.pollId, message = payload.message, isResend = payload.isResend;
|
|
21571
21219
|
sceytChatClient = getClient();
|
|
21572
21220
|
if (!sceytChatClient) {
|
|
21573
21221
|
_context30.n = 3;
|
|
@@ -21575,7 +21223,7 @@ function retractPollVote(action) {
|
|
|
21575
21223
|
}
|
|
21576
21224
|
connectionState = sceytChatClient.connectionState;
|
|
21577
21225
|
objs = [];
|
|
21578
|
-
for (_iterator4 = _createForOfIteratorHelperLoose(((
|
|
21226
|
+
for (_iterator4 = _createForOfIteratorHelperLoose(((_message$pollDetails12 = message.pollDetails) === null || _message$pollDetails12 === void 0 ? void 0 : (_message$pollDetails13 = _message$pollDetails12.voteDetails) === null || _message$pollDetails13 === void 0 ? void 0 : _message$pollDetails13.ownVotes) || []); !(_step4 = _iterator4()).done;) {
|
|
21579
21227
|
vote = _step4.value;
|
|
21580
21228
|
objs.push({
|
|
21581
21229
|
type: 'deleteOwn',
|
|
@@ -21587,31 +21235,31 @@ function retractPollVote(action) {
|
|
|
21587
21235
|
_context30.n = 2;
|
|
21588
21236
|
break;
|
|
21589
21237
|
}
|
|
21590
|
-
return _context30.d(_regeneratorValues(updateMessageOptimisticallyForRetractPollVote(channelId,
|
|
21238
|
+
return _context30.d(_regeneratorValues(updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)), 1);
|
|
21591
21239
|
case 1:
|
|
21592
21240
|
setPendingPollAction({
|
|
21593
21241
|
type: 'RETRACT_POLL_VOTE',
|
|
21594
21242
|
channelId: channelId,
|
|
21595
21243
|
pollId: pollId,
|
|
21596
|
-
message:
|
|
21244
|
+
message: message
|
|
21597
21245
|
});
|
|
21598
21246
|
return _context30.a(2);
|
|
21599
21247
|
case 2:
|
|
21600
|
-
return _context30.d(_regeneratorValues(executeRetractPollVote(channelId, pollId,
|
|
21248
|
+
return _context30.d(_regeneratorValues(executeRetractPollVote(channelId, pollId, message, objs, isResend)), 3);
|
|
21601
21249
|
case 3:
|
|
21602
21250
|
_context30.n = 5;
|
|
21603
21251
|
break;
|
|
21604
21252
|
case 4:
|
|
21605
21253
|
_context30.p = 4;
|
|
21606
|
-
|
|
21607
|
-
log.error('error in retract poll vote',
|
|
21254
|
+
_t20 = _context30.v;
|
|
21255
|
+
log.error('error in retract poll vote', _t20);
|
|
21608
21256
|
case 5:
|
|
21609
21257
|
return _context30.a(2);
|
|
21610
21258
|
}
|
|
21611
21259
|
}, _marked28$1, null, [[0, 4]]);
|
|
21612
21260
|
}
|
|
21613
21261
|
function resendPendingPollActions(action) {
|
|
21614
|
-
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy,
|
|
21262
|
+
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy, _t21;
|
|
21615
21263
|
return _regenerator().w(function (_context31) {
|
|
21616
21264
|
while (1) switch (_context31.p = _context31.n) {
|
|
21617
21265
|
case 0:
|
|
@@ -21667,15 +21315,15 @@ function resendPendingPollActions(action) {
|
|
|
21667
21315
|
break;
|
|
21668
21316
|
case 3:
|
|
21669
21317
|
_context31.p = 3;
|
|
21670
|
-
|
|
21671
|
-
log.error('error in resend pending poll actions',
|
|
21318
|
+
_t21 = _context31.v;
|
|
21319
|
+
log.error('error in resend pending poll actions', _t21);
|
|
21672
21320
|
case 4:
|
|
21673
21321
|
return _context31.a(2);
|
|
21674
21322
|
}
|
|
21675
21323
|
}, _marked29$1, null, [[0, 3]]);
|
|
21676
21324
|
}
|
|
21677
21325
|
function getPollVotes(action) {
|
|
21678
|
-
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes,
|
|
21326
|
+
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes, _t22;
|
|
21679
21327
|
return _regenerator().w(function (_context32) {
|
|
21680
21328
|
while (1) switch (_context32.p = _context32.n) {
|
|
21681
21329
|
case 0:
|
|
@@ -21741,8 +21389,8 @@ function getPollVotes(action) {
|
|
|
21741
21389
|
break;
|
|
21742
21390
|
case 7:
|
|
21743
21391
|
_context32.p = 7;
|
|
21744
|
-
|
|
21745
|
-
log.error('ERROR in get poll votes',
|
|
21392
|
+
_t22 = _context32.v;
|
|
21393
|
+
log.error('ERROR in get poll votes', _t22);
|
|
21746
21394
|
_context32.n = 8;
|
|
21747
21395
|
return put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
21748
21396
|
case 8:
|
|
@@ -21751,7 +21399,7 @@ function getPollVotes(action) {
|
|
|
21751
21399
|
}, _marked30$1, null, [[0, 7]]);
|
|
21752
21400
|
}
|
|
21753
21401
|
function loadMorePollVotes(action) {
|
|
21754
|
-
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes,
|
|
21402
|
+
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes, _t23;
|
|
21755
21403
|
return _regenerator().w(function (_context33) {
|
|
21756
21404
|
while (1) switch (_context33.p = _context33.n) {
|
|
21757
21405
|
case 0:
|
|
@@ -21809,8 +21457,8 @@ function loadMorePollVotes(action) {
|
|
|
21809
21457
|
break;
|
|
21810
21458
|
case 6:
|
|
21811
21459
|
_context33.p = 6;
|
|
21812
|
-
|
|
21813
|
-
log.error('ERROR in load more poll votes',
|
|
21460
|
+
_t23 = _context33.v;
|
|
21461
|
+
log.error('ERROR in load more poll votes', _t23);
|
|
21814
21462
|
_context33.n = 7;
|
|
21815
21463
|
return put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
21816
21464
|
case 7:
|
|
@@ -27245,6 +26893,106 @@ var MobileBackButtonWrapper = styled.span(_templateObject8$6 || (_templateObject
|
|
|
27245
26893
|
var DefaultInfoIcon = styled(SvgInfo)(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteralLoose([""])));
|
|
27246
26894
|
var WrapArrowLeftIcon = styled(SvgArrowLeft)(_templateObject0$4 || (_templateObject0$4 = _taggedTemplateLiteralLoose([""])));
|
|
27247
26895
|
|
|
26896
|
+
var activeChannelMessagesSelector = function activeChannelMessagesSelector(store) {
|
|
26897
|
+
return store.MessageReducer.activeChannelMessages;
|
|
26898
|
+
};
|
|
26899
|
+
var messagesLoadingState = function messagesLoadingState(store) {
|
|
26900
|
+
return store.MessageReducer.messagesLoadingState;
|
|
26901
|
+
};
|
|
26902
|
+
var messagesHasNextSelector = function messagesHasNextSelector(store) {
|
|
26903
|
+
return store.MessageReducer.messagesHasNext;
|
|
26904
|
+
};
|
|
26905
|
+
var messagesHasPrevSelector = function messagesHasPrevSelector(store) {
|
|
26906
|
+
return store.MessageReducer.messagesHasPrev;
|
|
26907
|
+
};
|
|
26908
|
+
var attachmentCompilationStateSelector = function attachmentCompilationStateSelector(store) {
|
|
26909
|
+
return store.MessageReducer.attachmentsUploadingState;
|
|
26910
|
+
};
|
|
26911
|
+
var attachmentsUploadProgressSelector = function attachmentsUploadProgressSelector(store) {
|
|
26912
|
+
return store.MessageReducer.attachmentsUploadingProgress;
|
|
26913
|
+
};
|
|
26914
|
+
var activeTabAttachmentsSelector = function activeTabAttachmentsSelector(store) {
|
|
26915
|
+
return store.MessageReducer.activeTabAttachments;
|
|
26916
|
+
};
|
|
26917
|
+
var activeTabAttachmentsHasNextSelector = function activeTabAttachmentsHasNextSelector(store) {
|
|
26918
|
+
return store.MessageReducer.attachmentHasNext;
|
|
26919
|
+
};
|
|
26920
|
+
var attachmentsForPopupSelector = function attachmentsForPopupSelector(store) {
|
|
26921
|
+
return store.MessageReducer.attachmentsForPopup;
|
|
26922
|
+
};
|
|
26923
|
+
var messageForReplySelector = function messageForReplySelector(store) {
|
|
26924
|
+
return store.MessageReducer.messageForReply;
|
|
26925
|
+
};
|
|
26926
|
+
var messageToEditSelector = function messageToEditSelector(store) {
|
|
26927
|
+
return store.MessageReducer.messageToEdit;
|
|
26928
|
+
};
|
|
26929
|
+
var scrollToNewMessageSelector = function scrollToNewMessageSelector(store) {
|
|
26930
|
+
return store.MessageReducer.scrollToNewMessage;
|
|
26931
|
+
};
|
|
26932
|
+
var scrollToMentionedMessageSelector = function scrollToMentionedMessageSelector(store) {
|
|
26933
|
+
return store.MessageReducer.scrollToMentionedMessage;
|
|
26934
|
+
};
|
|
26935
|
+
var showScrollToNewMessageButtonSelector = function showScrollToNewMessageButtonSelector(store) {
|
|
26936
|
+
return store.MessageReducer.showScrollToNewMessageButton;
|
|
26937
|
+
};
|
|
26938
|
+
var sendMessageInputHeightSelector = function sendMessageInputHeightSelector(store) {
|
|
26939
|
+
return store.MessageReducer.sendMessageInputHeight;
|
|
26940
|
+
};
|
|
26941
|
+
var scrollToMessageSelector = function scrollToMessageSelector(store) {
|
|
26942
|
+
return store.MessageReducer.scrollToMessage;
|
|
26943
|
+
};
|
|
26944
|
+
var scrollToMessageHighlightSelector = function scrollToMessageHighlightSelector(store) {
|
|
26945
|
+
return store.MessageReducer.scrollToMessageHighlight;
|
|
26946
|
+
};
|
|
26947
|
+
var scrollToMessageBehaviorSelector = function scrollToMessageBehaviorSelector(store) {
|
|
26948
|
+
return store.MessageReducer.scrollToMessageBehavior;
|
|
26949
|
+
};
|
|
26950
|
+
var reactionsListSelector = function reactionsListSelector(store) {
|
|
26951
|
+
return store.MessageReducer.reactionsList;
|
|
26952
|
+
};
|
|
26953
|
+
var reactionsHasNextSelector = function reactionsHasNextSelector(store) {
|
|
26954
|
+
return store.MessageReducer.reactionsHasNext;
|
|
26955
|
+
};
|
|
26956
|
+
var reactionsLoadingStateSelector = function reactionsLoadingStateSelector(store) {
|
|
26957
|
+
return store.MessageReducer.reactionsLoadingState;
|
|
26958
|
+
};
|
|
26959
|
+
var openedMessageMenuSelector = function openedMessageMenuSelector(store) {
|
|
26960
|
+
return store.MessageReducer.openedMessageMenu;
|
|
26961
|
+
};
|
|
26962
|
+
var playingAudioIdSelector = function playingAudioIdSelector(store) {
|
|
26963
|
+
return store.MessageReducer.playingAudioId;
|
|
26964
|
+
};
|
|
26965
|
+
var selectedMessagesMapSelector = function selectedMessagesMapSelector(store) {
|
|
26966
|
+
return store.MessageReducer.selectedMessagesMap;
|
|
26967
|
+
};
|
|
26968
|
+
var attachmentUpdatedMapSelector = function attachmentUpdatedMapSelector(store) {
|
|
26969
|
+
return store.MessageReducer.attachmentUpdatedMap;
|
|
26970
|
+
};
|
|
26971
|
+
var messageMarkersSelector = function messageMarkersSelector(store) {
|
|
26972
|
+
return store.MessageReducer.messageMarkers;
|
|
26973
|
+
};
|
|
26974
|
+
var messagesMarkersLoadingStateSelector = function messagesMarkersLoadingStateSelector(store) {
|
|
26975
|
+
return store.MessageReducer.messagesMarkersLoadingState;
|
|
26976
|
+
};
|
|
26977
|
+
var pollVotesListSelector = function pollVotesListSelector(store) {
|
|
26978
|
+
return store.MessageReducer.pollVotesList;
|
|
26979
|
+
};
|
|
26980
|
+
var pollVotesHasMoreSelector = function pollVotesHasMoreSelector(store) {
|
|
26981
|
+
return store.MessageReducer.pollVotesHasMore;
|
|
26982
|
+
};
|
|
26983
|
+
var pollVotesLoadingStateSelector = function pollVotesLoadingStateSelector(store) {
|
|
26984
|
+
return store.MessageReducer.pollVotesLoadingState;
|
|
26985
|
+
};
|
|
26986
|
+
var pendingPollActionsSelector = function pendingPollActionsSelector(store) {
|
|
26987
|
+
return store.MessageReducer.pendingPollActions;
|
|
26988
|
+
};
|
|
26989
|
+
var pendingMessagesMapSelector = function pendingMessagesMapSelector(store) {
|
|
26990
|
+
return store.MessageReducer.pendingMessagesMap;
|
|
26991
|
+
};
|
|
26992
|
+
var unreadScrollToSelector = function unreadScrollToSelector(store) {
|
|
26993
|
+
return store.MessageReducer.unreadScrollTo;
|
|
26994
|
+
};
|
|
26995
|
+
|
|
27248
26996
|
var _path$u;
|
|
27249
26997
|
function _extends$v() {
|
|
27250
26998
|
return _extends$v = Object.assign ? Object.assign.bind() : function (n) {
|
|
@@ -30171,7 +29919,7 @@ var VideoPreview = /*#__PURE__*/memo(function VideoPreview(_ref) {
|
|
|
30171
29919
|
var withPrefix = true;
|
|
30172
29920
|
if (file.metadata && file.metadata.tmb) {
|
|
30173
29921
|
if (file.metadata.tmb.length < 70) {
|
|
30174
|
-
attachmentThumb =
|
|
29922
|
+
attachmentThumb = base64ToDataURL(file.metadata.tmb);
|
|
30175
29923
|
withPrefix = false;
|
|
30176
29924
|
} else {
|
|
30177
29925
|
attachmentThumb = file.metadata && file.metadata.tmb;
|
|
@@ -32429,7 +32177,6 @@ var AudioPlayer = function AudioPlayer(_ref) {
|
|
|
32429
32177
|
return clearInterval(recordingInterval);
|
|
32430
32178
|
};
|
|
32431
32179
|
}, [recording.initRecording]);
|
|
32432
|
-
console.log('file', file === null || file === void 0 ? void 0 : file.metadata);
|
|
32433
32180
|
useEffect(function () {
|
|
32434
32181
|
if (url) {
|
|
32435
32182
|
if (url !== '_' && !isRendered && wavesurfer && wavesurfer.current) {
|
|
@@ -32663,7 +32410,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
32663
32410
|
if (attachment.type !== attachmentTypes.voice && attachment.type !== attachmentTypes.link && attachmentMetadata && attachmentMetadata.tmb) {
|
|
32664
32411
|
try {
|
|
32665
32412
|
if (attachmentMetadata.tmb.length < 70) {
|
|
32666
|
-
attachmentThumb =
|
|
32413
|
+
attachmentThumb = base64ToDataURL(attachmentMetadata.tmb);
|
|
32667
32414
|
withPrefix = false;
|
|
32668
32415
|
} else {
|
|
32669
32416
|
attachmentThumb = attachmentMetadata && attachmentMetadata.tmb;
|
|
@@ -34900,8 +34647,12 @@ var validateUrl = function validateUrl(url) {
|
|
|
34900
34647
|
return false;
|
|
34901
34648
|
}
|
|
34902
34649
|
};
|
|
34650
|
+
var isDescriptionOnlySymbol = function isDescriptionOnlySymbol(description) {
|
|
34651
|
+
var trimmed = description === null || description === void 0 ? void 0 : description.trim();
|
|
34652
|
+
return !!trimmed && !/[a-zA-Z0-9]/.test(trimmed);
|
|
34653
|
+
};
|
|
34903
34654
|
var OGMetadata = function OGMetadata(_ref) {
|
|
34904
|
-
var _metadata$og0, _metadata$og0$image, _metadata$og0$image$, _metadata$og10, _metadata$og10$favico, _metadata$
|
|
34655
|
+
var _metadata$og0, _metadata$og0$image, _metadata$og0$image$, _metadata$og10, _metadata$og10$favico, _metadata$og18, _metadata$og19, _metadata$og20;
|
|
34905
34656
|
var attachments = _ref.attachments,
|
|
34906
34657
|
state = _ref.state,
|
|
34907
34658
|
incoming = _ref.incoming,
|
|
@@ -35145,7 +34896,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
35145
34896
|
}
|
|
35146
34897
|
}, [metadataLoaded, oGMetadata, attachment === null || attachment === void 0 ? void 0 : attachment.url, metadata]);
|
|
35147
34898
|
var elements = useMemo(function () {
|
|
35148
|
-
var _resolvedOrder$image, _metadata$og11, _metadata$og11$image, _metadata$og11$image$, _resolvedOrder$title, _metadata$og12, _metadata$og13, _metadata$
|
|
34899
|
+
var _resolvedOrder$image, _metadata$og11, _metadata$og11$image, _metadata$og11$image$, _resolvedOrder$title, _metadata$og12, _metadata$og13, _metadata$og14, _metadata$og14$title, _resolvedOrder$descri, _metadata$og15, _metadata$og16, _metadata$og17, _metadata$og17$descri, _resolvedOrder$link;
|
|
35149
34900
|
return [showImage ? {
|
|
35150
34901
|
key: 'image',
|
|
35151
34902
|
order: (_resolvedOrder$image = resolvedOrder === null || resolvedOrder === void 0 ? void 0 : resolvedOrder.image) != null ? _resolvedOrder$image : 1,
|
|
@@ -35164,21 +34915,21 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
35164
34915
|
} : null, {
|
|
35165
34916
|
key: 'title',
|
|
35166
34917
|
order: (_resolvedOrder$title = resolvedOrder === null || resolvedOrder === void 0 ? void 0 : resolvedOrder.title) != null ? _resolvedOrder$title : 2,
|
|
35167
|
-
render: ogShowTitle && (metadata === null || metadata === void 0 ? void 0 : (_metadata$og12 = metadata.og) === null || _metadata$og12 === void 0 ? void 0 : _metadata$og12.title) && (/*#__PURE__*/React__default.createElement(Title$3, {
|
|
34918
|
+
render: ogShowTitle && (metadata === null || metadata === void 0 ? void 0 : (_metadata$og12 = metadata.og) === null || _metadata$og12 === void 0 ? void 0 : _metadata$og12.title) && !isDescriptionOnlySymbol(metadata === null || metadata === void 0 ? void 0 : (_metadata$og13 = metadata.og) === null || _metadata$og13 === void 0 ? void 0 : _metadata$og13.description) && (/*#__PURE__*/React__default.createElement(Title$3, {
|
|
35168
34919
|
maxWidth: maxWidth,
|
|
35169
34920
|
shouldAnimate: shouldAnimate,
|
|
35170
34921
|
padding: infoPadding,
|
|
35171
34922
|
color: textPrimary
|
|
35172
|
-
}, /*#__PURE__*/React__default.createElement("span", null, metadata === null || metadata === void 0 ? void 0 : (_metadata$
|
|
34923
|
+
}, /*#__PURE__*/React__default.createElement("span", null, metadata === null || metadata === void 0 ? void 0 : (_metadata$og14 = metadata.og) === null || _metadata$og14 === void 0 ? void 0 : (_metadata$og14$title = _metadata$og14.title) === null || _metadata$og14$title === void 0 ? void 0 : _metadata$og14$title.trim())))
|
|
35173
34924
|
}, {
|
|
35174
34925
|
key: 'description',
|
|
35175
34926
|
order: (_resolvedOrder$descri = resolvedOrder === null || resolvedOrder === void 0 ? void 0 : resolvedOrder.description) != null ? _resolvedOrder$descri : 3,
|
|
35176
|
-
render: ogShowDescription && (metadata === null || metadata === void 0 ? void 0 : (_metadata$
|
|
34927
|
+
render: ogShowDescription && (metadata === null || metadata === void 0 ? void 0 : (_metadata$og15 = metadata.og) === null || _metadata$og15 === void 0 ? void 0 : _metadata$og15.description) && !isDescriptionOnlySymbol(metadata === null || metadata === void 0 ? void 0 : (_metadata$og16 = metadata.og) === null || _metadata$og16 === void 0 ? void 0 : _metadata$og16.description) && (/*#__PURE__*/React__default.createElement(Desc, {
|
|
35177
34928
|
maxWidth: maxWidth,
|
|
35178
34929
|
shouldAnimate: shouldAnimate,
|
|
35179
34930
|
color: textSecondary,
|
|
35180
34931
|
padding: infoPadding
|
|
35181
|
-
}, metadata === null || metadata === void 0 ? void 0 : (_metadata$
|
|
34932
|
+
}, metadata === null || metadata === void 0 ? void 0 : (_metadata$og17 = metadata.og) === null || _metadata$og17 === void 0 ? void 0 : (_metadata$og17$descri = _metadata$og17.description) === null || _metadata$og17$descri === void 0 ? void 0 : _metadata$og17$descri.trim()))
|
|
35182
34933
|
}, {
|
|
35183
34934
|
key: 'link',
|
|
35184
34935
|
order: (_resolvedOrder$link = resolvedOrder === null || resolvedOrder === void 0 ? void 0 : resolvedOrder.link) != null ? _resolvedOrder$link : 4,
|
|
@@ -35193,7 +34944,7 @@ var OGMetadata = function OGMetadata(_ref) {
|
|
|
35193
34944
|
var _a$order, _b$order;
|
|
35194
34945
|
return ((_a$order = a.order) != null ? _a$order : 0) - ((_b$order = b.order) != null ? _b$order : 0);
|
|
35195
34946
|
});
|
|
35196
|
-
}, [hasImage, resolvedOrder, showOGMetadata, maxWidth, calculatedImageHeight, maxHeight, metadata === null || metadata === void 0 ? void 0 : (_metadata$
|
|
34947
|
+
}, [hasImage, resolvedOrder, showOGMetadata, maxWidth, calculatedImageHeight, maxHeight, metadata === null || metadata === void 0 ? void 0 : (_metadata$og18 = metadata.og) === null || _metadata$og18 === void 0 ? void 0 : _metadata$og18.image, shouldAnimate, ogShowTitle, metadata === null || metadata === void 0 ? void 0 : (_metadata$og19 = metadata.og) === null || _metadata$og19 === void 0 ? void 0 : _metadata$og19.title, infoPadding, ogShowDescription, metadata === null || metadata === void 0 ? void 0 : (_metadata$og20 = metadata.og) === null || _metadata$og20 === void 0 ? void 0 : _metadata$og20.description, textSecondary, ogShowUrl, ogUrl]);
|
|
35197
34948
|
var textContent = useMemo(function () {
|
|
35198
34949
|
return /*#__PURE__*/React__default.createElement(OGText, {
|
|
35199
34950
|
shouldAnimate: shouldAnimate,
|
|
@@ -35292,7 +35043,7 @@ var OGText = styled.div(_templateObject3$v || (_templateObject3$v = _taggedTempl
|
|
|
35292
35043
|
var margin = _ref10.margin;
|
|
35293
35044
|
return margin ? '12px' : '0';
|
|
35294
35045
|
});
|
|
35295
|
-
var Title$3 = styled.p(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n ", "\n
|
|
35046
|
+
var Title$3 = styled.p(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n ", "\n font-weight: bold;\n font-size: 14px;\n line-height: 18px;\n letter-spacing: 0px;\n color: ", ";\n margin: 4px 0 0 0;\n padding: ", ";\n box-sizing: border-box;\n ", "\n ", "\n"])), sharedKeyframes, function (_ref11) {
|
|
35296
35047
|
var color = _ref11.color;
|
|
35297
35048
|
return color;
|
|
35298
35049
|
}, function (_ref12) {
|
|
@@ -42051,7 +41802,6 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
42051
41802
|
var updatedAttachments = attachmentsUpdate.filter(function (item) {
|
|
42052
41803
|
return item.tid !== attachmentId;
|
|
42053
41804
|
});
|
|
42054
|
-
deleteVideoThumb(attachmentId);
|
|
42055
41805
|
setAttachments(updatedAttachments);
|
|
42056
41806
|
attachmentsUpdate = updatedAttachments;
|
|
42057
41807
|
} else {
|
|
@@ -45159,7 +44909,40 @@ var RoleBadge = styled.span(_templateObject9$m || (_templateObject9$m = _taggedT
|
|
|
45159
44909
|
return props.backgroundColor;
|
|
45160
44910
|
});
|
|
45161
44911
|
|
|
45162
|
-
var _templateObject$W
|
|
44912
|
+
var _templateObject$W;
|
|
44913
|
+
var MonthHeader = function MonthHeader(_ref) {
|
|
44914
|
+
var currentCreatedAt = _ref.currentCreatedAt,
|
|
44915
|
+
previousCreatedAt = _ref.previousCreatedAt,
|
|
44916
|
+
isFirst = _ref.isFirst,
|
|
44917
|
+
padding = _ref.padding,
|
|
44918
|
+
fullWidth = _ref.fullWidth;
|
|
44919
|
+
var _useColor = useColors(),
|
|
44920
|
+
textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY];
|
|
44921
|
+
var monthComponent = useMemo(function () {
|
|
44922
|
+
var shouldShowHeader = isFirst || previousCreatedAt && new Date(currentCreatedAt).getMonth() !== new Date(previousCreatedAt).getMonth();
|
|
44923
|
+
if (!shouldShowHeader) {
|
|
44924
|
+
return null;
|
|
44925
|
+
}
|
|
44926
|
+
return /*#__PURE__*/React__default.createElement(MonthHeaderContainer, {
|
|
44927
|
+
color: textSecondary,
|
|
44928
|
+
padding: padding,
|
|
44929
|
+
fullWidth: fullWidth
|
|
44930
|
+
}, new Date(currentCreatedAt).toLocaleDateString('en-US', {
|
|
44931
|
+
month: 'long',
|
|
44932
|
+
year: 'numeric'
|
|
44933
|
+
}));
|
|
44934
|
+
}, [currentCreatedAt, previousCreatedAt, isFirst, textSecondary, padding, fullWidth]);
|
|
44935
|
+
return monthComponent;
|
|
44936
|
+
};
|
|
44937
|
+
var MonthHeaderContainer = styled.div(_templateObject$W || (_templateObject$W = _taggedTemplateLiteralLoose(["\n padding: ", ";\n width: ", ";\n font-style: normal;\n font-weight: 500;\n font-size: 13px;\n line-height: 16px;\n color: ", ";\n text-transform: uppercase;\n"])), function (props) {
|
|
44938
|
+
return props.padding || '9px 12px';
|
|
44939
|
+
}, function (props) {
|
|
44940
|
+
return props.fullWidth ? '100%' : 'auto';
|
|
44941
|
+
}, function (props) {
|
|
44942
|
+
return props.color;
|
|
44943
|
+
});
|
|
44944
|
+
|
|
44945
|
+
var _templateObject$X, _templateObject2$R;
|
|
45163
44946
|
var Media = function Media(_ref) {
|
|
45164
44947
|
var channel = _ref.channel;
|
|
45165
44948
|
var _useColor = useColors(),
|
|
@@ -45176,10 +44959,16 @@ var Media = function Media(_ref) {
|
|
|
45176
44959
|
dispatch(setAttachmentsAC([]));
|
|
45177
44960
|
dispatch(getAttachmentsAC(channel.id, channelDetailsTabs.media));
|
|
45178
44961
|
}, [channel.id]);
|
|
45179
|
-
return /*#__PURE__*/React__default.createElement(Container$p, null, attachments.map(function (file) {
|
|
45180
|
-
return /*#__PURE__*/React__default.createElement(
|
|
44962
|
+
return /*#__PURE__*/React__default.createElement(Container$p, null, attachments.map(function (file, index) {
|
|
44963
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
45181
44964
|
key: file.id
|
|
45182
|
-
},
|
|
44965
|
+
}, /*#__PURE__*/React__default.createElement(MonthHeader, {
|
|
44966
|
+
currentCreatedAt: file.createdAt,
|
|
44967
|
+
previousCreatedAt: index > 0 ? attachments[index - 1].createdAt : undefined,
|
|
44968
|
+
isFirst: index === 0,
|
|
44969
|
+
padding: '9px 6px',
|
|
44970
|
+
fullWidth: true
|
|
44971
|
+
}), /*#__PURE__*/React__default.createElement(MediaItem, null, file.type === 'image' ? (/*#__PURE__*/React__default.createElement(Attachment$1, {
|
|
45183
44972
|
attachment: _extends({}, file, {
|
|
45184
44973
|
metadata: isJSON(file.metadata) ? JSON.parse(file.metadata) : file.metadata
|
|
45185
44974
|
}),
|
|
@@ -45197,7 +44986,7 @@ var Media = function Media(_ref) {
|
|
|
45197
44986
|
backgroundColor: background,
|
|
45198
44987
|
borderRadius: '8px',
|
|
45199
44988
|
isDetailsView: true
|
|
45200
|
-
})));
|
|
44989
|
+
}))));
|
|
45201
44990
|
}), mediaFile && (/*#__PURE__*/React__default.createElement(SliderPopup, {
|
|
45202
44991
|
channel: channel,
|
|
45203
44992
|
setIsSliderOpen: setMediaFile,
|
|
@@ -45205,7 +44994,7 @@ var Media = function Media(_ref) {
|
|
|
45205
44994
|
currentMediaFile: mediaFile
|
|
45206
44995
|
})));
|
|
45207
44996
|
};
|
|
45208
|
-
var Container$p = styled.div(_templateObject$
|
|
44997
|
+
var Container$p = styled.div(_templateObject$X || (_templateObject$X = _taggedTemplateLiteralLoose(["\n padding: 6px 4px;\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n transition: all 0.2s;\n align-items: flex-start;\n display: flex;\n flex-wrap: wrap;\n"])));
|
|
45209
44998
|
var MediaItem = styled.div(_templateObject2$R || (_templateObject2$R = _taggedTemplateLiteralLoose(["\n width: calc(33.3333% - 4px);\n aspect-ratio: 1/1;\n box-sizing: border-box;\n //border: 1px solid #ccc;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n overflow: hidden;\n margin: 2px;\n"])));
|
|
45210
44999
|
|
|
45211
45000
|
var _rect$3, _path$1u;
|
|
@@ -45218,13 +45007,12 @@ function _extends$1y() {
|
|
|
45218
45007
|
return n;
|
|
45219
45008
|
}, _extends$1y.apply(null, arguments);
|
|
45220
45009
|
}
|
|
45221
|
-
function
|
|
45010
|
+
function SvgDocumentIcon(props) {
|
|
45222
45011
|
return /*#__PURE__*/createElement$1("svg", _extends$1y({
|
|
45223
45012
|
width: 40,
|
|
45224
45013
|
height: 40,
|
|
45225
45014
|
fill: "none",
|
|
45226
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
45227
|
-
color: "#5159f6"
|
|
45015
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
45228
45016
|
}, props), _rect$3 || (_rect$3 = /*#__PURE__*/createElement$1("rect", {
|
|
45229
45017
|
width: 40,
|
|
45230
45018
|
height: 40,
|
|
@@ -45234,7 +45022,7 @@ function SvgFileIcon$1(props) {
|
|
|
45234
45022
|
})), _path$1u || (_path$1u = /*#__PURE__*/createElement$1("path", {
|
|
45235
45023
|
fillRule: "evenodd",
|
|
45236
45024
|
clipRule: "evenodd",
|
|
45237
|
-
d: "
|
|
45025
|
+
d: "M17.593 9.5c-2.098 0-3.023.185-3.962.687a4.685 4.685 0 00-1.944 1.944c-.502.939-.687 1.864-.687 3.962v7.386c0 2.098.185 3.023.687 3.962a4.685 4.685 0 001.944 1.944c.939.502 1.864.686 3.962.686h3.957c2.098 0 3.023-.184 3.962-.687a4.685 4.685 0 001.944-1.944c.502-.938.687-1.863.687-3.961v-5.1c0-.683-.024-.99-.105-1.34a3.094 3.094 0 00-.399-.964c-.19-.305-.39-.54-.874-1.022l-4.175-4.175c-.483-.483-.717-.684-1.022-.874a3.096 3.096 0 00-.963-.4c-.294-.067-.556-.095-1.034-.102V9.5h-1.978zm0 1.714c-2.002 0-2.587.182-3.154.485a2.971 2.971 0 00-1.24 1.24c-.303.567-.485 1.152-.485 3.154v7.386c0 2.001.182 2.587.485 3.153a2.97 2.97 0 001.24 1.24c.567.304 1.152.485 3.154.485h3.957c2.001 0 2.587-.181 3.153-.484a2.97 2.97 0 001.241-1.241c.303-.566.485-1.152.485-3.153v-5.1c0-.118-.001-.22-.003-.308h-4.712a2.143 2.143 0 01-2.143-2.142l.002-4.713-.15-.001h-1.83zm3.785.876l-.092-.091v3.93c0 .21.151.385.351.421l.077.007 3.932.002-.093-.094-4.175-4.175zm-6.092 12.839c0-.474.383-.858.857-.858h3.428a.857.857 0 010 1.715h-3.428a.857.857 0 01-.857-.857zm.857-4.286a.857.857 0 100 1.714h6a.857.857 0 000-1.714h-6z",
|
|
45238
45026
|
fill: "currentColor"
|
|
45239
45027
|
})));
|
|
45240
45028
|
}
|
|
@@ -45262,7 +45050,7 @@ function SvgDownloadFile(props) {
|
|
|
45262
45050
|
})));
|
|
45263
45051
|
}
|
|
45264
45052
|
|
|
45265
|
-
var _templateObject$
|
|
45053
|
+
var _templateObject$Y, _templateObject2$S, _templateObject3$K, _templateObject4$D, _templateObject5$y, _templateObject6$u, _templateObject7$t, _templateObject8$q;
|
|
45266
45054
|
var Files = function Files(_ref) {
|
|
45267
45055
|
var channelId = _ref.channelId,
|
|
45268
45056
|
filePreviewIcon = _ref.filePreviewIcon,
|
|
@@ -45317,20 +45105,26 @@ var Files = function Files(_ref) {
|
|
|
45317
45105
|
useEffect(function () {
|
|
45318
45106
|
dispatch(getAttachmentsAC(channelId, channelDetailsTabs.file));
|
|
45319
45107
|
}, [channelId]);
|
|
45320
|
-
return /*#__PURE__*/React__default.createElement(Container$q, null, attachments.map(function (file) {
|
|
45108
|
+
return /*#__PURE__*/React__default.createElement(Container$q, null, attachments.map(function (file, index) {
|
|
45321
45109
|
var metas = file.metadata && isJSON(file.metadata) ? JSON.parse(file.metadata) : file.metadata;
|
|
45322
45110
|
var withPrefix = true;
|
|
45323
45111
|
var attachmentThumb = '';
|
|
45324
45112
|
if (metas && metas.tmb) {
|
|
45325
45113
|
if (metas.tmb.length < 70) {
|
|
45326
|
-
attachmentThumb =
|
|
45114
|
+
attachmentThumb = base64ToDataURL(metas.tmb);
|
|
45327
45115
|
withPrefix = false;
|
|
45328
45116
|
} else {
|
|
45329
45117
|
attachmentThumb = metas.tmb;
|
|
45330
45118
|
}
|
|
45331
45119
|
}
|
|
45332
|
-
return /*#__PURE__*/React__default.createElement(
|
|
45333
|
-
key: file.id
|
|
45120
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
45121
|
+
key: file.id
|
|
45122
|
+
}, /*#__PURE__*/React__default.createElement(MonthHeader, {
|
|
45123
|
+
currentCreatedAt: file.createdAt,
|
|
45124
|
+
previousCreatedAt: index > 0 ? attachments[index - 1].createdAt : undefined,
|
|
45125
|
+
isFirst: index === 0,
|
|
45126
|
+
padding: '14px 14px 0'
|
|
45127
|
+
}), /*#__PURE__*/React__default.createElement(FileItem, {
|
|
45334
45128
|
hoverBackgroundColor: filePreviewHoverBackgroundColor || backgroundHovered
|
|
45335
45129
|
}, metas && metas.tmb ? (/*#__PURE__*/React__default.createElement(FileThumb, {
|
|
45336
45130
|
draggable: false,
|
|
@@ -45338,10 +45132,10 @@ var Files = function Files(_ref) {
|
|
|
45338
45132
|
})) : (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(FileIconCont, {
|
|
45339
45133
|
iconColor: accentColor,
|
|
45340
45134
|
fillColor: surface1
|
|
45341
|
-
}, filePreviewIcon || /*#__PURE__*/React__default.createElement(
|
|
45135
|
+
}, filePreviewIcon || /*#__PURE__*/React__default.createElement(SvgDocumentIcon, null)), /*#__PURE__*/React__default.createElement(FileHoverIconCont, {
|
|
45342
45136
|
iconColor: accentColor,
|
|
45343
45137
|
fillColor: surface1
|
|
45344
|
-
}, filePreviewHoverIcon || /*#__PURE__*/React__default.createElement(
|
|
45138
|
+
}, filePreviewHoverIcon || /*#__PURE__*/React__default.createElement(SvgDocumentIcon, null)))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(AttachmentPreviewTitle, {
|
|
45345
45139
|
fontSize: fileNameFontSize,
|
|
45346
45140
|
lineHeight: fileNameLineHeight,
|
|
45347
45141
|
color: filePreviewTitleColor || textPrimary
|
|
@@ -45375,10 +45169,10 @@ var Files = function Files(_ref) {
|
|
|
45375
45169
|
transformOrigin: 'center center'
|
|
45376
45170
|
}
|
|
45377
45171
|
}
|
|
45378
|
-
}))) : filePreviewDownloadIcon || /*#__PURE__*/React__default.createElement(SvgDownloadFile, null)));
|
|
45172
|
+
}))) : filePreviewDownloadIcon || /*#__PURE__*/React__default.createElement(SvgDownloadFile, null))));
|
|
45379
45173
|
}));
|
|
45380
45174
|
};
|
|
45381
|
-
var Container$q = styled.ul(_templateObject$
|
|
45175
|
+
var Container$q = styled.ul(_templateObject$Y || (_templateObject$Y = _taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n transition: all 0.2s;\n"])));
|
|
45382
45176
|
var DownloadWrapper = styled.a(_templateObject2$S || (_templateObject2$S = _taggedTemplateLiteralLoose(["\n text-decoration: none;\n visibility: ", ";\n padding: 5px 6px;\n position: absolute;\n top: 25%;\n right: 16px;\n cursor: pointer;\n & > svg {\n & path {\n fill: ", ";\n }\n color: ", ";\n }\n"])), function (props) {
|
|
45383
45177
|
return props.visible ? 'visible' : 'hidden';
|
|
45384
45178
|
}, function (props) {
|
|
@@ -45387,12 +45181,12 @@ var DownloadWrapper = styled.a(_templateObject2$S || (_templateObject2$S = _tagg
|
|
|
45387
45181
|
return props.iconColor;
|
|
45388
45182
|
});
|
|
45389
45183
|
var ProgressWrapper$2 = styled.span(_templateObject3$K || (_templateObject3$K = _taggedTemplateLiteralLoose(["\n display: inline-block;\n width: 20px;\n height: 20px;\n animation: preloader 1.5s linear infinite;\n\n @keyframes preloader {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
|
|
45390
|
-
var FileIconCont = styled.span(_templateObject4$D || (_templateObject4$D = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n
|
|
45184
|
+
var FileIconCont = styled.span(_templateObject4$D || (_templateObject4$D = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n & > svg {\n width: 40px;\n height: 40px;\n color: ", ";\n rect {\n fill: ", ";\n }\n }\n"])), function (props) {
|
|
45391
45185
|
return props.iconColor;
|
|
45392
45186
|
}, function (props) {
|
|
45393
45187
|
return props.fillColor;
|
|
45394
45188
|
});
|
|
45395
|
-
var FileHoverIconCont = styled.span(_templateObject5$y || (_templateObject5$y = _taggedTemplateLiteralLoose(["\n display: none;\n & > svg {\n
|
|
45189
|
+
var FileHoverIconCont = styled.span(_templateObject5$y || (_templateObject5$y = _taggedTemplateLiteralLoose(["\n display: none;\n & > svg {\n width: 40px;\n height: 40px;\n color: ", ";\n rect {\n fill: ", ";\n }\n }\n"])), function (props) {
|
|
45396
45190
|
return props.iconColor;
|
|
45397
45191
|
}, function (props) {
|
|
45398
45192
|
return props.fillColor;
|
|
@@ -45440,7 +45234,7 @@ function SvgLinkIcon(props) {
|
|
|
45440
45234
|
})));
|
|
45441
45235
|
}
|
|
45442
45236
|
|
|
45443
|
-
var _templateObject$
|
|
45237
|
+
var _templateObject$Z, _templateObject2$T, _templateObject3$L, _templateObject4$E, _templateObject5$z;
|
|
45444
45238
|
var LinkItem = function LinkItem(_ref) {
|
|
45445
45239
|
var link = _ref.link,
|
|
45446
45240
|
linkPreviewIcon = _ref.linkPreviewIcon,
|
|
@@ -45471,12 +45265,12 @@ var LinkItem = function LinkItem(_ref) {
|
|
|
45471
45265
|
color: linkPreviewColor || textPrimary
|
|
45472
45266
|
}, link))));
|
|
45473
45267
|
};
|
|
45474
|
-
var LinkIconCont = styled.span(_templateObject$
|
|
45268
|
+
var LinkIconCont = styled.span(_templateObject$Z || (_templateObject$Z = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n > svg {\n color: ", ";\n rect {\n fill: ", ";\n }\n }\n"])), function (props) {
|
|
45475
45269
|
return props.iconColor;
|
|
45476
45270
|
}, function (props) {
|
|
45477
45271
|
return props.fillColor;
|
|
45478
45272
|
});
|
|
45479
|
-
var LinkHoverIconCont = styled.span(_templateObject2$T || (_templateObject2$T = _taggedTemplateLiteralLoose(["\n display: none;\n > svg {\n color: ", ";\n fill: ", ";\n }\n"])), function (props) {
|
|
45273
|
+
var LinkHoverIconCont = styled.span(_templateObject2$T || (_templateObject2$T = _taggedTemplateLiteralLoose(["\n display: none;\n > svg {\n color: ", ";\n rect {\n fill: ", ";\n }\n }\n"])), function (props) {
|
|
45480
45274
|
return props.iconColor;
|
|
45481
45275
|
}, function (props) {
|
|
45482
45276
|
return props.fillColor;
|
|
@@ -45489,7 +45283,7 @@ var LinkUrl = styled.span(_templateObject5$z || (_templateObject5$z = _taggedTem
|
|
|
45489
45283
|
return props.color;
|
|
45490
45284
|
});
|
|
45491
45285
|
|
|
45492
|
-
var _templateObject$
|
|
45286
|
+
var _templateObject$_;
|
|
45493
45287
|
var Links = function Links(_ref) {
|
|
45494
45288
|
var channelId = _ref.channelId,
|
|
45495
45289
|
linkPreviewIcon = _ref.linkPreviewIcon,
|
|
@@ -45502,19 +45296,25 @@ var Links = function Links(_ref) {
|
|
|
45502
45296
|
useEffect(function () {
|
|
45503
45297
|
dispatch(getAttachmentsAC(channelId, channelDetailsTabs.link));
|
|
45504
45298
|
}, [channelId]);
|
|
45505
|
-
return /*#__PURE__*/React__default.createElement(Container$r, null, attachments.map(function (file) {
|
|
45506
|
-
return /*#__PURE__*/React__default.createElement(
|
|
45507
|
-
key: file.id
|
|
45299
|
+
return /*#__PURE__*/React__default.createElement(Container$r, null, attachments.map(function (file, index) {
|
|
45300
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
45301
|
+
key: file.id
|
|
45302
|
+
}, /*#__PURE__*/React__default.createElement(MonthHeader, {
|
|
45303
|
+
currentCreatedAt: file.createdAt,
|
|
45304
|
+
previousCreatedAt: index > 0 ? attachments[index - 1].createdAt : undefined,
|
|
45305
|
+
isFirst: index === 0,
|
|
45306
|
+
padding: '6px 14px 0'
|
|
45307
|
+
}), /*#__PURE__*/React__default.createElement(LinkItem, {
|
|
45508
45308
|
link: file.url,
|
|
45509
45309
|
linkPreviewColor: linkPreviewColor,
|
|
45510
45310
|
linkPreviewHoverBackgroundColor: linkPreviewHoverBackgroundColor,
|
|
45511
45311
|
linkPreviewHoverIcon: linkPreviewHoverIcon,
|
|
45512
45312
|
linkPreviewTitleColor: linkPreviewTitleColor,
|
|
45513
45313
|
linkPreviewIcon: linkPreviewIcon
|
|
45514
|
-
});
|
|
45314
|
+
}));
|
|
45515
45315
|
}));
|
|
45516
45316
|
};
|
|
45517
|
-
var Container$r = styled.ul(_templateObject$
|
|
45317
|
+
var Container$r = styled.ul(_templateObject$_ || (_templateObject$_ = _taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 11px 0 0;\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n transition: all 0.2s;\n"])));
|
|
45518
45318
|
|
|
45519
45319
|
var _rect$5, _path$1x;
|
|
45520
45320
|
function _extends$1B() {
|
|
@@ -45570,7 +45370,7 @@ function SvgVoicePreviewPause(props) {
|
|
|
45570
45370
|
})));
|
|
45571
45371
|
}
|
|
45572
45372
|
|
|
45573
|
-
var _templateObject
|
|
45373
|
+
var _templateObject$$, _templateObject2$U, _templateObject3$M, _templateObject4$F, _templateObject5$A, _templateObject6$v, _templateObject7$u, _templateObject8$r;
|
|
45574
45374
|
var VoiceItem = function VoiceItem(_ref) {
|
|
45575
45375
|
var file = _ref.file,
|
|
45576
45376
|
voicePreviewPlayIcon = _ref.voicePreviewPlayIcon,
|
|
@@ -45695,7 +45495,7 @@ var VoiceItem = function VoiceItem(_ref) {
|
|
|
45695
45495
|
type: 'audio/mpeg'
|
|
45696
45496
|
})));
|
|
45697
45497
|
};
|
|
45698
|
-
var FileIconCont$1 = styled.span(_templateObject
|
|
45498
|
+
var FileIconCont$1 = styled.span(_templateObject$$ || (_templateObject$$ = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n display: inline-flex;\n fill: ", ";\n rect {\n fill: ", ";\n }\n"])), function (props) {
|
|
45699
45499
|
return props.fill || 'transparent';
|
|
45700
45500
|
}, function (props) {
|
|
45701
45501
|
return props.fill || 'transparent';
|
|
@@ -45720,7 +45520,7 @@ var AudioSendTime = styled.span(_templateObject7$u || (_templateObject7$u = _tag
|
|
|
45720
45520
|
});
|
|
45721
45521
|
var Audio = styled.audio(_templateObject8$r || (_templateObject8$r = _taggedTemplateLiteralLoose(["\n display: none;\n"])));
|
|
45722
45522
|
|
|
45723
|
-
var _templateObject
|
|
45523
|
+
var _templateObject$10;
|
|
45724
45524
|
var Voices = function Voices(_ref) {
|
|
45725
45525
|
var channelId = _ref.channelId,
|
|
45726
45526
|
voicePreviewPlayIcon = _ref.voicePreviewPlayIcon,
|
|
@@ -45735,9 +45535,15 @@ var Voices = function Voices(_ref) {
|
|
|
45735
45535
|
useEffect(function () {
|
|
45736
45536
|
dispatch(getAttachmentsAC(channelId, channelDetailsTabs.voice));
|
|
45737
45537
|
}, [channelId]);
|
|
45738
|
-
return /*#__PURE__*/React__default.createElement(Container$s, null, attachments.map(function (file) {
|
|
45739
|
-
return /*#__PURE__*/React__default.createElement(
|
|
45740
|
-
key: file.id
|
|
45538
|
+
return /*#__PURE__*/React__default.createElement(Container$s, null, attachments.map(function (file, index) {
|
|
45539
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
45540
|
+
key: file.id
|
|
45541
|
+
}, /*#__PURE__*/React__default.createElement(MonthHeader, {
|
|
45542
|
+
currentCreatedAt: file.createdAt,
|
|
45543
|
+
previousCreatedAt: index > 0 ? attachments[index - 1].createdAt : undefined,
|
|
45544
|
+
isFirst: index === 0,
|
|
45545
|
+
padding: '7px 14px 2px'
|
|
45546
|
+
}), /*#__PURE__*/React__default.createElement(VoiceItem, {
|
|
45741
45547
|
file: _extends({}, file, {
|
|
45742
45548
|
metadata: isJSON(file.metadata) ? JSON.parse(file.metadata) : file.metadata
|
|
45743
45549
|
}),
|
|
@@ -45748,12 +45554,12 @@ var Voices = function Voices(_ref) {
|
|
|
45748
45554
|
voicePreviewPauseIcon: voicePreviewPauseIcon,
|
|
45749
45555
|
voicePreviewPauseHoverIcon: voicePreviewPauseHoverIcon,
|
|
45750
45556
|
voicePreviewTitleColor: voicePreviewTitleColor
|
|
45751
|
-
});
|
|
45557
|
+
}));
|
|
45752
45558
|
}));
|
|
45753
45559
|
};
|
|
45754
|
-
var Container$s = styled.ul(_templateObject
|
|
45560
|
+
var Container$s = styled.ul(_templateObject$10 || (_templateObject$10 = _taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 11px 0 0;\n overflow-x: hidden;\n overflow-y: auto;\n list-style: none;\n transition: all 0.2s;\n"])));
|
|
45755
45561
|
|
|
45756
|
-
var _templateObject$
|
|
45562
|
+
var _templateObject$11, _templateObject2$V;
|
|
45757
45563
|
var DetailsTab = function DetailsTab(_ref) {
|
|
45758
45564
|
var channel = _ref.channel,
|
|
45759
45565
|
theme = _ref.theme,
|
|
@@ -45904,7 +45710,7 @@ var DetailsTab = function DetailsTab(_ref) {
|
|
|
45904
45710
|
voicePreviewHoverBackgroundColor: voicePreviewHoverBackgroundColor
|
|
45905
45711
|
})));
|
|
45906
45712
|
};
|
|
45907
|
-
var Container$t = styled.div(_templateObject$
|
|
45713
|
+
var Container$t = styled.div(_templateObject$11 || (_templateObject$11 = _taggedTemplateLiteralLoose(["\n min-height: calc(100vh - 64px);\n"])));
|
|
45908
45714
|
var DetailsTabHeader = styled.div(_templateObject2$V || (_templateObject2$V = _taggedTemplateLiteralLoose(["\n overflow-x: auto;\n overflow-y: hidden;\n border-bottom: 1px solid ", ";\n background-color: ", ";\n display: flex;\n justify-content: space-between;\n position: sticky;\n top: 0;\n z-index: 12;\n /* width */\n &::-webkit-scrollbar {\n width: 0;\n height: 0;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: transparent;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n /* Handle on hover */\n &::-webkit-scrollbar-thumb:hover {\n background: transparent;\n }\n button {\n position: relative;\n border: none;\n background: transparent;\n outline: none;\n height: 44px;\n text-transform: capitalize;\n font-style: normal;\n font-weight: 500;\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n min-width: ", ";\n cursor: pointer;\n }\n\n & span {\n position: relative;\n display: inline-flex;\n align-items: center;\n height: 100%;\n }\n\n & .active span {\n color: ", ";\n\n &:after {\n content: '';\n width: 100%;\n border-radius: 2px;\n height: 2px;\n background-color: ", ";\n position: absolute;\n top: calc(100% - 1px);\n left: 0;\n }\n }\n"])), function (props) {
|
|
45909
45715
|
return props.borderColor;
|
|
45910
45716
|
}, function (props) {
|
|
@@ -45923,8 +45729,8 @@ var DetailsTabHeader = styled.div(_templateObject2$V || (_templateObject2$V = _t
|
|
|
45923
45729
|
return props.activeTabColor;
|
|
45924
45730
|
});
|
|
45925
45731
|
|
|
45926
|
-
var _templateObject$
|
|
45927
|
-
var Container$u = styled.div(_templateObject$
|
|
45732
|
+
var _templateObject$12, _templateObject2$W, _templateObject3$N, _templateObject4$G;
|
|
45733
|
+
var Container$u = styled.div(_templateObject$12 || (_templateObject$12 = _taggedTemplateLiteralLoose(["\n ", ";\n height: ", ";\n position: absolute;\n padding: 24px 16px;\n background-color: ", ";\n z-index: 25;\n"])), function (props) {
|
|
45928
45734
|
return props.active ? 'display: block' : 'display: none';
|
|
45929
45735
|
}, function (props) {
|
|
45930
45736
|
return "calc(100vh - " + (props.heightOffset ? props.heightOffset + 48 : 48) + "px)";
|
|
@@ -46188,7 +45994,7 @@ var EditChannel = function EditChannel(_ref) {
|
|
|
46188
45994
|
})));
|
|
46189
45995
|
};
|
|
46190
45996
|
|
|
46191
|
-
var _templateObject$
|
|
45997
|
+
var _templateObject$13, _templateObject2$X, _templateObject3$O, _templateObject4$H, _templateObject5$B, _templateObject6$w, _templateObject7$v, _templateObject8$s, _templateObject9$n, _templateObject0$k, _templateObject1$h, _templateObject10$b, _templateObject11$9;
|
|
46192
45998
|
var Details = function Details(_ref) {
|
|
46193
45999
|
var _activeChannel$member;
|
|
46194
46000
|
var detailsTitleText = _ref.detailsTitleText,
|
|
@@ -46618,7 +46424,7 @@ var Details = function Details(_ref) {
|
|
|
46618
46424
|
QRCodeIcon: QRCodeIcon
|
|
46619
46425
|
}))));
|
|
46620
46426
|
};
|
|
46621
|
-
var Container$v = styled.div(_templateObject$
|
|
46427
|
+
var Container$v = styled.div(_templateObject$13 || (_templateObject$13 = _taggedTemplateLiteralLoose(["\n flex: 0 0 auto;\n width: 0;\n border-left: 1px solid ", ";\n //transition: all 0.1s;\n ", "\n background-color: ", ";\n}\n"])), function (props) {
|
|
46622
46428
|
return props.borderColor;
|
|
46623
46429
|
}, function (props) {
|
|
46624
46430
|
return props.mounted && " width: " + (props.size === 'small' ? '300px' : props.size === 'medium' ? '350px' : '400px') + ";";
|
|
@@ -46668,7 +46474,7 @@ var ChannelNameWrapper = styled.div(_templateObject1$h || (_templateObject1$h =
|
|
|
46668
46474
|
var EditButton = styled.span(_templateObject10$b || (_templateObject10$b = _taggedTemplateLiteralLoose(["\n margin-left: 6px;\n cursor: pointer;\n color: #b2b6be;\n"])));
|
|
46669
46475
|
var PhoneNumberContainer = styled.span(_templateObject11$9 || (_templateObject11$9 = _taggedTemplateLiteralLoose(["\n position: relative;\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n user-select: text;\n"])));
|
|
46670
46476
|
|
|
46671
|
-
var _templateObject$
|
|
46477
|
+
var _templateObject$14;
|
|
46672
46478
|
var ChannelDetailsContainer = function ChannelDetailsContainer(_ref) {
|
|
46673
46479
|
var _ref$size = _ref.size,
|
|
46674
46480
|
size = _ref$size === void 0 ? 'large' : _ref$size,
|
|
@@ -46899,7 +46705,7 @@ var ChannelDetailsContainer = function ChannelDetailsContainer(_ref) {
|
|
|
46899
46705
|
QRCodeIcon: QRCodeIcon
|
|
46900
46706
|
})));
|
|
46901
46707
|
};
|
|
46902
|
-
var DetailsWrapper = styled.div(_templateObject$
|
|
46708
|
+
var DetailsWrapper = styled.div(_templateObject$14 || (_templateObject$14 = _taggedTemplateLiteralLoose(["\n user-select: text;\n"])));
|
|
46903
46709
|
|
|
46904
46710
|
var _path$1z;
|
|
46905
46711
|
function _extends$1D() {
|
|
@@ -46923,7 +46729,7 @@ function SvgChevronDown(props) {
|
|
|
46923
46729
|
})));
|
|
46924
46730
|
}
|
|
46925
46731
|
|
|
46926
|
-
var _templateObject$
|
|
46732
|
+
var _templateObject$15, _templateObject2$Y;
|
|
46927
46733
|
var MessagesScrollToBottomButton = function MessagesScrollToBottomButton(_ref) {
|
|
46928
46734
|
var buttonIcon = _ref.buttonIcon,
|
|
46929
46735
|
buttonWidth = _ref.buttonWidth,
|
|
@@ -47006,7 +46812,7 @@ var MessagesScrollToBottomButton = function MessagesScrollToBottomButton(_ref) {
|
|
|
47006
46812
|
isMuted: channel.muted
|
|
47007
46813
|
}, channel.newMessageCount ? channel.newMessageCount > 99 ? '99+' : channel.newMessageCount : '')), buttonIcon || /*#__PURE__*/React__default.createElement(SvgChevronDown, null)));
|
|
47008
46814
|
};
|
|
47009
|
-
var BottomButton = styled.div(_templateObject$
|
|
46815
|
+
var BottomButton = styled.div(_templateObject$15 || (_templateObject$15 = _taggedTemplateLiteralLoose(["\n transition: all 0.3s ease-in-out;\n position: absolute;\n ", ";\n\n ", ";\n\n ", ";\n right: ", "px;\n\n margin-right: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 50px;\n width: 48px;\n height: 48px;\n cursor: pointer;\n z-index: 14;\n & > svg {\n color: rgba(129, 140, 153, 1);\n }\n\n & > span {\n bottom: 32px;\n right: 0;\n }\n"])), function (props) {
|
|
47010
46816
|
return props.animateFrom === 'bottom' && "bottom: " + (props.bottomOffset + (props.bottomPosition === undefined ? 45 : props.bottomPosition) - 130) + "px";
|
|
47011
46817
|
}, function (props) {
|
|
47012
46818
|
return props.animateFrom === 'right' && "right: " + (props.rightPosition === undefined ? 16 : props.rightPosition - 100) + "px";
|
|
@@ -47060,7 +46866,7 @@ function SvgMention(props) {
|
|
|
47060
46866
|
})));
|
|
47061
46867
|
}
|
|
47062
46868
|
|
|
47063
|
-
var _templateObject$
|
|
46869
|
+
var _templateObject$16, _templateObject2$Z;
|
|
47064
46870
|
var MessagesScrollToUnreadMentionsButton = function MessagesScrollToUnreadMentionsButton(_ref) {
|
|
47065
46871
|
var buttonIcon = _ref.buttonIcon,
|
|
47066
46872
|
buttonWidth = _ref.buttonWidth,
|
|
@@ -47203,7 +47009,7 @@ var MessagesScrollToUnreadMentionsButton = function MessagesScrollToUnreadMentio
|
|
|
47203
47009
|
isMuted: channel.muted
|
|
47204
47010
|
}, channel.newMentionCount ? channel.newMentionCount > 99 ? '99+' : channel.newMentionCount : '')), buttonIcon || /*#__PURE__*/React__default.createElement(SvgMention, null)));
|
|
47205
47011
|
};
|
|
47206
|
-
var BottomButton$1 = styled.div(_templateObject$
|
|
47012
|
+
var BottomButton$1 = styled.div(_templateObject$16 || (_templateObject$16 = _taggedTemplateLiteralLoose(["\n transition: all 0.3s ease-in-out;\n position: absolute;\n ", ";\n\n ", ";\n\n ", ";\n right: ", ";\n margin-right: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ", ";\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 50px;\n width: 48px;\n height: 48px;\n cursor: pointer;\n z-index: 14;\n\n & > svg {\n color: rgba(129, 140, 153, 1);\n }\n\n & > span {\n bottom: 32px;\n right: 0;\n }\n"])), function (props) {
|
|
47207
47013
|
return props.animateFrom === 'bottom' && "bottom: " + (props.bottomOffset + (props.bottomPosition === undefined ? 45 : props.bottomPosition) + (props.showsUnreadMentionsButton ? 60 : 0) - 180) + "px";
|
|
47208
47014
|
}, function (props) {
|
|
47209
47015
|
return props.animateFrom === 'right' && "right: " + (props.rightPosition === undefined ? 16 : props.rightPosition - 100) + "px";
|