sceyt-chat-react-uikit 1.7.0 → 1.7.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/index.d.ts +2 -1
- package/index.js +508 -394
- package/index.modern.js +353 -243
- package/package.json +1 -1
package/index.modern.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { createElement as createElement$1, useRef, useEffect, useLayoutEffect, useState, useMemo, useCallback, memo, createRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { createSelectorHook, createDispatchHook, createStoreHook, shallowEqual, Provider } from 'react-redux';
|
|
3
3
|
import log from 'loglevel';
|
|
4
4
|
import createSagaMiddleware, { eventChannel } from 'redux-saga';
|
|
5
5
|
import FileSaver from 'file-saver';
|
|
@@ -11093,12 +11093,13 @@ var ThemeReducer = (function (state, _ref) {
|
|
|
11093
11093
|
}
|
|
11094
11094
|
});
|
|
11095
11095
|
|
|
11096
|
-
var createChannelAC = function createChannelAC(channelData, dontCreateIfNotExists) {
|
|
11096
|
+
var createChannelAC = function createChannelAC(channelData, dontCreateIfNotExists, callback) {
|
|
11097
11097
|
return {
|
|
11098
11098
|
type: CREATE_CHANNEL,
|
|
11099
11099
|
payload: {
|
|
11100
11100
|
channelData: channelData,
|
|
11101
|
-
dontCreateIfNotExists: dontCreateIfNotExists
|
|
11101
|
+
dontCreateIfNotExists: dontCreateIfNotExists,
|
|
11102
|
+
callback: callback
|
|
11102
11103
|
}
|
|
11103
11104
|
};
|
|
11104
11105
|
};
|
|
@@ -11264,11 +11265,15 @@ var setActiveChannelAC = function setActiveChannelAC(channel) {
|
|
|
11264
11265
|
channel: channel
|
|
11265
11266
|
});
|
|
11266
11267
|
};
|
|
11267
|
-
var switchChannelActionAC = function switchChannelActionAC(channel) {
|
|
11268
|
+
var switchChannelActionAC = function switchChannelActionAC(channel, updateActiveChannel) {
|
|
11269
|
+
if (updateActiveChannel === void 0) {
|
|
11270
|
+
updateActiveChannel = true;
|
|
11271
|
+
}
|
|
11268
11272
|
return {
|
|
11269
11273
|
type: SWITCH_CHANNEL,
|
|
11270
11274
|
payload: {
|
|
11271
|
-
channel: channel
|
|
11275
|
+
channel: channel,
|
|
11276
|
+
updateActiveChannel: updateActiveChannel
|
|
11272
11277
|
}
|
|
11273
11278
|
};
|
|
11274
11279
|
};
|
|
@@ -11500,6 +11505,7 @@ var getChannelMentionsAC = function getChannelMentionsAC(channelId) {
|
|
|
11500
11505
|
};
|
|
11501
11506
|
|
|
11502
11507
|
var GET_MESSAGES = 'GET_MESSAGES';
|
|
11508
|
+
var GET_MESSAGE = 'GET_MESSAGE';
|
|
11503
11509
|
var LOAD_MORE_MESSAGES = 'LOAD_MORE_MESSAGES';
|
|
11504
11510
|
var SEND_MESSAGE = 'SEND_MESSAGE';
|
|
11505
11511
|
var SEND_TEXT_MESSAGE = 'SEND_TEXT_MESSAGE';
|
|
@@ -11608,6 +11614,16 @@ function getMessagesAC(channel, loadWithLastMessage, messageId, limit, withDeliv
|
|
|
11608
11614
|
}
|
|
11609
11615
|
};
|
|
11610
11616
|
}
|
|
11617
|
+
function getMessageAC(channelId, messageId, limit) {
|
|
11618
|
+
return {
|
|
11619
|
+
type: GET_MESSAGE,
|
|
11620
|
+
payload: {
|
|
11621
|
+
channelId: channelId,
|
|
11622
|
+
messageId: messageId,
|
|
11623
|
+
limit: limit
|
|
11624
|
+
}
|
|
11625
|
+
};
|
|
11626
|
+
}
|
|
11611
11627
|
function setScrollToMessagesAC(messageId, highlight) {
|
|
11612
11628
|
if (highlight === void 0) {
|
|
11613
11629
|
highlight = true;
|
|
@@ -14740,13 +14756,13 @@ var _marked$2 = /*#__PURE__*/_regenerator().m(createChannel),
|
|
|
14740
14756
|
_marked27 = /*#__PURE__*/_regenerator().m(watchForChannelEvents),
|
|
14741
14757
|
_marked28 = /*#__PURE__*/_regenerator().m(ChannelsSaga);
|
|
14742
14758
|
function createChannel(action) {
|
|
14743
|
-
var payload, channelData, dontCreateIfNotExists, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, checkChannelExist, messageToSend, _allChannels, _memberId, _t;
|
|
14759
|
+
var payload, channelData, dontCreateIfNotExists, callback, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, checkChannelExist, messageToSend, _allChannels, _memberId, _t;
|
|
14744
14760
|
return _regenerator().w(function (_context) {
|
|
14745
14761
|
while (1) switch (_context.p = _context.n) {
|
|
14746
14762
|
case 0:
|
|
14747
14763
|
_context.p = 0;
|
|
14748
14764
|
payload = action.payload;
|
|
14749
|
-
channelData = payload.channelData, dontCreateIfNotExists = payload.dontCreateIfNotExists;
|
|
14765
|
+
channelData = payload.channelData, dontCreateIfNotExists = payload.dontCreateIfNotExists, callback = payload.callback;
|
|
14750
14766
|
SceytChatClient = getClient();
|
|
14751
14767
|
createChannelData = _extends({}, channelData);
|
|
14752
14768
|
if (!createChannelData.avatarFile) {
|
|
@@ -14873,7 +14889,7 @@ function createChannel(action) {
|
|
|
14873
14889
|
_context.n = 14;
|
|
14874
14890
|
return put(switchChannelActionAC(JSON.parse(JSON.stringify(_extends({}, createdChannel, {
|
|
14875
14891
|
isLinkedChannel: dontCreateIfNotExists
|
|
14876
|
-
})))));
|
|
14892
|
+
}))), !callback));
|
|
14877
14893
|
case 14:
|
|
14878
14894
|
if (dontCreateIfNotExists) {
|
|
14879
14895
|
if (!channelIsExistOnAllChannels) {
|
|
@@ -14903,19 +14919,27 @@ function createChannel(action) {
|
|
|
14903
14919
|
addChannelToAllChannels(createdChannel);
|
|
14904
14920
|
}
|
|
14905
14921
|
}
|
|
14906
|
-
|
|
14907
|
-
|
|
14908
|
-
|
|
14909
|
-
|
|
14922
|
+
if (!callback) {
|
|
14923
|
+
_context.n = 15;
|
|
14924
|
+
break;
|
|
14925
|
+
}
|
|
14926
|
+
callback(createdChannel);
|
|
14927
|
+
_context.n = 16;
|
|
14910
14928
|
break;
|
|
14929
|
+
case 15:
|
|
14930
|
+
_context.n = 16;
|
|
14931
|
+
return call(setActiveChannelId, createdChannel.id);
|
|
14911
14932
|
case 16:
|
|
14912
|
-
_context.
|
|
14933
|
+
_context.n = 18;
|
|
14934
|
+
break;
|
|
14935
|
+
case 17:
|
|
14936
|
+
_context.p = 17;
|
|
14913
14937
|
_t = _context.v;
|
|
14914
14938
|
log.error(_t, 'Error on create channel');
|
|
14915
|
-
case
|
|
14939
|
+
case 18:
|
|
14916
14940
|
return _context.a(2);
|
|
14917
14941
|
}
|
|
14918
|
-
}, _marked$2, null, [[0,
|
|
14942
|
+
}, _marked$2, null, [[0, 17]]);
|
|
14919
14943
|
}
|
|
14920
14944
|
function getChannels(action) {
|
|
14921
14945
|
var _params$filter, _types, payload, params, SceytChatClient, channelQueryBuilder, channelTypesFilter, types, channelQuery, channelsData, channelList, channelId, activeChannel, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, channelMessageMap, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, i, allChannelsData, allChannelList, _t2, _t3, _t4;
|
|
@@ -15667,15 +15691,15 @@ function markMessagesDelivered(action) {
|
|
|
15667
15691
|
}, _marked0, null, [[1, 4]]);
|
|
15668
15692
|
}
|
|
15669
15693
|
function switchChannel(action) {
|
|
15670
|
-
var payload, channel, channelToSwitch, existingChannel, addChannel, SceytChatClient, fetchedChannel, channelFromMap, currentActiveChannel, _t11;
|
|
15694
|
+
var payload, channel, updateActiveChannel, channelToSwitch, existingChannel, addChannel, SceytChatClient, fetchedChannel, channelFromMap, currentActiveChannel, _t11;
|
|
15671
15695
|
return _regenerator().w(function (_context1) {
|
|
15672
15696
|
while (1) switch (_context1.p = _context1.n) {
|
|
15673
15697
|
case 0:
|
|
15674
15698
|
_context1.p = 0;
|
|
15675
15699
|
payload = action.payload;
|
|
15676
|
-
channel = payload.channel;
|
|
15700
|
+
channel = payload.channel, updateActiveChannel = payload.updateActiveChannel;
|
|
15677
15701
|
channelToSwitch = channel;
|
|
15678
|
-
if (channel !== null && channel !== void 0 && channel.id) {
|
|
15702
|
+
if (!(!(channel !== null && channel !== void 0 && channel.id) && updateActiveChannel)) {
|
|
15679
15703
|
_context1.n = 3;
|
|
15680
15704
|
break;
|
|
15681
15705
|
}
|
|
@@ -15723,6 +15747,10 @@ function switchChannel(action) {
|
|
|
15723
15747
|
channelFromMap = getChannelFromMap(channel.id);
|
|
15724
15748
|
channelToSwitch = _extends({}, channelToSwitch, channelFromMap);
|
|
15725
15749
|
case 10:
|
|
15750
|
+
if (!updateActiveChannel) {
|
|
15751
|
+
_context1.n = 13;
|
|
15752
|
+
break;
|
|
15753
|
+
}
|
|
15726
15754
|
currentActiveChannel = getChannelFromMap(getActiveChannelId());
|
|
15727
15755
|
_context1.n = 11;
|
|
15728
15756
|
return call(setUnreadScrollTo, true);
|
|
@@ -17114,16 +17142,17 @@ var _marked$3 = /*#__PURE__*/_regenerator().m(sendMessage),
|
|
|
17114
17142
|
_marked5$1 = /*#__PURE__*/_regenerator().m(deleteMessage),
|
|
17115
17143
|
_marked6$1 = /*#__PURE__*/_regenerator().m(editMessage),
|
|
17116
17144
|
_marked7$1 = /*#__PURE__*/_regenerator().m(getMessagesQuery),
|
|
17117
|
-
_marked8$1 = /*#__PURE__*/_regenerator().m(
|
|
17118
|
-
_marked9$1 = /*#__PURE__*/_regenerator().m(
|
|
17119
|
-
_marked0$1 = /*#__PURE__*/_regenerator().m(
|
|
17120
|
-
_marked1$1 = /*#__PURE__*/_regenerator().m(
|
|
17121
|
-
_marked10$1 = /*#__PURE__*/_regenerator().m(
|
|
17122
|
-
_marked11$1 = /*#__PURE__*/_regenerator().m(
|
|
17123
|
-
_marked12$1 = /*#__PURE__*/_regenerator().m(
|
|
17124
|
-
_marked13$1 = /*#__PURE__*/_regenerator().m(
|
|
17125
|
-
_marked14$1 = /*#__PURE__*/_regenerator().m(
|
|
17126
|
-
_marked15$1 = /*#__PURE__*/_regenerator().m(
|
|
17145
|
+
_marked8$1 = /*#__PURE__*/_regenerator().m(getMessageQuery),
|
|
17146
|
+
_marked9$1 = /*#__PURE__*/_regenerator().m(loadMoreMessages),
|
|
17147
|
+
_marked0$1 = /*#__PURE__*/_regenerator().m(addReaction),
|
|
17148
|
+
_marked1$1 = /*#__PURE__*/_regenerator().m(deleteReaction),
|
|
17149
|
+
_marked10$1 = /*#__PURE__*/_regenerator().m(getReactions),
|
|
17150
|
+
_marked11$1 = /*#__PURE__*/_regenerator().m(loadMoreReactions),
|
|
17151
|
+
_marked12$1 = /*#__PURE__*/_regenerator().m(getMessageAttachments),
|
|
17152
|
+
_marked13$1 = /*#__PURE__*/_regenerator().m(loadMoreMessageAttachments),
|
|
17153
|
+
_marked14$1 = /*#__PURE__*/_regenerator().m(pauseAttachmentUploading),
|
|
17154
|
+
_marked15$1 = /*#__PURE__*/_regenerator().m(resumeAttachmentUploading),
|
|
17155
|
+
_marked16$1 = /*#__PURE__*/_regenerator().m(MessageSaga);
|
|
17127
17156
|
var handleUploadAttachments = function handleUploadAttachments(attachments, message, channel) {
|
|
17128
17157
|
try {
|
|
17129
17158
|
return Promise.resolve(Promise.all(attachments.map(function (attachment) {
|
|
@@ -17710,7 +17739,8 @@ function sendTextMessage(action) {
|
|
|
17710
17739
|
metadata: messageResponse.metadata,
|
|
17711
17740
|
parentMessage: messageResponse.parentMessage,
|
|
17712
17741
|
repliedInThread: messageResponse.repliedInThread,
|
|
17713
|
-
createdAt: messageResponse.createdAt
|
|
17742
|
+
createdAt: messageResponse.createdAt,
|
|
17743
|
+
channelId: channel.id
|
|
17714
17744
|
};
|
|
17715
17745
|
_context4.n = 13;
|
|
17716
17746
|
return put(updateMessageAC(messageToSend.tid, messageUpdateData));
|
|
@@ -18737,23 +18767,61 @@ function getMessagesQuery(action) {
|
|
|
18737
18767
|
}
|
|
18738
18768
|
}, _marked7$1, null, [[0, 49, 50, 52]]);
|
|
18739
18769
|
}
|
|
18740
|
-
function
|
|
18741
|
-
var payload,
|
|
18770
|
+
function getMessageQuery(action) {
|
|
18771
|
+
var payload, channelId, messageId, channel, messages, _t0;
|
|
18742
18772
|
return _regenerator().w(function (_context0) {
|
|
18743
18773
|
while (1) switch (_context0.p = _context0.n) {
|
|
18744
18774
|
case 0:
|
|
18745
18775
|
_context0.p = 0;
|
|
18746
18776
|
payload = action.payload;
|
|
18777
|
+
channelId = payload.channelId, messageId = payload.messageId;
|
|
18778
|
+
_context0.n = 1;
|
|
18779
|
+
return call(getChannelFromMap, channelId);
|
|
18780
|
+
case 1:
|
|
18781
|
+
channel = _context0.v;
|
|
18782
|
+
_context0.n = 2;
|
|
18783
|
+
return call(channel.getMessagesById, [messageId]);
|
|
18784
|
+
case 2:
|
|
18785
|
+
messages = _context0.v;
|
|
18786
|
+
_context0.n = 3;
|
|
18787
|
+
return put(updateMessageAC(messageId, messages[0]));
|
|
18788
|
+
case 3:
|
|
18789
|
+
updateMessageOnMap(channel.id, {
|
|
18790
|
+
messageId: messageId,
|
|
18791
|
+
params: messages[0]
|
|
18792
|
+
});
|
|
18793
|
+
updateMessageOnAllMessages(messageId, messages[0]);
|
|
18794
|
+
_context0.n = 4;
|
|
18795
|
+
return put(setScrollToMessagesAC(messageId, false));
|
|
18796
|
+
case 4:
|
|
18797
|
+
_context0.n = 6;
|
|
18798
|
+
break;
|
|
18799
|
+
case 5:
|
|
18800
|
+
_context0.p = 5;
|
|
18801
|
+
_t0 = _context0.v;
|
|
18802
|
+
log.error('error in message query', _t0);
|
|
18803
|
+
case 6:
|
|
18804
|
+
return _context0.a(2);
|
|
18805
|
+
}
|
|
18806
|
+
}, _marked8$1, null, [[0, 5]]);
|
|
18807
|
+
}
|
|
18808
|
+
function loadMoreMessages(action) {
|
|
18809
|
+
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _t1;
|
|
18810
|
+
return _regenerator().w(function (_context1) {
|
|
18811
|
+
while (1) switch (_context1.p = _context1.n) {
|
|
18812
|
+
case 0:
|
|
18813
|
+
_context1.p = 0;
|
|
18814
|
+
payload = action.payload;
|
|
18747
18815
|
limit = payload.limit, direction = payload.direction, channelId = payload.channelId, messageId = payload.messageId, hasNext = payload.hasNext;
|
|
18748
18816
|
SceytChatClient = getClient();
|
|
18749
18817
|
messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channelId);
|
|
18750
18818
|
messageQueryBuilder.reverse(true);
|
|
18751
|
-
|
|
18819
|
+
_context1.n = 1;
|
|
18752
18820
|
return call(messageQueryBuilder.build);
|
|
18753
18821
|
case 1:
|
|
18754
|
-
messageQuery =
|
|
18822
|
+
messageQuery = _context1.v;
|
|
18755
18823
|
messageQuery.limit = limit || 5;
|
|
18756
|
-
|
|
18824
|
+
_context1.n = 2;
|
|
18757
18825
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
18758
18826
|
case 2:
|
|
18759
18827
|
result = {
|
|
@@ -18761,116 +18829,116 @@ function loadMoreMessages(action) {
|
|
|
18761
18829
|
hasNext: false
|
|
18762
18830
|
};
|
|
18763
18831
|
if (!(direction === MESSAGE_LOAD_DIRECTION.PREV)) {
|
|
18764
|
-
|
|
18832
|
+
_context1.n = 6;
|
|
18765
18833
|
break;
|
|
18766
18834
|
}
|
|
18767
18835
|
if (!getHasPrevCached()) {
|
|
18768
|
-
|
|
18836
|
+
_context1.n = 3;
|
|
18769
18837
|
break;
|
|
18770
18838
|
}
|
|
18771
18839
|
result.messages = getFromAllMessagesByMessageId(messageId, MESSAGE_LOAD_DIRECTION.PREV);
|
|
18772
|
-
|
|
18840
|
+
_context1.n = 5;
|
|
18773
18841
|
break;
|
|
18774
18842
|
case 3:
|
|
18775
18843
|
if (!hasNext) {
|
|
18776
|
-
|
|
18844
|
+
_context1.n = 5;
|
|
18777
18845
|
break;
|
|
18778
18846
|
}
|
|
18779
|
-
|
|
18847
|
+
_context1.n = 4;
|
|
18780
18848
|
return call(messageQuery.loadPreviousMessageId, messageId);
|
|
18781
18849
|
case 4:
|
|
18782
|
-
result =
|
|
18850
|
+
result = _context1.v;
|
|
18783
18851
|
if (result.messages.length) {
|
|
18784
18852
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.PREV);
|
|
18785
18853
|
}
|
|
18786
|
-
|
|
18854
|
+
_context1.n = 5;
|
|
18787
18855
|
return put(setMessagesHasPrevAC(result.hasNext));
|
|
18788
18856
|
case 5:
|
|
18789
|
-
|
|
18857
|
+
_context1.n = 10;
|
|
18790
18858
|
break;
|
|
18791
18859
|
case 6:
|
|
18792
18860
|
if (!getHasNextCached()) {
|
|
18793
|
-
|
|
18861
|
+
_context1.n = 7;
|
|
18794
18862
|
break;
|
|
18795
18863
|
}
|
|
18796
18864
|
result.messages = getFromAllMessagesByMessageId(messageId, MESSAGE_LOAD_DIRECTION.NEXT);
|
|
18797
|
-
|
|
18865
|
+
_context1.n = 9;
|
|
18798
18866
|
break;
|
|
18799
18867
|
case 7:
|
|
18800
18868
|
if (!hasNext) {
|
|
18801
|
-
|
|
18869
|
+
_context1.n = 9;
|
|
18802
18870
|
break;
|
|
18803
18871
|
}
|
|
18804
18872
|
log.info('saga load next from server ... ', messageId);
|
|
18805
18873
|
messageQuery.reverse = false;
|
|
18806
|
-
|
|
18874
|
+
_context1.n = 8;
|
|
18807
18875
|
return call(messageQuery.loadNextMessageId, messageId);
|
|
18808
18876
|
case 8:
|
|
18809
|
-
result =
|
|
18877
|
+
result = _context1.v;
|
|
18810
18878
|
log.info('result from server next ... ', result);
|
|
18811
18879
|
if (result.messages.length) {
|
|
18812
18880
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.NEXT);
|
|
18813
18881
|
}
|
|
18814
|
-
|
|
18882
|
+
_context1.n = 9;
|
|
18815
18883
|
return put(setMessagesHasNextAC(result.hasNext));
|
|
18816
18884
|
case 9:
|
|
18817
|
-
|
|
18885
|
+
_context1.n = 10;
|
|
18818
18886
|
return put(setMessagesHasPrevAC(true));
|
|
18819
18887
|
case 10:
|
|
18820
18888
|
if (!(result.messages && result.messages.length && result.messages.length > 0)) {
|
|
18821
|
-
|
|
18889
|
+
_context1.n = 12;
|
|
18822
18890
|
break;
|
|
18823
18891
|
}
|
|
18824
|
-
|
|
18892
|
+
_context1.n = 11;
|
|
18825
18893
|
return put(addMessagesAC(JSON.parse(JSON.stringify(result.messages)), direction));
|
|
18826
18894
|
case 11:
|
|
18827
|
-
|
|
18895
|
+
_context1.n = 13;
|
|
18828
18896
|
break;
|
|
18829
18897
|
case 12:
|
|
18830
|
-
|
|
18898
|
+
_context1.n = 13;
|
|
18831
18899
|
return put(addMessagesAC([], direction));
|
|
18832
18900
|
case 13:
|
|
18833
|
-
|
|
18901
|
+
_context1.n = 14;
|
|
18834
18902
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
18835
18903
|
case 14:
|
|
18836
|
-
|
|
18904
|
+
_context1.n = 16;
|
|
18837
18905
|
break;
|
|
18838
18906
|
case 15:
|
|
18839
|
-
|
|
18840
|
-
|
|
18841
|
-
log.error('error in load more messages',
|
|
18907
|
+
_context1.p = 15;
|
|
18908
|
+
_t1 = _context1.v;
|
|
18909
|
+
log.error('error in load more messages', _t1);
|
|
18842
18910
|
case 16:
|
|
18843
|
-
return
|
|
18911
|
+
return _context1.a(2);
|
|
18844
18912
|
}
|
|
18845
|
-
},
|
|
18913
|
+
}, _marked9$1, null, [[0, 15]]);
|
|
18846
18914
|
}
|
|
18847
18915
|
function addReaction(action) {
|
|
18848
|
-
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, _message2, reaction, channelUpdateParam,
|
|
18849
|
-
return _regenerator().w(function (
|
|
18850
|
-
while (1) switch (
|
|
18916
|
+
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, _message2, reaction, channelUpdateParam, _t10;
|
|
18917
|
+
return _regenerator().w(function (_context10) {
|
|
18918
|
+
while (1) switch (_context10.p = _context10.n) {
|
|
18851
18919
|
case 0:
|
|
18852
|
-
|
|
18920
|
+
_context10.p = 0;
|
|
18853
18921
|
payload = action.payload;
|
|
18854
18922
|
channelId = payload.channelId, messageId = payload.messageId, key = payload.key, score = payload.score, reason = payload.reason, enforceUnique = payload.enforceUnique;
|
|
18855
18923
|
user = getClient().user;
|
|
18856
|
-
|
|
18924
|
+
_context10.n = 1;
|
|
18857
18925
|
return call(getChannelFromMap, channelId);
|
|
18858
18926
|
case 1:
|
|
18859
|
-
channel =
|
|
18927
|
+
channel = _context10.v;
|
|
18860
18928
|
if (!channel) {
|
|
18861
18929
|
channel = getChannelFromAllChannels(channelId);
|
|
18862
18930
|
if (channel) {
|
|
18863
18931
|
setChannelInMap(channel);
|
|
18864
18932
|
}
|
|
18865
18933
|
}
|
|
18866
|
-
|
|
18934
|
+
_context10.n = 2;
|
|
18867
18935
|
return call(channel.addReaction, messageId, key, score, reason, enforceUnique);
|
|
18868
18936
|
case 2:
|
|
18869
|
-
_yield$call =
|
|
18937
|
+
_yield$call = _context10.v;
|
|
18870
18938
|
_message2 = _yield$call.message;
|
|
18871
18939
|
reaction = _yield$call.reaction;
|
|
18872
18940
|
if (!(user.id === _message2.user.id)) {
|
|
18873
|
-
|
|
18941
|
+
_context10.n = 4;
|
|
18874
18942
|
break;
|
|
18875
18943
|
}
|
|
18876
18944
|
channelUpdateParam = {
|
|
@@ -18878,100 +18946,100 @@ function addReaction(action) {
|
|
|
18878
18946
|
lastReactedMessage: _message2,
|
|
18879
18947
|
newReactions: [reaction]
|
|
18880
18948
|
};
|
|
18881
|
-
|
|
18949
|
+
_context10.n = 3;
|
|
18882
18950
|
return put(updateChannelDataAC(channel.id, channelUpdateParam));
|
|
18883
18951
|
case 3:
|
|
18884
18952
|
updateChannelOnAllChannels(channel.id, channelUpdateParam);
|
|
18885
18953
|
case 4:
|
|
18886
|
-
|
|
18954
|
+
_context10.n = 5;
|
|
18887
18955
|
return put(addChannelAC(JSON.parse(JSON.stringify(channel))));
|
|
18888
18956
|
case 5:
|
|
18889
|
-
|
|
18957
|
+
_context10.n = 6;
|
|
18890
18958
|
return put(addReactionToListAC(reaction));
|
|
18891
18959
|
case 6:
|
|
18892
|
-
|
|
18960
|
+
_context10.n = 7;
|
|
18893
18961
|
return put(addReactionToMessageAC(_message2, reaction, true));
|
|
18894
18962
|
case 7:
|
|
18895
18963
|
addReactionToMessageOnMap(channelId, _message2, reaction, true);
|
|
18896
18964
|
addReactionOnAllMessages(_message2, reaction, true);
|
|
18897
|
-
|
|
18965
|
+
_context10.n = 9;
|
|
18898
18966
|
break;
|
|
18899
18967
|
case 8:
|
|
18900
|
-
|
|
18901
|
-
|
|
18902
|
-
log.error('ERROR in add reaction',
|
|
18968
|
+
_context10.p = 8;
|
|
18969
|
+
_t10 = _context10.v;
|
|
18970
|
+
log.error('ERROR in add reaction', _t10.message);
|
|
18903
18971
|
case 9:
|
|
18904
|
-
return
|
|
18972
|
+
return _context10.a(2);
|
|
18905
18973
|
}
|
|
18906
|
-
},
|
|
18974
|
+
}, _marked0$1, null, [[0, 8]]);
|
|
18907
18975
|
}
|
|
18908
18976
|
function deleteReaction(action) {
|
|
18909
|
-
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, _message3, reaction, channelUpdateParam,
|
|
18910
|
-
return _regenerator().w(function (
|
|
18911
|
-
while (1) switch (
|
|
18977
|
+
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, _message3, reaction, channelUpdateParam, _t11;
|
|
18978
|
+
return _regenerator().w(function (_context11) {
|
|
18979
|
+
while (1) switch (_context11.p = _context11.n) {
|
|
18912
18980
|
case 0:
|
|
18913
|
-
|
|
18981
|
+
_context11.p = 0;
|
|
18914
18982
|
payload = action.payload;
|
|
18915
18983
|
channelId = payload.channelId, messageId = payload.messageId, key = payload.key, isLastReaction = payload.isLastReaction;
|
|
18916
|
-
|
|
18984
|
+
_context11.n = 1;
|
|
18917
18985
|
return call(getChannelFromMap, channelId);
|
|
18918
18986
|
case 1:
|
|
18919
|
-
channel =
|
|
18987
|
+
channel = _context11.v;
|
|
18920
18988
|
if (!channel) {
|
|
18921
18989
|
channel = getChannelFromAllChannels(channelId);
|
|
18922
18990
|
if (channel) {
|
|
18923
18991
|
setChannelInMap(channel);
|
|
18924
18992
|
}
|
|
18925
18993
|
}
|
|
18926
|
-
|
|
18994
|
+
_context11.n = 2;
|
|
18927
18995
|
return call(channel.deleteReaction, messageId, key);
|
|
18928
18996
|
case 2:
|
|
18929
|
-
_yield$call2 =
|
|
18997
|
+
_yield$call2 = _context11.v;
|
|
18930
18998
|
_message3 = _yield$call2.message;
|
|
18931
18999
|
reaction = _yield$call2.reaction;
|
|
18932
19000
|
if (!isLastReaction) {
|
|
18933
|
-
|
|
19001
|
+
_context11.n = 4;
|
|
18934
19002
|
break;
|
|
18935
19003
|
}
|
|
18936
19004
|
channelUpdateParam = {
|
|
18937
19005
|
userMessageReactions: [],
|
|
18938
19006
|
lastReactedMessage: null
|
|
18939
19007
|
};
|
|
18940
|
-
|
|
19008
|
+
_context11.n = 3;
|
|
18941
19009
|
return put(updateChannelDataAC(channel.id, channelUpdateParam));
|
|
18942
19010
|
case 3:
|
|
18943
19011
|
updateChannelOnAllChannels(channel.id, channelUpdateParam);
|
|
18944
19012
|
case 4:
|
|
18945
19013
|
log.info('message received. ... ', _message3);
|
|
18946
|
-
|
|
19014
|
+
_context11.n = 5;
|
|
18947
19015
|
return put(deleteReactionFromListAC(reaction));
|
|
18948
19016
|
case 5:
|
|
18949
|
-
|
|
19017
|
+
_context11.n = 6;
|
|
18950
19018
|
return put(deleteReactionFromMessageAC(_message3, reaction, true));
|
|
18951
19019
|
case 6:
|
|
18952
19020
|
removeReactionToMessageOnMap(channelId, _message3, reaction, true);
|
|
18953
19021
|
removeReactionOnAllMessages(_message3, reaction, true);
|
|
18954
|
-
|
|
19022
|
+
_context11.n = 8;
|
|
18955
19023
|
break;
|
|
18956
19024
|
case 7:
|
|
18957
|
-
|
|
18958
|
-
|
|
18959
|
-
log.error('ERROR in delete reaction',
|
|
19025
|
+
_context11.p = 7;
|
|
19026
|
+
_t11 = _context11.v;
|
|
19027
|
+
log.error('ERROR in delete reaction', _t11.message);
|
|
18960
19028
|
case 8:
|
|
18961
|
-
return
|
|
19029
|
+
return _context11.a(2);
|
|
18962
19030
|
}
|
|
18963
|
-
},
|
|
19031
|
+
}, _marked1$1, null, [[0, 7]]);
|
|
18964
19032
|
}
|
|
18965
19033
|
function getReactions(action) {
|
|
18966
|
-
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result,
|
|
18967
|
-
return _regenerator().w(function (
|
|
18968
|
-
while (1) switch (
|
|
19034
|
+
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result, _t12;
|
|
19035
|
+
return _regenerator().w(function (_context12) {
|
|
19036
|
+
while (1) switch (_context12.p = _context12.n) {
|
|
18969
19037
|
case 0:
|
|
18970
|
-
|
|
19038
|
+
_context12.p = 0;
|
|
18971
19039
|
payload = action.payload;
|
|
18972
19040
|
messageId = payload.messageId, key = payload.key, limit = payload.limit;
|
|
18973
19041
|
SceytChatClient = getClient();
|
|
18974
|
-
|
|
19042
|
+
_context12.n = 1;
|
|
18975
19043
|
return put(setReactionsLoadingStateAC(LOADING_STATE.LOADING));
|
|
18976
19044
|
case 1:
|
|
18977
19045
|
reactionQueryBuilder = new SceytChatClient.ReactionListQueryBuilder(messageId);
|
|
@@ -18979,74 +19047,74 @@ function getReactions(action) {
|
|
|
18979
19047
|
if (key) {
|
|
18980
19048
|
reactionQueryBuilder.setKey(key);
|
|
18981
19049
|
}
|
|
18982
|
-
|
|
19050
|
+
_context12.n = 2;
|
|
18983
19051
|
return call(reactionQueryBuilder.build);
|
|
18984
19052
|
case 2:
|
|
18985
|
-
reactionQuery =
|
|
18986
|
-
|
|
19053
|
+
reactionQuery = _context12.v;
|
|
19054
|
+
_context12.n = 3;
|
|
18987
19055
|
return call(reactionQuery.loadNext);
|
|
18988
19056
|
case 3:
|
|
18989
|
-
result =
|
|
19057
|
+
result = _context12.v;
|
|
18990
19058
|
query.ReactionsQuery = reactionQuery;
|
|
18991
|
-
|
|
19059
|
+
_context12.n = 4;
|
|
18992
19060
|
return put(setReactionsListAC(result.reactions, result.hasNext));
|
|
18993
19061
|
case 4:
|
|
18994
|
-
|
|
19062
|
+
_context12.n = 5;
|
|
18995
19063
|
return put(setReactionsLoadingStateAC(LOADING_STATE.LOADED));
|
|
18996
19064
|
case 5:
|
|
18997
|
-
|
|
19065
|
+
_context12.n = 7;
|
|
18998
19066
|
break;
|
|
18999
19067
|
case 6:
|
|
19000
|
-
|
|
19001
|
-
|
|
19002
|
-
log.error('ERROR in get reactions',
|
|
19068
|
+
_context12.p = 6;
|
|
19069
|
+
_t12 = _context12.v;
|
|
19070
|
+
log.error('ERROR in get reactions', _t12.message);
|
|
19003
19071
|
case 7:
|
|
19004
|
-
return
|
|
19072
|
+
return _context12.a(2);
|
|
19005
19073
|
}
|
|
19006
|
-
},
|
|
19074
|
+
}, _marked10$1, null, [[0, 6]]);
|
|
19007
19075
|
}
|
|
19008
19076
|
function loadMoreReactions(action) {
|
|
19009
|
-
var payload, limit, ReactionQuery, result,
|
|
19010
|
-
return _regenerator().w(function (
|
|
19011
|
-
while (1) switch (
|
|
19077
|
+
var payload, limit, ReactionQuery, result, _t13;
|
|
19078
|
+
return _regenerator().w(function (_context13) {
|
|
19079
|
+
while (1) switch (_context13.p = _context13.n) {
|
|
19012
19080
|
case 0:
|
|
19013
|
-
|
|
19081
|
+
_context13.p = 0;
|
|
19014
19082
|
payload = action.payload;
|
|
19015
19083
|
limit = payload.limit;
|
|
19016
|
-
|
|
19084
|
+
_context13.n = 1;
|
|
19017
19085
|
return put(setReactionsLoadingStateAC(LOADING_STATE.LOADING));
|
|
19018
19086
|
case 1:
|
|
19019
19087
|
ReactionQuery = query.ReactionsQuery;
|
|
19020
19088
|
if (limit) {
|
|
19021
19089
|
ReactionQuery.limit = limit;
|
|
19022
19090
|
}
|
|
19023
|
-
|
|
19091
|
+
_context13.n = 2;
|
|
19024
19092
|
return call(ReactionQuery.loadNext);
|
|
19025
19093
|
case 2:
|
|
19026
|
-
result =
|
|
19027
|
-
|
|
19094
|
+
result = _context13.v;
|
|
19095
|
+
_context13.n = 3;
|
|
19028
19096
|
return put(addReactionsToListAC(result.reactions, result.hasNext));
|
|
19029
19097
|
case 3:
|
|
19030
|
-
|
|
19098
|
+
_context13.n = 4;
|
|
19031
19099
|
return put(setReactionsLoadingStateAC(LOADING_STATE.LOADED));
|
|
19032
19100
|
case 4:
|
|
19033
|
-
|
|
19101
|
+
_context13.n = 6;
|
|
19034
19102
|
break;
|
|
19035
19103
|
case 5:
|
|
19036
|
-
|
|
19037
|
-
|
|
19038
|
-
log.error('ERROR in load more reactions',
|
|
19104
|
+
_context13.p = 5;
|
|
19105
|
+
_t13 = _context13.v;
|
|
19106
|
+
log.error('ERROR in load more reactions', _t13.message);
|
|
19039
19107
|
case 6:
|
|
19040
|
-
return
|
|
19108
|
+
return _context13.a(2);
|
|
19041
19109
|
}
|
|
19042
|
-
},
|
|
19110
|
+
}, _marked11$1, null, [[0, 5]]);
|
|
19043
19111
|
}
|
|
19044
19112
|
function getMessageAttachments(action) {
|
|
19045
|
-
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result,
|
|
19046
|
-
return _regenerator().w(function (
|
|
19047
|
-
while (1) switch (
|
|
19113
|
+
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, _t14;
|
|
19114
|
+
return _regenerator().w(function (_context14) {
|
|
19115
|
+
while (1) switch (_context14.p = _context14.n) {
|
|
19048
19116
|
case 0:
|
|
19049
|
-
|
|
19117
|
+
_context14.p = 0;
|
|
19050
19118
|
_action$payload2 = action.payload, channelId = _action$payload2.channelId, attachmentType = _action$payload2.attachmentType, limit = _action$payload2.limit, direction = _action$payload2.direction, attachmentId = _action$payload2.attachmentId, forPopup = _action$payload2.forPopup;
|
|
19051
19119
|
SceytChatClient = getClient();
|
|
19052
19120
|
typeList = [attachmentTypes.video, attachmentTypes.image, attachmentTypes.file, attachmentTypes.link, attachmentTypes.voice];
|
|
@@ -19061,240 +19129,243 @@ function getMessageAttachments(action) {
|
|
|
19061
19129
|
}
|
|
19062
19130
|
AttachmentByTypeQueryBuilder = new SceytChatClient.AttachmentListQueryBuilder(channelId, typeList);
|
|
19063
19131
|
AttachmentByTypeQueryBuilder.limit(limit || 34);
|
|
19064
|
-
|
|
19132
|
+
_context14.n = 1;
|
|
19065
19133
|
return call(AttachmentByTypeQueryBuilder.build);
|
|
19066
19134
|
case 1:
|
|
19067
|
-
AttachmentByTypeQuery =
|
|
19135
|
+
AttachmentByTypeQuery = _context14.v;
|
|
19068
19136
|
if (forPopup) {
|
|
19069
19137
|
AttachmentByTypeQuery.reverse = true;
|
|
19070
19138
|
}
|
|
19071
19139
|
if (!(direction === queryDirection.NEXT)) {
|
|
19072
|
-
|
|
19140
|
+
_context14.n = 3;
|
|
19073
19141
|
break;
|
|
19074
19142
|
}
|
|
19075
|
-
|
|
19143
|
+
_context14.n = 2;
|
|
19076
19144
|
return call(AttachmentByTypeQuery.loadPrevious);
|
|
19077
19145
|
case 2:
|
|
19078
|
-
result =
|
|
19079
|
-
|
|
19146
|
+
result = _context14.v;
|
|
19147
|
+
_context14.n = 7;
|
|
19080
19148
|
break;
|
|
19081
19149
|
case 3:
|
|
19082
19150
|
if (!(direction === queryDirection.NEAR)) {
|
|
19083
|
-
|
|
19151
|
+
_context14.n = 5;
|
|
19084
19152
|
break;
|
|
19085
19153
|
}
|
|
19086
|
-
|
|
19154
|
+
_context14.n = 4;
|
|
19087
19155
|
return call(AttachmentByTypeQuery.loadNearMessageId, attachmentId);
|
|
19088
19156
|
case 4:
|
|
19089
|
-
result =
|
|
19090
|
-
|
|
19157
|
+
result = _context14.v;
|
|
19158
|
+
_context14.n = 7;
|
|
19091
19159
|
break;
|
|
19092
19160
|
case 5:
|
|
19093
|
-
|
|
19161
|
+
_context14.n = 6;
|
|
19094
19162
|
return call(AttachmentByTypeQuery.loadPrevious);
|
|
19095
19163
|
case 6:
|
|
19096
|
-
result =
|
|
19164
|
+
result = _context14.v;
|
|
19097
19165
|
case 7:
|
|
19098
19166
|
if (!forPopup) {
|
|
19099
|
-
|
|
19167
|
+
_context14.n = 10;
|
|
19100
19168
|
break;
|
|
19101
19169
|
}
|
|
19102
19170
|
query.AttachmentByTypeQueryForPopup = AttachmentByTypeQuery;
|
|
19103
|
-
|
|
19171
|
+
_context14.n = 8;
|
|
19104
19172
|
return put(setAttachmentsForPopupAC(JSON.parse(JSON.stringify(result.attachments))));
|
|
19105
19173
|
case 8:
|
|
19106
|
-
|
|
19174
|
+
_context14.n = 9;
|
|
19107
19175
|
return put(setAttachmentsCompleteForPopupAC(result.hasNext));
|
|
19108
19176
|
case 9:
|
|
19109
|
-
|
|
19177
|
+
_context14.n = 12;
|
|
19110
19178
|
break;
|
|
19111
19179
|
case 10:
|
|
19112
19180
|
query.AttachmentByTypeQuery = AttachmentByTypeQuery;
|
|
19113
|
-
|
|
19181
|
+
_context14.n = 11;
|
|
19114
19182
|
return put(setAttachmentsCompleteAC(result.hasNext));
|
|
19115
19183
|
case 11:
|
|
19116
|
-
|
|
19184
|
+
_context14.n = 12;
|
|
19117
19185
|
return put(setAttachmentsAC(JSON.parse(JSON.stringify(result.attachments))));
|
|
19118
19186
|
case 12:
|
|
19119
|
-
|
|
19187
|
+
_context14.n = 14;
|
|
19120
19188
|
break;
|
|
19121
19189
|
case 13:
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
log.error('error in message attachment query',
|
|
19190
|
+
_context14.p = 13;
|
|
19191
|
+
_t14 = _context14.v;
|
|
19192
|
+
log.error('error in message attachment query', _t14);
|
|
19125
19193
|
case 14:
|
|
19126
|
-
return
|
|
19194
|
+
return _context14.a(2);
|
|
19127
19195
|
}
|
|
19128
|
-
},
|
|
19196
|
+
}, _marked12$1, null, [[0, 13]]);
|
|
19129
19197
|
}
|
|
19130
19198
|
function loadMoreMessageAttachments(action) {
|
|
19131
|
-
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext,
|
|
19132
|
-
return _regenerator().w(function (
|
|
19133
|
-
while (1) switch (
|
|
19199
|
+
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext, _t15;
|
|
19200
|
+
return _regenerator().w(function (_context15) {
|
|
19201
|
+
while (1) switch (_context15.p = _context15.n) {
|
|
19134
19202
|
case 0:
|
|
19135
|
-
|
|
19203
|
+
_context15.p = 0;
|
|
19136
19204
|
_action$payload3 = action.payload, limit = _action$payload3.limit, direction = _action$payload3.direction, forPopup = _action$payload3.forPopup;
|
|
19137
19205
|
if (forPopup) {
|
|
19138
19206
|
AttachmentQuery = query.AttachmentByTypeQueryForPopup;
|
|
19139
19207
|
} else {
|
|
19140
19208
|
AttachmentQuery = query.AttachmentByTypeQuery;
|
|
19141
19209
|
}
|
|
19142
|
-
|
|
19210
|
+
_context15.n = 1;
|
|
19143
19211
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
19144
19212
|
case 1:
|
|
19145
19213
|
AttachmentQuery.limit = limit;
|
|
19146
|
-
|
|
19214
|
+
_context15.n = 2;
|
|
19147
19215
|
return call(AttachmentQuery.loadPrevious);
|
|
19148
19216
|
case 2:
|
|
19149
|
-
_yield$call3 =
|
|
19217
|
+
_yield$call3 = _context15.v;
|
|
19150
19218
|
attachments = _yield$call3.attachments;
|
|
19151
19219
|
hasNext = _yield$call3.hasNext;
|
|
19152
19220
|
if (!forPopup) {
|
|
19153
|
-
|
|
19221
|
+
_context15.n = 4;
|
|
19154
19222
|
break;
|
|
19155
19223
|
}
|
|
19156
|
-
|
|
19224
|
+
_context15.n = 3;
|
|
19157
19225
|
return put(addAttachmentsForPopupAC(attachments, direction));
|
|
19158
19226
|
case 3:
|
|
19159
|
-
|
|
19227
|
+
_context15.n = 7;
|
|
19160
19228
|
break;
|
|
19161
19229
|
case 4:
|
|
19162
|
-
|
|
19230
|
+
_context15.n = 5;
|
|
19163
19231
|
return put(setAttachmentsCompleteAC(hasNext));
|
|
19164
19232
|
case 5:
|
|
19165
|
-
|
|
19233
|
+
_context15.n = 6;
|
|
19166
19234
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19167
19235
|
case 6:
|
|
19168
|
-
|
|
19236
|
+
_context15.n = 7;
|
|
19169
19237
|
return put(addAttachmentsAC(attachments));
|
|
19170
19238
|
case 7:
|
|
19171
|
-
|
|
19239
|
+
_context15.n = 9;
|
|
19172
19240
|
break;
|
|
19173
19241
|
case 8:
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
log.error('error in message attachment query',
|
|
19242
|
+
_context15.p = 8;
|
|
19243
|
+
_t15 = _context15.v;
|
|
19244
|
+
log.error('error in message attachment query', _t15);
|
|
19177
19245
|
case 9:
|
|
19178
|
-
return
|
|
19246
|
+
return _context15.a(2);
|
|
19179
19247
|
}
|
|
19180
|
-
},
|
|
19248
|
+
}, _marked13$1, null, [[0, 8]]);
|
|
19181
19249
|
}
|
|
19182
19250
|
function pauseAttachmentUploading(action) {
|
|
19183
|
-
var attachmentId, isPaused,
|
|
19184
|
-
return _regenerator().w(function (
|
|
19185
|
-
while (1) switch (
|
|
19251
|
+
var attachmentId, isPaused, _t16;
|
|
19252
|
+
return _regenerator().w(function (_context16) {
|
|
19253
|
+
while (1) switch (_context16.p = _context16.n) {
|
|
19186
19254
|
case 0:
|
|
19187
|
-
|
|
19255
|
+
_context16.p = 0;
|
|
19188
19256
|
attachmentId = action.payload.attachmentId;
|
|
19189
19257
|
if (!getCustomUploader()) {
|
|
19190
|
-
|
|
19258
|
+
_context16.n = 1;
|
|
19191
19259
|
break;
|
|
19192
19260
|
}
|
|
19193
19261
|
isPaused = pauseUpload(attachmentId);
|
|
19194
19262
|
if (!isPaused) {
|
|
19195
|
-
|
|
19263
|
+
_context16.n = 1;
|
|
19196
19264
|
break;
|
|
19197
19265
|
}
|
|
19198
|
-
|
|
19266
|
+
_context16.n = 1;
|
|
19199
19267
|
return put(updateAttachmentUploadingStateAC(UPLOAD_STATE.PAUSED, attachmentId));
|
|
19200
19268
|
case 1:
|
|
19201
|
-
|
|
19269
|
+
_context16.n = 3;
|
|
19202
19270
|
break;
|
|
19203
19271
|
case 2:
|
|
19204
|
-
|
|
19205
|
-
|
|
19206
|
-
log.error('error in pause attachment uploading',
|
|
19272
|
+
_context16.p = 2;
|
|
19273
|
+
_t16 = _context16.v;
|
|
19274
|
+
log.error('error in pause attachment uploading', _t16);
|
|
19207
19275
|
case 3:
|
|
19208
|
-
return
|
|
19276
|
+
return _context16.a(2);
|
|
19209
19277
|
}
|
|
19210
|
-
},
|
|
19278
|
+
}, _marked14$1, null, [[0, 2]]);
|
|
19211
19279
|
}
|
|
19212
19280
|
function resumeAttachmentUploading(action) {
|
|
19213
|
-
var attachmentId, isResumed,
|
|
19214
|
-
return _regenerator().w(function (
|
|
19215
|
-
while (1) switch (
|
|
19281
|
+
var attachmentId, isResumed, _t17;
|
|
19282
|
+
return _regenerator().w(function (_context17) {
|
|
19283
|
+
while (1) switch (_context17.p = _context17.n) {
|
|
19216
19284
|
case 0:
|
|
19217
|
-
|
|
19285
|
+
_context17.p = 0;
|
|
19218
19286
|
attachmentId = action.payload.attachmentId;
|
|
19219
19287
|
log.info('resume for attachment ... ', attachmentId);
|
|
19220
19288
|
if (!getCustomUploader()) {
|
|
19221
|
-
|
|
19289
|
+
_context17.n = 1;
|
|
19222
19290
|
break;
|
|
19223
19291
|
}
|
|
19224
19292
|
isResumed = resumeUpload(attachmentId);
|
|
19225
19293
|
if (!isResumed) {
|
|
19226
|
-
|
|
19294
|
+
_context17.n = 1;
|
|
19227
19295
|
break;
|
|
19228
19296
|
}
|
|
19229
|
-
|
|
19297
|
+
_context17.n = 1;
|
|
19230
19298
|
return put(updateAttachmentUploadingStateAC(UPLOAD_STATE.UPLOADING, attachmentId));
|
|
19231
19299
|
case 1:
|
|
19232
|
-
|
|
19300
|
+
_context17.n = 3;
|
|
19233
19301
|
break;
|
|
19234
19302
|
case 2:
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
log.error('error in resume attachment uploading',
|
|
19303
|
+
_context17.p = 2;
|
|
19304
|
+
_t17 = _context17.v;
|
|
19305
|
+
log.error('error in resume attachment uploading', _t17);
|
|
19238
19306
|
case 3:
|
|
19239
|
-
return
|
|
19307
|
+
return _context17.a(2);
|
|
19240
19308
|
}
|
|
19241
|
-
},
|
|
19309
|
+
}, _marked15$1, null, [[0, 2]]);
|
|
19242
19310
|
}
|
|
19243
19311
|
function MessageSaga() {
|
|
19244
|
-
return _regenerator().w(function (
|
|
19245
|
-
while (1) switch (
|
|
19312
|
+
return _regenerator().w(function (_context18) {
|
|
19313
|
+
while (1) switch (_context18.n) {
|
|
19246
19314
|
case 0:
|
|
19247
|
-
|
|
19315
|
+
_context18.n = 1;
|
|
19248
19316
|
return takeEvery(SEND_MESSAGE, sendMessage);
|
|
19249
19317
|
case 1:
|
|
19250
|
-
|
|
19318
|
+
_context18.n = 2;
|
|
19251
19319
|
return takeEvery(SEND_TEXT_MESSAGE, sendTextMessage);
|
|
19252
19320
|
case 2:
|
|
19253
|
-
|
|
19321
|
+
_context18.n = 3;
|
|
19254
19322
|
return takeEvery(FORWARD_MESSAGE, forwardMessage);
|
|
19255
19323
|
case 3:
|
|
19256
|
-
|
|
19324
|
+
_context18.n = 4;
|
|
19257
19325
|
return takeEvery(RESEND_MESSAGE, resendMessage);
|
|
19258
19326
|
case 4:
|
|
19259
|
-
|
|
19327
|
+
_context18.n = 5;
|
|
19260
19328
|
return takeLatest(EDIT_MESSAGE, editMessage);
|
|
19261
19329
|
case 5:
|
|
19262
|
-
|
|
19330
|
+
_context18.n = 6;
|
|
19263
19331
|
return takeEvery(DELETE_MESSAGE, deleteMessage);
|
|
19264
19332
|
case 6:
|
|
19265
|
-
|
|
19333
|
+
_context18.n = 7;
|
|
19266
19334
|
return takeLatest(GET_MESSAGES, getMessagesQuery);
|
|
19267
19335
|
case 7:
|
|
19268
|
-
|
|
19269
|
-
return takeLatest(
|
|
19336
|
+
_context18.n = 8;
|
|
19337
|
+
return takeLatest(GET_MESSAGE, getMessageQuery);
|
|
19270
19338
|
case 8:
|
|
19271
|
-
|
|
19272
|
-
return takeLatest(
|
|
19339
|
+
_context18.n = 9;
|
|
19340
|
+
return takeLatest(GET_MESSAGES_ATTACHMENTS, getMessageAttachments);
|
|
19273
19341
|
case 9:
|
|
19274
|
-
|
|
19275
|
-
return takeLatest(
|
|
19342
|
+
_context18.n = 10;
|
|
19343
|
+
return takeLatest(LOAD_MORE_MESSAGES_ATTACHMENTS, loadMoreMessageAttachments);
|
|
19276
19344
|
case 10:
|
|
19277
|
-
|
|
19278
|
-
return takeLatest(
|
|
19345
|
+
_context18.n = 11;
|
|
19346
|
+
return takeLatest(ADD_REACTION, addReaction);
|
|
19279
19347
|
case 11:
|
|
19280
|
-
|
|
19281
|
-
return
|
|
19348
|
+
_context18.n = 12;
|
|
19349
|
+
return takeLatest(DELETE_REACTION, deleteReaction);
|
|
19282
19350
|
case 12:
|
|
19283
|
-
|
|
19284
|
-
return takeEvery(
|
|
19351
|
+
_context18.n = 13;
|
|
19352
|
+
return takeEvery(LOAD_MORE_MESSAGES, loadMoreMessages);
|
|
19285
19353
|
case 13:
|
|
19286
|
-
|
|
19287
|
-
return takeEvery(
|
|
19354
|
+
_context18.n = 14;
|
|
19355
|
+
return takeEvery(GET_REACTIONS, getReactions);
|
|
19288
19356
|
case 14:
|
|
19289
|
-
|
|
19290
|
-
return takeEvery(
|
|
19357
|
+
_context18.n = 15;
|
|
19358
|
+
return takeEvery(LOAD_MORE_REACTIONS, loadMoreReactions);
|
|
19291
19359
|
case 15:
|
|
19292
|
-
|
|
19293
|
-
return takeEvery(
|
|
19360
|
+
_context18.n = 16;
|
|
19361
|
+
return takeEvery(PAUSE_ATTACHMENT_UPLOADING, pauseAttachmentUploading);
|
|
19294
19362
|
case 16:
|
|
19295
|
-
|
|
19363
|
+
_context18.n = 17;
|
|
19364
|
+
return takeEvery(RESUME_ATTACHMENT_UPLOADING, resumeAttachmentUploading);
|
|
19365
|
+
case 17:
|
|
19366
|
+
return _context18.a(2);
|
|
19296
19367
|
}
|
|
19297
|
-
},
|
|
19368
|
+
}, _marked16$1);
|
|
19298
19369
|
}
|
|
19299
19370
|
|
|
19300
19371
|
var _marked$4 = /*#__PURE__*/_regenerator().m(getMembers),
|
|
@@ -20062,6 +20133,12 @@ var store = configureStore({
|
|
|
20062
20133
|
});
|
|
20063
20134
|
sagaMiddleware.run(rootSaga);
|
|
20064
20135
|
|
|
20136
|
+
var SceytReduxContext = /*#__PURE__*/React__default.createContext(null);
|
|
20137
|
+
|
|
20138
|
+
var useSelector = createSelectorHook(SceytReduxContext);
|
|
20139
|
+
var useDispatch = createDispatchHook(SceytReduxContext);
|
|
20140
|
+
var useStore = createStoreHook(SceytReduxContext);
|
|
20141
|
+
|
|
20065
20142
|
var channelsSelector = function channelsSelector(store) {
|
|
20066
20143
|
return store.ChannelReducer.channels;
|
|
20067
20144
|
};
|
|
@@ -20545,7 +20622,8 @@ var SceytChatContainer = function SceytChatContainer(_ref) {
|
|
|
20545
20622
|
log.setLevel(logLevel);
|
|
20546
20623
|
}, []);
|
|
20547
20624
|
return /*#__PURE__*/React__default.createElement(Provider, {
|
|
20548
|
-
store: store
|
|
20625
|
+
store: store,
|
|
20626
|
+
context: SceytReduxContext
|
|
20549
20627
|
}, /*#__PURE__*/React__default.createElement(SceytChat, {
|
|
20550
20628
|
client: client,
|
|
20551
20629
|
theme: theme,
|
|
@@ -21002,7 +21080,7 @@ var ChannelMessageText = function ChannelMessageText(_ref2) {
|
|
|
21002
21080
|
}), channel.lastReactedMessage && '"')))));
|
|
21003
21081
|
};
|
|
21004
21082
|
var Channel = function Channel(_ref3) {
|
|
21005
|
-
var _channel$metadata
|
|
21083
|
+
var _channel$metadata;
|
|
21006
21084
|
var channel = _ref3.channel,
|
|
21007
21085
|
theme = _ref3.theme,
|
|
21008
21086
|
_ref3$showAvatar = _ref3.showAvatar,
|
|
@@ -21047,7 +21125,7 @@ var Channel = function Channel(_ref3) {
|
|
|
21047
21125
|
var activeChannel = useSelector(activeChannelSelector) || {};
|
|
21048
21126
|
var channelDraftIsRemoved = useSelector(channelMessageDraftIsRemovedSelector);
|
|
21049
21127
|
var isDirectChannel = channel.type === DEFAULT_CHANNEL_TYPE.DIRECT;
|
|
21050
|
-
var isSelfChannel = isDirectChannel && ((_channel$metadata = channel.metadata) === null || _channel$metadata === void 0 ? void 0 : _channel$metadata.s);
|
|
21128
|
+
var isSelfChannel = isDirectChannel && (((_channel$metadata = channel.metadata) === null || _channel$metadata === void 0 ? void 0 : _channel$metadata.s) || channel.members.length === 1 && channel.members[0].id === user.id);
|
|
21051
21129
|
var directChannelUser = isDirectChannel && channel.members.find(function (member) {
|
|
21052
21130
|
return member.id !== user.id;
|
|
21053
21131
|
});
|
|
@@ -21189,7 +21267,7 @@ var Channel = function Channel(_ref3) {
|
|
|
21189
21267
|
subjectLineHeight: channelSubjectLineHeight,
|
|
21190
21268
|
subjectColor: channelSubjectColor || textPrimary,
|
|
21191
21269
|
avatarSize: channelAvatarSize
|
|
21192
|
-
}, /*#__PURE__*/React__default.createElement("h3", null, channel.subject || (isDirectChannel && directChannelUser ? makeUsername(contactsMap && contactsMap[directChannelUser.id], directChannelUser, getFromContacts) :
|
|
21270
|
+
}, /*#__PURE__*/React__default.createElement("h3", null, channel.subject || (isDirectChannel && directChannelUser ? makeUsername(contactsMap && contactsMap[directChannelUser.id], directChannelUser, getFromContacts) : isSelfChannel ? 'Me' : '')), channel.muted && (/*#__PURE__*/React__default.createElement(MutedIcon, {
|
|
21193
21271
|
color: notificationsIsMutedIconColor || iconInactive
|
|
21194
21272
|
}, notificationsIsMutedIcon || /*#__PURE__*/React__default.createElement(SvgUnmuteNotifications, null))), (lastMessage || typingOrRecording.items.length > 0 || draftMessageText) && (/*#__PURE__*/React__default.createElement(LastMessage, {
|
|
21195
21273
|
color: textSecondary,
|
|
@@ -32038,6 +32116,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32038
32116
|
};
|
|
32039
32117
|
useEffect(function () {
|
|
32040
32118
|
if (isVisible) {
|
|
32119
|
+
var _channel$lastMessage;
|
|
32041
32120
|
if (setLastVisibleMessageId) {
|
|
32042
32121
|
setLastVisibleMessageId(message.id);
|
|
32043
32122
|
}
|
|
@@ -32045,7 +32124,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32045
32124
|
if (!channel.isLinkedChannel) {
|
|
32046
32125
|
setMessageToVisibleMessagesMap(message);
|
|
32047
32126
|
}
|
|
32048
|
-
if (scrollToNewMessage.scrollToBottom && (message.id === channel.lastMessage.id || !message.id)) {
|
|
32127
|
+
if (scrollToNewMessage.scrollToBottom && ((message === null || message === void 0 ? void 0 : message.id) === ((_channel$lastMessage = channel.lastMessage) === null || _channel$lastMessage === void 0 ? void 0 : _channel$lastMessage.id) || !(message !== null && message !== void 0 && message.id))) {
|
|
32049
32128
|
dispatch(scrollToNewMessageAC(false, false, false));
|
|
32050
32129
|
dispatch(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
32051
32130
|
}
|
|
@@ -32382,7 +32461,7 @@ var Message$1 = function Message(_ref) {
|
|
|
32382
32461
|
})));
|
|
32383
32462
|
};
|
|
32384
32463
|
var Message$2 = /*#__PURE__*/React__default.memo(Message$1, function (prevProps, nextProps) {
|
|
32385
|
-
return prevProps.message.deliveryStatus === nextProps.message.deliveryStatus && prevProps.message.state === nextProps.message.state && prevProps.message.userReactions === nextProps.message.userReactions && prevProps.message.body === nextProps.message.body && prevProps.message.reactionTotals === nextProps.message.reactionTotals && prevProps.message.attachments === nextProps.message.attachments && prevProps.message.userMarkers === nextProps.message.userMarkers && prevProps.prevMessage === nextProps.prevMessage && prevProps.nextMessage === nextProps.nextMessage && prevProps.selectedMessagesMap === nextProps.selectedMessagesMap && prevProps.contactsMap === nextProps.contactsMap && prevProps.connectionStatus === nextProps.connectionStatus && prevProps.openedMessageMenuId === nextProps.openedMessageMenuId && prevProps.theme === nextProps.theme;
|
|
32464
|
+
return prevProps.message.deliveryStatus === nextProps.message.deliveryStatus && prevProps.message.state === nextProps.message.state && prevProps.message.userReactions === nextProps.message.userReactions && prevProps.message.body === nextProps.message.body && prevProps.message.reactionTotals === nextProps.message.reactionTotals && prevProps.message.attachments === nextProps.message.attachments && prevProps.message.metadata === nextProps.message.metadata && prevProps.message.userMarkers === nextProps.message.userMarkers && prevProps.prevMessage === nextProps.prevMessage && prevProps.nextMessage === nextProps.nextMessage && prevProps.selectedMessagesMap === nextProps.selectedMessagesMap && prevProps.contactsMap === nextProps.contactsMap && prevProps.connectionStatus === nextProps.connectionStatus && prevProps.openedMessageMenuId === nextProps.openedMessageMenuId && prevProps.theme === nextProps.theme;
|
|
32386
32465
|
});
|
|
32387
32466
|
var MessageReactionKey = styled.span(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n font-family:\n apple color emoji,\n segoe ui emoji,\n noto color emoji,\n android emoji,\n emojisymbols,\n emojione mozilla,\n twemoji mozilla,\n segoe ui symbol;\n"])));
|
|
32388
32467
|
var ReactionItemCount = styled.span(_templateObject2$x || (_templateObject2$x = _taggedTemplateLiteralLoose(["\n margin-left: 2px;\n font-family: Inter, sans-serif;\n font-weight: 400;\n font-size: 14px;\n line-height: 16px;\n color: ", ";\n"])), function (props) {
|
|
@@ -39254,7 +39333,7 @@ var Files = function Files(_ref) {
|
|
|
39254
39333
|
lineHeight: fileSizeLineHeight,
|
|
39255
39334
|
color: filePreviewSizeColor || textSecondary
|
|
39256
39335
|
}, file.size ? bytesToSize(file.size) : '')), /*#__PURE__*/React__default.createElement(DownloadWrapper, {
|
|
39257
|
-
visible: downloadingFilesMap[file.id],
|
|
39336
|
+
visible: !!downloadingFilesMap[file.id],
|
|
39258
39337
|
iconColor: accentColor,
|
|
39259
39338
|
onClick: function onClick() {
|
|
39260
39339
|
return handleDownloadFile(file);
|
|
@@ -40092,7 +40171,7 @@ var EditChannel = function EditChannel(_ref) {
|
|
|
40092
40171
|
|
|
40093
40172
|
var _templateObject$V, _templateObject2$O, _templateObject3$F, _templateObject4$z, _templateObject5$u, _templateObject6$p, _templateObject7$n, _templateObject8$l, _templateObject9$g, _templateObject0$e, _templateObject1$b, _templateObject10$7;
|
|
40094
40173
|
var Details = function Details(_ref) {
|
|
40095
|
-
var _activeChannel$metada;
|
|
40174
|
+
var _activeChannel$metada, _activeChannel$member;
|
|
40096
40175
|
var detailsTitleText = _ref.detailsTitleText,
|
|
40097
40176
|
editDetailsTitleText = _ref.editDetailsTitleText,
|
|
40098
40177
|
detailsTitleFontSize = _ref.detailsTitleFontSize,
|
|
@@ -40250,9 +40329,9 @@ var Details = function Details(_ref) {
|
|
|
40250
40329
|
var isSelfChannel = isDirectChannel && ((_activeChannel$metada = activeChannel.metadata) === null || _activeChannel$metada === void 0 ? void 0 : _activeChannel$metada.s);
|
|
40251
40330
|
var memberDisplayText = getChannelTypesMemberDisplayTextMap();
|
|
40252
40331
|
var displayMemberText = memberDisplayText && (memberDisplayText[activeChannel.type] ? activeChannel.memberCount > 1 ? memberDisplayText[activeChannel.type] + "s" : memberDisplayText[activeChannel.type] : activeChannel.type === DEFAULT_CHANNEL_TYPE.BROADCAST || activeChannel.type === DEFAULT_CHANNEL_TYPE.PUBLIC ? activeChannel.memberCount > 1 ? 'subscribers' : 'subscriber' : activeChannel.memberCount > 1 ? 'members' : 'member');
|
|
40253
|
-
var directChannelUser = isDirectChannel && activeChannel.members.find(function (member) {
|
|
40332
|
+
var directChannelUser = isDirectChannel && (activeChannel.members.find(function (member) {
|
|
40254
40333
|
return member.id !== user.id;
|
|
40255
|
-
});
|
|
40334
|
+
}) || (activeChannel === null || activeChannel === void 0 ? void 0 : (_activeChannel$member = activeChannel.members) === null || _activeChannel$member === void 0 ? void 0 : _activeChannel$member[0]));
|
|
40256
40335
|
var handleMembersListScroll = function handleMembersListScroll(event) {
|
|
40257
40336
|
if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100) {
|
|
40258
40337
|
if (activeTab === channelDetailsTabs.member) {
|
|
@@ -40361,7 +40440,7 @@ var Details = function Details(_ref) {
|
|
|
40361
40440
|
color: textSecondary,
|
|
40362
40441
|
fontSize: channelMembersFontSize,
|
|
40363
40442
|
lineHeight: channelMembersLineHeight
|
|
40364
|
-
}, showPhoneNumber ? "+" + directChannelUser.id : hideUserPresence && directChannelUser && hideUserPresence(directChannelUser) ? '' : directChannelUser && directChannelUser.presence && (directChannelUser.presence.state === USER_PRESENCE_STATUS.ONLINE ? 'Online' : directChannelUser.presence.lastActiveAt && userLastActiveDateFormat(directChannelUser.presence.lastActiveAt)))) : (/*#__PURE__*/React__default.createElement(SubTitle, {
|
|
40443
|
+
}, showPhoneNumber ? "+" + (directChannelUser === null || directChannelUser === void 0 ? void 0 : directChannelUser.id) : hideUserPresence && directChannelUser && hideUserPresence(directChannelUser) ? '' : directChannelUser && directChannelUser.presence && (directChannelUser.presence.state === USER_PRESENCE_STATUS.ONLINE ? 'Online' : directChannelUser.presence.lastActiveAt && userLastActiveDateFormat(directChannelUser.presence.lastActiveAt)))) : (/*#__PURE__*/React__default.createElement(SubTitle, {
|
|
40365
40444
|
color: textSecondary,
|
|
40366
40445
|
fontSize: channelMembersFontSize,
|
|
40367
40446
|
lineHeight: channelMembersLineHeight
|
|
@@ -41082,5 +41161,36 @@ var UnreadCount$2 = styled.span(_templateObject2$Q || (_templateObject2$Q = _tag
|
|
|
41082
41161
|
return props.textColor || '#fff';
|
|
41083
41162
|
});
|
|
41084
41163
|
|
|
41085
|
-
|
|
41164
|
+
var createOrGetDirectChannel = function createOrGetDirectChannel(user, callback) {
|
|
41165
|
+
try {
|
|
41166
|
+
if (user) {
|
|
41167
|
+
store.dispatch(createChannelAC({
|
|
41168
|
+
metadata: '',
|
|
41169
|
+
type: DEFAULT_CHANNEL_TYPE.DIRECT,
|
|
41170
|
+
members: [_extends({}, user, {
|
|
41171
|
+
role: 'owner'
|
|
41172
|
+
})]
|
|
41173
|
+
}, true, callback));
|
|
41174
|
+
}
|
|
41175
|
+
return Promise.resolve();
|
|
41176
|
+
} catch (e) {
|
|
41177
|
+
return Promise.reject(e);
|
|
41178
|
+
}
|
|
41179
|
+
};
|
|
41180
|
+
var switchChannelActiveChannel = function switchChannelActiveChannel(channel) {
|
|
41181
|
+
try {
|
|
41182
|
+
store.dispatch(switchChannelActionAC(channel, true));
|
|
41183
|
+
return Promise.resolve();
|
|
41184
|
+
} catch (e) {
|
|
41185
|
+
return Promise.reject(e);
|
|
41186
|
+
}
|
|
41187
|
+
};
|
|
41188
|
+
var handleSendMessage = function handleSendMessage(message, channelId, connectionState) {
|
|
41189
|
+
return store.dispatch(sendTextMessageAC(message, channelId, connectionState));
|
|
41190
|
+
};
|
|
41191
|
+
var handleGetMessage = function handleGetMessage(channelId, messageId) {
|
|
41192
|
+
return store.dispatch(getMessageAC(channelId, messageId));
|
|
41193
|
+
};
|
|
41194
|
+
|
|
41195
|
+
export { Attachment$1 as Attachment, Avatar, Channel, ChannelDetailsContainer as ChannelDetails, ChannelList, ChannelSearch, Chat, ChatHeader, CreateChannel, DropDown, EmojisPopup, FrequentlyEmojis, MessagesContainer as MessageList, MessageStatusIcon, MessageTextFormat, MessagesScrollToBottomButton, MessagesScrollToUnreadMentionsButton, OGMetadata, SceytChatContainer as SceytChat, SendMessageInput as SendMessage, THEME_COLORS, createOrGetDirectChannel, handleGetMessage, handleSendMessage, switchChannelActiveChannel };
|
|
41086
41196
|
//# sourceMappingURL=index.modern.js.map
|