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