sceyt-chat-react-uikit 1.7.7-beta.10 → 1.7.7-beta.11
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/index.js +739 -687
- package/index.modern.js +740 -688
- package/package.json +1 -1
package/index.modern.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createSelectorHook, createDispatchHook, createStoreHook, shallowEqual,
|
|
|
3
3
|
import log from 'loglevel';
|
|
4
4
|
import createSagaMiddleware, { eventChannel } from 'redux-saga';
|
|
5
5
|
import FileSaver from 'file-saver';
|
|
6
|
-
import { select, put, call, take, takeLatest, takeEvery, all } from 'redux-saga/effects';
|
|
6
|
+
import { select, put, call, take, takeLatest, takeEvery, spawn, all } from 'redux-saga/effects';
|
|
7
7
|
import { v4 } from 'uuid';
|
|
8
8
|
import styled, { createGlobalStyle, keyframes } from 'styled-components';
|
|
9
9
|
import LinkifyIt from 'linkify-it';
|
|
@@ -18840,18 +18840,10 @@ var addPendingMessage = function addPendingMessage(message, messageCopy, channel
|
|
|
18840
18840
|
mentionedUsers: message.mentionedUsers,
|
|
18841
18841
|
parentMessage: message.parentMessage
|
|
18842
18842
|
});
|
|
18843
|
-
addMessageToMap(channel.id, messageToAdd);
|
|
18844
|
-
var activeChannelId = getActiveChannelId();
|
|
18845
|
-
if (activeChannelId === channel.id) {
|
|
18846
|
-
addAllMessages([messageToAdd], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
18847
|
-
}
|
|
18848
18843
|
setPendingMessage(channel.id, messageToAdd);
|
|
18849
18844
|
if (!(messageToAdd !== null && messageToAdd !== void 0 && messageToAdd.forwardingDetails)) {
|
|
18850
18845
|
store.dispatch(scrollToNewMessageAC(true));
|
|
18851
18846
|
}
|
|
18852
|
-
if (activeChannelId === channel.id) {
|
|
18853
|
-
store.dispatch(addMessageAC(messageToAdd));
|
|
18854
|
-
}
|
|
18855
18847
|
return Promise.resolve();
|
|
18856
18848
|
} catch (e) {
|
|
18857
18849
|
return Promise.reject(e);
|
|
@@ -18986,7 +18978,8 @@ function sendMessage(action) {
|
|
|
18986
18978
|
channelId: channel.id
|
|
18987
18979
|
}));
|
|
18988
18980
|
messageForSend = _extends({}, _messageToSend, {
|
|
18989
|
-
attachments: [messageAttachment]
|
|
18981
|
+
attachments: [messageAttachment],
|
|
18982
|
+
createdAt: new Date(Date.now())
|
|
18990
18983
|
});
|
|
18991
18984
|
messagesToSend.push(messageForSend);
|
|
18992
18985
|
pendingMessages.push(_extends({}, messageForSend, {
|
|
@@ -19028,7 +19021,9 @@ function sendMessage(action) {
|
|
|
19028
19021
|
messageBuilder.setReplyInThread();
|
|
19029
19022
|
}
|
|
19030
19023
|
messageToSend = action.type === RESEND_MESSAGE ? action.payload.message : messageBuilder.create();
|
|
19031
|
-
messageCopy = messageToSend
|
|
19024
|
+
messageCopy = _extends({}, messageToSend, {
|
|
19025
|
+
createdAt: new Date(Date.now())
|
|
19026
|
+
});
|
|
19032
19027
|
pendingMessages.push(_extends({}, messageCopy, {
|
|
19033
19028
|
attachments: message.attachments
|
|
19034
19029
|
}));
|
|
@@ -19039,7 +19034,7 @@ function sendMessage(action) {
|
|
|
19039
19034
|
}
|
|
19040
19035
|
case 11:
|
|
19041
19036
|
_loop2 = /*#__PURE__*/_regenerator().m(function _callee2() {
|
|
19042
|
-
var messageAttachment, messageToSend, _messageCopy, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, messageToUpdate, channelUpdateParam, pendingMessage, _t;
|
|
19037
|
+
var messageAttachment, messageToSend, _messageCopy, activeChannelId, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, messageToUpdate, channelUpdateParam, pendingMessage, _t;
|
|
19043
19038
|
return _regenerator().w(function (_context2) {
|
|
19044
19039
|
while (1) switch (_context2.p = _context2.n) {
|
|
19045
19040
|
case 0:
|
|
@@ -19047,7 +19042,17 @@ function sendMessage(action) {
|
|
|
19047
19042
|
messageToSend = messagesToSend[_i];
|
|
19048
19043
|
_context2.p = 1;
|
|
19049
19044
|
_messageCopy = JSON.parse(JSON.stringify(messagesToSend[_i]));
|
|
19050
|
-
|
|
19045
|
+
activeChannelId = getActiveChannelId();
|
|
19046
|
+
if (action.type !== RESEND_MESSAGE) {
|
|
19047
|
+
addMessageToMap(channel.id, messageToSend);
|
|
19048
|
+
if (activeChannelId === channel.id) {
|
|
19049
|
+
addAllMessages([messageToSend], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
19050
|
+
}
|
|
19051
|
+
if (activeChannelId === channel.id) {
|
|
19052
|
+
store.dispatch(addMessageAC(messageToSend));
|
|
19053
|
+
}
|
|
19054
|
+
store.dispatch(scrollToNewMessageAC(true));
|
|
19055
|
+
}
|
|
19051
19056
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19052
19057
|
_context2.n = 12;
|
|
19053
19058
|
break;
|
|
@@ -19068,9 +19073,13 @@ function sendMessage(action) {
|
|
|
19068
19073
|
linkAttachmentToSend = linkAttachmentBuilder.setName(linkAttachment.name).setUpload(linkAttachment.upload).create();
|
|
19069
19074
|
}
|
|
19070
19075
|
if (linkAttachmentToSend) {
|
|
19071
|
-
messageToSend
|
|
19076
|
+
messageToSend = _extends({}, messageToSend, {
|
|
19077
|
+
attachments: [].concat(_attachmentsToSend, [linkAttachmentToSend])
|
|
19078
|
+
});
|
|
19072
19079
|
} else {
|
|
19073
|
-
messageToSend
|
|
19080
|
+
messageToSend = _extends({}, messageToSend, {
|
|
19081
|
+
attachments: [].concat(_attachmentsToSend)
|
|
19082
|
+
});
|
|
19074
19083
|
}
|
|
19075
19084
|
_context2.n = 4;
|
|
19076
19085
|
return call(channel.sendMessage, messageToSend);
|
|
@@ -19106,7 +19115,9 @@ function sendMessage(action) {
|
|
|
19106
19115
|
_context2.n = 5;
|
|
19107
19116
|
break;
|
|
19108
19117
|
case 8:
|
|
19109
|
-
|
|
19118
|
+
if (action.type === RESEND_MESSAGE) {
|
|
19119
|
+
messageToSend.tid && store.dispatch(removePendingMessageAC(channel.id, messageToSend.tid));
|
|
19120
|
+
}
|
|
19110
19121
|
attachmentsToUpdate = [];
|
|
19111
19122
|
if (messageResponse.attachments && messageResponse.attachments.length > 0) {
|
|
19112
19123
|
currentAttachmentsMap = {};
|
|
@@ -19238,7 +19249,7 @@ function sendMessage(action) {
|
|
|
19238
19249
|
}, _marked$3, null, [[1, 15]]);
|
|
19239
19250
|
}
|
|
19240
19251
|
function sendTextMessage(action) {
|
|
19241
|
-
var payload, message, connectionState, channelId, isAddToPendingMessagesMap, channel, sendMessageTid, pendingMessage, activeChannelId, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, _messageResponse, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t3;
|
|
19252
|
+
var payload, message, connectionState, channelId, isAddToPendingMessagesMap, channel, sendMessageTid, pendingMessage, activeChannelId, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, _activeChannelId, _messageResponse, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, _t3;
|
|
19242
19253
|
return _regenerator().w(function (_context4) {
|
|
19243
19254
|
while (1) switch (_context4.p = _context4.n) {
|
|
19244
19255
|
case 0:
|
|
@@ -19312,7 +19323,17 @@ function sendTextMessage(action) {
|
|
|
19312
19323
|
if (pendingMessage && pendingMessage.metadata) {
|
|
19313
19324
|
pendingMessage.metadata = JSON.parse(pendingMessage.metadata);
|
|
19314
19325
|
}
|
|
19315
|
-
|
|
19326
|
+
if (action.type !== RESEND_MESSAGE && pendingMessage) {
|
|
19327
|
+
_activeChannelId = getActiveChannelId();
|
|
19328
|
+
addMessageToMap(channel.id, pendingMessage);
|
|
19329
|
+
if (_activeChannelId === channel.id) {
|
|
19330
|
+
addAllMessages([pendingMessage], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
19331
|
+
}
|
|
19332
|
+
if (_activeChannelId === channel.id) {
|
|
19333
|
+
store.dispatch(addMessageAC(pendingMessage));
|
|
19334
|
+
}
|
|
19335
|
+
store.dispatch(scrollToNewMessageAC(true));
|
|
19336
|
+
}
|
|
19316
19337
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19317
19338
|
_context4.n = 15;
|
|
19318
19339
|
break;
|
|
@@ -19382,11 +19403,8 @@ function sendTextMessage(action) {
|
|
|
19382
19403
|
return put(markChannelAsReadAC(channel.id));
|
|
19383
19404
|
case 14:
|
|
19384
19405
|
channel.lastMessage = messageToUpdate;
|
|
19385
|
-
if (
|
|
19386
|
-
message.tid && store.dispatch(removePendingMessageAC(channel.id, message.tid));
|
|
19387
|
-
message.id && store.dispatch(removePendingMessageAC(channel.id, message.id));
|
|
19406
|
+
if (action.type === RESEND_MESSAGE) {
|
|
19388
19407
|
messageToSend.tid && store.dispatch(removePendingMessageAC(channel.id, messageToSend.tid));
|
|
19389
|
-
messageToSend.id && store.dispatch(removePendingMessageAC(channel.id, messageToSend.id));
|
|
19390
19408
|
}
|
|
19391
19409
|
_context4.n = 16;
|
|
19392
19410
|
break;
|
|
@@ -19546,6 +19564,15 @@ function forwardMessage(action) {
|
|
|
19546
19564
|
_context5.n = 8;
|
|
19547
19565
|
return put(getMessagesAC(channel));
|
|
19548
19566
|
case 8:
|
|
19567
|
+
if (action.type !== RESEND_MESSAGE) {
|
|
19568
|
+
addMessageToMap(channel.id, pendingMessage);
|
|
19569
|
+
if (activeChannelId === channel.id) {
|
|
19570
|
+
addAllMessages([pendingMessage], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
19571
|
+
}
|
|
19572
|
+
if (activeChannelId === channel.id) {
|
|
19573
|
+
store.dispatch(addMessageAC(pendingMessage));
|
|
19574
|
+
}
|
|
19575
|
+
}
|
|
19549
19576
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19550
19577
|
_context5.n = 14;
|
|
19551
19578
|
break;
|
|
@@ -19577,7 +19604,9 @@ function forwardMessage(action) {
|
|
|
19577
19604
|
case 10:
|
|
19578
19605
|
updateMessageOnAllMessages(messageToSend.tid, messageUpdateData);
|
|
19579
19606
|
case 11:
|
|
19580
|
-
|
|
19607
|
+
if (action.type === RESEND_MESSAGE) {
|
|
19608
|
+
messageToSend.tid && store.dispatch(removePendingMessageAC(channel.id, messageToSend.tid));
|
|
19609
|
+
}
|
|
19581
19610
|
updateMessageOnMap(channel.id, {
|
|
19582
19611
|
messageId: !isAddToPendingMessagesMap ? message.tid : messageToSend.tid,
|
|
19583
19612
|
params: messageUpdateData
|
|
@@ -19797,19 +19826,118 @@ function editMessage(action) {
|
|
|
19797
19826
|
}
|
|
19798
19827
|
}, _marked6$1, null, [[0, 5]]);
|
|
19799
19828
|
}
|
|
19800
|
-
function
|
|
19801
|
-
var
|
|
19829
|
+
var sendPendingMessages = /*#__PURE__*/_regenerator().m(function _callee3(connectionState) {
|
|
19830
|
+
var pendingMessagesMap, channelId, _iterator, _step, _msg$attachments, msg, attachments, pendingPollActionsMap, _t7, _t8, _t9;
|
|
19802
19831
|
return _regenerator().w(function (_context9) {
|
|
19803
19832
|
while (1) switch (_context9.p = _context9.n) {
|
|
19804
19833
|
case 0:
|
|
19805
|
-
|
|
19834
|
+
pendingMessagesMap = _extends({}, getPendingMessagesMap());
|
|
19835
|
+
_t7 = _regeneratorKeys(pendingMessagesMap);
|
|
19836
|
+
case 1:
|
|
19837
|
+
if ((_t8 = _t7()).done) {
|
|
19838
|
+
_context9.n = 12;
|
|
19839
|
+
break;
|
|
19840
|
+
}
|
|
19841
|
+
channelId = _t8.value;
|
|
19842
|
+
_iterator = _createForOfIteratorHelperLoose(pendingMessagesMap[channelId]);
|
|
19843
|
+
case 2:
|
|
19844
|
+
if ((_step = _iterator()).done) {
|
|
19845
|
+
_context9.n = 11;
|
|
19846
|
+
break;
|
|
19847
|
+
}
|
|
19848
|
+
msg = _step.value;
|
|
19849
|
+
attachments = msg === null || msg === void 0 ? void 0 : (_msg$attachments = msg.attachments) === null || _msg$attachments === void 0 ? void 0 : _msg$attachments.filter(function (att) {
|
|
19850
|
+
return (att === null || att === void 0 ? void 0 : att.type) !== attachmentTypes.link;
|
|
19851
|
+
});
|
|
19852
|
+
_context9.p = 3;
|
|
19853
|
+
if (!(msg !== null && msg !== void 0 && msg.forwardingDetails)) {
|
|
19854
|
+
_context9.n = 5;
|
|
19855
|
+
break;
|
|
19856
|
+
}
|
|
19857
|
+
_context9.n = 4;
|
|
19858
|
+
return call(forwardMessage, {
|
|
19859
|
+
type: RESEND_MESSAGE,
|
|
19860
|
+
payload: {
|
|
19861
|
+
message: msg,
|
|
19862
|
+
connectionState: connectionState,
|
|
19863
|
+
channelId: channelId,
|
|
19864
|
+
isForward: true,
|
|
19865
|
+
isAddToPendingMessagesMap: false
|
|
19866
|
+
}
|
|
19867
|
+
});
|
|
19868
|
+
case 4:
|
|
19869
|
+
_context9.n = 8;
|
|
19870
|
+
break;
|
|
19871
|
+
case 5:
|
|
19872
|
+
if (!(attachments && attachments.length > 0)) {
|
|
19873
|
+
_context9.n = 7;
|
|
19874
|
+
break;
|
|
19875
|
+
}
|
|
19876
|
+
_context9.n = 6;
|
|
19877
|
+
return call(sendMessage, {
|
|
19878
|
+
type: RESEND_MESSAGE,
|
|
19879
|
+
payload: {
|
|
19880
|
+
message: msg,
|
|
19881
|
+
connectionState: connectionState,
|
|
19882
|
+
channelId: channelId,
|
|
19883
|
+
sendAttachmentsAsSeparateMessage: false,
|
|
19884
|
+
isResend: true,
|
|
19885
|
+
isAddToPendingMessagesMap: false
|
|
19886
|
+
}
|
|
19887
|
+
});
|
|
19888
|
+
case 6:
|
|
19889
|
+
_context9.n = 8;
|
|
19890
|
+
break;
|
|
19891
|
+
case 7:
|
|
19892
|
+
_context9.n = 8;
|
|
19893
|
+
return call(sendTextMessage, {
|
|
19894
|
+
type: RESEND_MESSAGE,
|
|
19895
|
+
payload: {
|
|
19896
|
+
message: msg,
|
|
19897
|
+
connectionState: connectionState,
|
|
19898
|
+
channelId: channelId,
|
|
19899
|
+
isAddToPendingMessagesMap: false
|
|
19900
|
+
}
|
|
19901
|
+
});
|
|
19902
|
+
case 8:
|
|
19903
|
+
_context9.n = 10;
|
|
19904
|
+
break;
|
|
19905
|
+
case 9:
|
|
19906
|
+
_context9.p = 9;
|
|
19907
|
+
_t9 = _context9.v;
|
|
19908
|
+
log.error("Failed to send pending message " + (msg.tid || msg.id) + ":", _t9);
|
|
19909
|
+
case 10:
|
|
19910
|
+
_context9.n = 2;
|
|
19911
|
+
break;
|
|
19912
|
+
case 11:
|
|
19806
19913
|
_context9.n = 1;
|
|
19914
|
+
break;
|
|
19915
|
+
case 12:
|
|
19916
|
+
pendingPollActionsMap = store.getState().MessageReducer.pendingPollActions;
|
|
19917
|
+
if (!(pendingPollActionsMap && Object.keys(pendingPollActionsMap).length > 0)) {
|
|
19918
|
+
_context9.n = 13;
|
|
19919
|
+
break;
|
|
19920
|
+
}
|
|
19921
|
+
_context9.n = 13;
|
|
19922
|
+
return put(resendPendingPollActionsAC(connectionState));
|
|
19923
|
+
case 13:
|
|
19924
|
+
return _context9.a(2);
|
|
19925
|
+
}
|
|
19926
|
+
}, _callee3, null, [[3, 9]]);
|
|
19927
|
+
});
|
|
19928
|
+
function getMessagesQuery(action) {
|
|
19929
|
+
var _action$payload, channel, loadWithLastMessage, messageId, limit, withDeliveredMessages, highlight, behavior, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, result, allMessages, havLastMessage, secondResult, sentMessages, messagesMap, filteredSentMessages, _allMessages, messageIndex, maxLengthPart, _secondResult, thirdResult, _secondResult2, _thirdResult, _secondResult3, _updatedMessages, _Object$values, previousAllMessages, _secondResult4, updatedMessages, lastMessageId, _allMessages2, setMappedAllMessages, allMessagesAfterLastMessage, pendingMessages, _messagesMap, filteredPendingMessages, waitToSendPendingMessages, _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16, _t17, _t18, _t19, _t20, _t21;
|
|
19930
|
+
return _regenerator().w(function (_context0) {
|
|
19931
|
+
while (1) switch (_context0.p = _context0.n) {
|
|
19932
|
+
case 0:
|
|
19933
|
+
_context0.p = 0;
|
|
19934
|
+
_context0.n = 1;
|
|
19807
19935
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
19808
19936
|
case 1:
|
|
19809
19937
|
_action$payload = action.payload, channel = _action$payload.channel, loadWithLastMessage = _action$payload.loadWithLastMessage, messageId = _action$payload.messageId, limit = _action$payload.limit, withDeliveredMessages = _action$payload.withDeliveredMessages, highlight = _action$payload.highlight, behavior = _action$payload.behavior;
|
|
19810
19938
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
19811
19939
|
if (!(channel.id && !channel.isMockChannel)) {
|
|
19812
|
-
|
|
19940
|
+
_context0.n = 76;
|
|
19813
19941
|
break;
|
|
19814
19942
|
}
|
|
19815
19943
|
SceytChatClient = getClient();
|
|
@@ -19817,19 +19945,19 @@ function getMessagesQuery(action) {
|
|
|
19817
19945
|
messageQueryBuilder.limit(limit || MESSAGES_MAX_LENGTH);
|
|
19818
19946
|
messageQueryBuilder.reverse(true);
|
|
19819
19947
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19820
|
-
|
|
19948
|
+
_context0.n = 3;
|
|
19821
19949
|
break;
|
|
19822
19950
|
}
|
|
19823
|
-
|
|
19951
|
+
_context0.n = 2;
|
|
19824
19952
|
return call(messageQueryBuilder.build);
|
|
19825
19953
|
case 2:
|
|
19826
|
-
|
|
19827
|
-
|
|
19954
|
+
_t0 = _context0.v;
|
|
19955
|
+
_context0.n = 4;
|
|
19828
19956
|
break;
|
|
19829
19957
|
case 3:
|
|
19830
|
-
|
|
19958
|
+
_t0 = null;
|
|
19831
19959
|
case 4:
|
|
19832
|
-
messageQuery =
|
|
19960
|
+
messageQuery = _t0;
|
|
19833
19961
|
query.messageQuery = messageQuery;
|
|
19834
19962
|
cachedMessages = Object.values(getMessagesFromMap(channel.id) || {}).sort(function (a, b) {
|
|
19835
19963
|
return Number(a.id) - Number(b.id);
|
|
@@ -19839,57 +19967,57 @@ function getMessagesQuery(action) {
|
|
|
19839
19967
|
hasNext: false
|
|
19840
19968
|
};
|
|
19841
19969
|
if (!loadWithLastMessage) {
|
|
19842
|
-
|
|
19970
|
+
_context0.n = 19;
|
|
19843
19971
|
break;
|
|
19844
19972
|
}
|
|
19845
19973
|
allMessages = getAllMessages();
|
|
19846
19974
|
havLastMessage = allMessages && allMessages.length && channel.lastMessage && allMessages[allMessages.length - 1] && allMessages[allMessages.length - 1].id === channel.lastMessage.id;
|
|
19847
19975
|
if (!(channel.newMessageCount && channel.newMessageCount > 0 || !havLastMessage)) {
|
|
19848
|
-
|
|
19976
|
+
_context0.n = 14;
|
|
19849
19977
|
break;
|
|
19850
19978
|
}
|
|
19851
19979
|
setHasPrevCached(false);
|
|
19852
19980
|
setMessagesToMap(channel.id, []);
|
|
19853
19981
|
setAllMessages([]);
|
|
19854
19982
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19855
|
-
|
|
19983
|
+
_context0.n = 6;
|
|
19856
19984
|
break;
|
|
19857
19985
|
}
|
|
19858
|
-
|
|
19986
|
+
_context0.n = 5;
|
|
19859
19987
|
return call(messageQuery.loadPreviousMessageId, '0');
|
|
19860
19988
|
case 5:
|
|
19861
|
-
|
|
19862
|
-
|
|
19989
|
+
_t1 = _context0.v;
|
|
19990
|
+
_context0.n = 7;
|
|
19863
19991
|
break;
|
|
19864
19992
|
case 6:
|
|
19865
|
-
|
|
19993
|
+
_t1 = {
|
|
19866
19994
|
messages: [],
|
|
19867
19995
|
hasNext: false
|
|
19868
19996
|
};
|
|
19869
19997
|
case 7:
|
|
19870
|
-
result =
|
|
19998
|
+
result = _t1;
|
|
19871
19999
|
if (!(result.messages.length === 50)) {
|
|
19872
|
-
|
|
20000
|
+
_context0.n = 11;
|
|
19873
20001
|
break;
|
|
19874
20002
|
}
|
|
19875
20003
|
messageQuery.limit = 30;
|
|
19876
20004
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19877
|
-
|
|
20005
|
+
_context0.n = 9;
|
|
19878
20006
|
break;
|
|
19879
20007
|
}
|
|
19880
|
-
|
|
20008
|
+
_context0.n = 8;
|
|
19881
20009
|
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
19882
20010
|
case 8:
|
|
19883
|
-
|
|
19884
|
-
|
|
20011
|
+
_t10 = _context0.v;
|
|
20012
|
+
_context0.n = 10;
|
|
19885
20013
|
break;
|
|
19886
20014
|
case 9:
|
|
19887
|
-
|
|
20015
|
+
_t10 = {
|
|
19888
20016
|
messages: [],
|
|
19889
20017
|
hasNext: false
|
|
19890
20018
|
};
|
|
19891
20019
|
case 10:
|
|
19892
|
-
secondResult =
|
|
20020
|
+
secondResult = _t10;
|
|
19893
20021
|
result.messages = [].concat(secondResult.messages, result.messages);
|
|
19894
20022
|
result.hasNext = secondResult.hasNext;
|
|
19895
20023
|
case 11:
|
|
@@ -19905,40 +20033,40 @@ function getMessagesQuery(action) {
|
|
|
19905
20033
|
return !messagesMap[msg.tid || ''];
|
|
19906
20034
|
});
|
|
19907
20035
|
result.messages = [].concat(result.messages, filteredSentMessages).slice(filteredSentMessages.length);
|
|
19908
|
-
|
|
20036
|
+
_context0.n = 12;
|
|
19909
20037
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
19910
20038
|
case 12:
|
|
19911
20039
|
setMessagesToMap(channel.id, result.messages);
|
|
19912
20040
|
setAllMessages(result.messages);
|
|
19913
|
-
|
|
20041
|
+
_context0.n = 13;
|
|
19914
20042
|
return put(setMessagesHasPrevAC(true));
|
|
19915
20043
|
case 13:
|
|
19916
|
-
|
|
20044
|
+
_context0.n = 16;
|
|
19917
20045
|
break;
|
|
19918
20046
|
case 14:
|
|
19919
20047
|
result.messages = getFromAllMessagesByMessageId('', '', true);
|
|
19920
|
-
|
|
20048
|
+
_context0.n = 15;
|
|
19921
20049
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
19922
20050
|
case 15:
|
|
19923
|
-
|
|
20051
|
+
_context0.n = 16;
|
|
19924
20052
|
return put(setMessagesHasPrevAC(true));
|
|
19925
20053
|
case 16:
|
|
19926
|
-
|
|
20054
|
+
_context0.n = 17;
|
|
19927
20055
|
return put(setMessagesHasNextAC(false));
|
|
19928
20056
|
case 17:
|
|
19929
20057
|
setHasNextCached(false);
|
|
19930
20058
|
if (!messageId) {
|
|
19931
|
-
|
|
20059
|
+
_context0.n = 18;
|
|
19932
20060
|
break;
|
|
19933
20061
|
}
|
|
19934
|
-
|
|
20062
|
+
_context0.n = 18;
|
|
19935
20063
|
return put(setScrollToMessagesAC(messageId, highlight, behavior));
|
|
19936
20064
|
case 18:
|
|
19937
|
-
|
|
20065
|
+
_context0.n = 72;
|
|
19938
20066
|
break;
|
|
19939
20067
|
case 19:
|
|
19940
20068
|
if (!messageId) {
|
|
19941
|
-
|
|
20069
|
+
_context0.n = 38;
|
|
19942
20070
|
break;
|
|
19943
20071
|
}
|
|
19944
20072
|
_allMessages = getAllMessages();
|
|
@@ -19947,87 +20075,87 @@ function getMessagesQuery(action) {
|
|
|
19947
20075
|
});
|
|
19948
20076
|
maxLengthPart = MESSAGES_MAX_LENGTH / 2;
|
|
19949
20077
|
if (!(messageIndex >= maxLengthPart)) {
|
|
19950
|
-
|
|
20078
|
+
_context0.n = 22;
|
|
19951
20079
|
break;
|
|
19952
20080
|
}
|
|
19953
20081
|
result.messages = _allMessages.slice(messageIndex - maxLengthPart, messageIndex + maxLengthPart);
|
|
19954
|
-
|
|
20082
|
+
_context0.n = 20;
|
|
19955
20083
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
19956
20084
|
case 20:
|
|
19957
20085
|
setHasPrevCached(messageIndex > maxLengthPart);
|
|
19958
20086
|
setHasNextCached(_allMessages.length > maxLengthPart);
|
|
19959
|
-
|
|
20087
|
+
_context0.n = 21;
|
|
19960
20088
|
return put(setMessagesHasPrevAC(true));
|
|
19961
20089
|
case 21:
|
|
19962
|
-
|
|
20090
|
+
_context0.n = 34;
|
|
19963
20091
|
break;
|
|
19964
20092
|
case 22:
|
|
19965
20093
|
messageQuery.limit = MESSAGES_MAX_LENGTH;
|
|
19966
20094
|
log.info('load by message id from server ...............', messageId);
|
|
19967
20095
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19968
|
-
|
|
20096
|
+
_context0.n = 24;
|
|
19969
20097
|
break;
|
|
19970
20098
|
}
|
|
19971
|
-
|
|
20099
|
+
_context0.n = 23;
|
|
19972
20100
|
return call(messageQuery.loadNearMessageId, messageId);
|
|
19973
20101
|
case 23:
|
|
19974
|
-
|
|
19975
|
-
|
|
20102
|
+
_t11 = _context0.v;
|
|
20103
|
+
_context0.n = 25;
|
|
19976
20104
|
break;
|
|
19977
20105
|
case 24:
|
|
19978
|
-
|
|
20106
|
+
_t11 = {
|
|
19979
20107
|
messages: [],
|
|
19980
20108
|
hasNext: false
|
|
19981
20109
|
};
|
|
19982
20110
|
case 25:
|
|
19983
|
-
result =
|
|
20111
|
+
result = _t11;
|
|
19984
20112
|
if (!(result.messages.length === 50)) {
|
|
19985
|
-
|
|
20113
|
+
_context0.n = 32;
|
|
19986
20114
|
break;
|
|
19987
20115
|
}
|
|
19988
20116
|
messageQuery.limit = MESSAGES_MAX_LENGTH - 50;
|
|
19989
20117
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19990
|
-
|
|
20118
|
+
_context0.n = 27;
|
|
19991
20119
|
break;
|
|
19992
20120
|
}
|
|
19993
|
-
|
|
20121
|
+
_context0.n = 26;
|
|
19994
20122
|
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
19995
20123
|
case 26:
|
|
19996
|
-
|
|
19997
|
-
|
|
20124
|
+
_t12 = _context0.v;
|
|
20125
|
+
_context0.n = 28;
|
|
19998
20126
|
break;
|
|
19999
20127
|
case 27:
|
|
20000
|
-
|
|
20128
|
+
_t12 = {
|
|
20001
20129
|
messages: [],
|
|
20002
20130
|
hasNext: false
|
|
20003
20131
|
};
|
|
20004
20132
|
case 28:
|
|
20005
|
-
_secondResult =
|
|
20133
|
+
_secondResult = _t12;
|
|
20006
20134
|
messageQuery.reverse = false;
|
|
20007
20135
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20008
|
-
|
|
20136
|
+
_context0.n = 30;
|
|
20009
20137
|
break;
|
|
20010
20138
|
}
|
|
20011
|
-
|
|
20139
|
+
_context0.n = 29;
|
|
20012
20140
|
return call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
|
|
20013
20141
|
case 29:
|
|
20014
|
-
|
|
20015
|
-
|
|
20142
|
+
_t13 = _context0.v;
|
|
20143
|
+
_context0.n = 31;
|
|
20016
20144
|
break;
|
|
20017
20145
|
case 30:
|
|
20018
|
-
|
|
20146
|
+
_t13 = {
|
|
20019
20147
|
messages: [],
|
|
20020
20148
|
hasNext: false
|
|
20021
20149
|
};
|
|
20022
20150
|
case 31:
|
|
20023
|
-
thirdResult =
|
|
20151
|
+
thirdResult = _t13;
|
|
20024
20152
|
result.messages = [].concat(_secondResult.messages, result.messages, thirdResult.messages);
|
|
20025
20153
|
result.hasNext = _secondResult.hasNext;
|
|
20026
20154
|
messageQuery.reverse = true;
|
|
20027
|
-
|
|
20155
|
+
_context0.n = 32;
|
|
20028
20156
|
return put(setMessagesHasPrevAC(_secondResult.hasNext));
|
|
20029
20157
|
case 32:
|
|
20030
|
-
|
|
20158
|
+
_context0.n = 33;
|
|
20031
20159
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20032
20160
|
case 33:
|
|
20033
20161
|
setMessagesToMap(channel.id, result.messages);
|
|
@@ -20035,208 +20163,208 @@ function getMessagesQuery(action) {
|
|
|
20035
20163
|
setHasPrevCached(false);
|
|
20036
20164
|
setHasNextCached(false);
|
|
20037
20165
|
case 34:
|
|
20038
|
-
|
|
20166
|
+
_context0.n = 35;
|
|
20039
20167
|
return put(setMessagesHasNextAC(true));
|
|
20040
20168
|
case 35:
|
|
20041
|
-
|
|
20169
|
+
_context0.n = 36;
|
|
20042
20170
|
return put(setScrollToMessagesAC(messageId, true, behavior));
|
|
20043
20171
|
case 36:
|
|
20044
|
-
|
|
20172
|
+
_context0.n = 37;
|
|
20045
20173
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
20046
20174
|
case 37:
|
|
20047
|
-
|
|
20175
|
+
_context0.n = 72;
|
|
20048
20176
|
break;
|
|
20049
20177
|
case 38:
|
|
20050
20178
|
if (!(channel.newMessageCount && channel.lastDisplayedMessageId)) {
|
|
20051
|
-
|
|
20179
|
+
_context0.n = 61;
|
|
20052
20180
|
break;
|
|
20053
20181
|
}
|
|
20054
20182
|
setMessagesToMap(channel.id, []);
|
|
20055
20183
|
setAllMessages([]);
|
|
20056
20184
|
messageQuery.limit = MESSAGES_MAX_LENGTH;
|
|
20057
20185
|
if (!Number(channel.lastDisplayedMessageId)) {
|
|
20058
|
-
|
|
20186
|
+
_context0.n = 50;
|
|
20059
20187
|
break;
|
|
20060
20188
|
}
|
|
20061
20189
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20062
|
-
|
|
20190
|
+
_context0.n = 40;
|
|
20063
20191
|
break;
|
|
20064
20192
|
}
|
|
20065
|
-
|
|
20193
|
+
_context0.n = 39;
|
|
20066
20194
|
return call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
|
|
20067
20195
|
case 39:
|
|
20068
|
-
|
|
20069
|
-
|
|
20196
|
+
_t14 = _context0.v;
|
|
20197
|
+
_context0.n = 41;
|
|
20070
20198
|
break;
|
|
20071
20199
|
case 40:
|
|
20072
|
-
|
|
20200
|
+
_t14 = {
|
|
20073
20201
|
messages: [],
|
|
20074
20202
|
hasNext: false
|
|
20075
20203
|
};
|
|
20076
20204
|
case 41:
|
|
20077
|
-
result =
|
|
20205
|
+
result = _t14;
|
|
20078
20206
|
if (!(result.messages.length === 50)) {
|
|
20079
|
-
|
|
20207
|
+
_context0.n = 49;
|
|
20080
20208
|
break;
|
|
20081
20209
|
}
|
|
20082
20210
|
messageQuery.limit = channel.newMessageCount > 25 ? (MESSAGES_MAX_LENGTH - 50) / 2 : MESSAGES_MAX_LENGTH - 50;
|
|
20083
20211
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20084
|
-
|
|
20212
|
+
_context0.n = 43;
|
|
20085
20213
|
break;
|
|
20086
20214
|
}
|
|
20087
|
-
|
|
20215
|
+
_context0.n = 42;
|
|
20088
20216
|
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
20089
20217
|
case 42:
|
|
20090
|
-
|
|
20091
|
-
|
|
20218
|
+
_t15 = _context0.v;
|
|
20219
|
+
_context0.n = 44;
|
|
20092
20220
|
break;
|
|
20093
20221
|
case 43:
|
|
20094
|
-
|
|
20222
|
+
_t15 = {
|
|
20095
20223
|
messages: [],
|
|
20096
20224
|
hasNext: false
|
|
20097
20225
|
};
|
|
20098
20226
|
case 44:
|
|
20099
|
-
_secondResult2 =
|
|
20227
|
+
_secondResult2 = _t15;
|
|
20100
20228
|
if (!(channel.newMessageCount > 25)) {
|
|
20101
|
-
|
|
20229
|
+
_context0.n = 48;
|
|
20102
20230
|
break;
|
|
20103
20231
|
}
|
|
20104
20232
|
messageQuery.reverse = false;
|
|
20105
20233
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20106
|
-
|
|
20234
|
+
_context0.n = 46;
|
|
20107
20235
|
break;
|
|
20108
20236
|
}
|
|
20109
|
-
|
|
20237
|
+
_context0.n = 45;
|
|
20110
20238
|
return call(messageQuery.loadNextMessageId, result.messages[result.messages.length - 1].id);
|
|
20111
20239
|
case 45:
|
|
20112
|
-
|
|
20113
|
-
|
|
20240
|
+
_t16 = _context0.v;
|
|
20241
|
+
_context0.n = 47;
|
|
20114
20242
|
break;
|
|
20115
20243
|
case 46:
|
|
20116
|
-
|
|
20244
|
+
_t16 = {
|
|
20117
20245
|
messages: [],
|
|
20118
20246
|
hasNext: false
|
|
20119
20247
|
};
|
|
20120
20248
|
case 47:
|
|
20121
|
-
_thirdResult =
|
|
20249
|
+
_thirdResult = _t16;
|
|
20122
20250
|
result.messages = [].concat(_secondResult2.messages, result.messages, _thirdResult.messages);
|
|
20123
20251
|
messageQuery.reverse = true;
|
|
20124
|
-
|
|
20252
|
+
_context0.n = 49;
|
|
20125
20253
|
break;
|
|
20126
20254
|
case 48:
|
|
20127
20255
|
result.messages = [].concat(_secondResult2.messages, result.messages);
|
|
20128
20256
|
case 49:
|
|
20129
|
-
|
|
20257
|
+
_context0.n = 57;
|
|
20130
20258
|
break;
|
|
20131
20259
|
case 50:
|
|
20132
20260
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20133
|
-
|
|
20261
|
+
_context0.n = 52;
|
|
20134
20262
|
break;
|
|
20135
20263
|
}
|
|
20136
|
-
|
|
20264
|
+
_context0.n = 51;
|
|
20137
20265
|
return call(messageQuery.loadPrevious);
|
|
20138
20266
|
case 51:
|
|
20139
|
-
|
|
20140
|
-
|
|
20267
|
+
_t17 = _context0.v;
|
|
20268
|
+
_context0.n = 53;
|
|
20141
20269
|
break;
|
|
20142
20270
|
case 52:
|
|
20143
|
-
|
|
20271
|
+
_t17 = {
|
|
20144
20272
|
messages: [],
|
|
20145
20273
|
hasNext: false
|
|
20146
20274
|
};
|
|
20147
20275
|
case 53:
|
|
20148
|
-
result =
|
|
20276
|
+
result = _t17;
|
|
20149
20277
|
if (!(result.messages.length === 50)) {
|
|
20150
|
-
|
|
20278
|
+
_context0.n = 57;
|
|
20151
20279
|
break;
|
|
20152
20280
|
}
|
|
20153
20281
|
messageQuery.limit = MESSAGES_MAX_LENGTH - 50;
|
|
20154
20282
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20155
|
-
|
|
20283
|
+
_context0.n = 55;
|
|
20156
20284
|
break;
|
|
20157
20285
|
}
|
|
20158
|
-
|
|
20286
|
+
_context0.n = 54;
|
|
20159
20287
|
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
20160
20288
|
case 54:
|
|
20161
|
-
|
|
20162
|
-
|
|
20289
|
+
_t18 = _context0.v;
|
|
20290
|
+
_context0.n = 56;
|
|
20163
20291
|
break;
|
|
20164
20292
|
case 55:
|
|
20165
|
-
|
|
20293
|
+
_t18 = {
|
|
20166
20294
|
messages: [],
|
|
20167
20295
|
hasNext: false
|
|
20168
20296
|
};
|
|
20169
20297
|
case 56:
|
|
20170
|
-
_secondResult3 =
|
|
20298
|
+
_secondResult3 = _t18;
|
|
20171
20299
|
result.messages = [].concat(_secondResult3.messages, result.messages);
|
|
20172
20300
|
result.hasNext = _secondResult3.hasNext;
|
|
20173
20301
|
case 57:
|
|
20174
|
-
|
|
20302
|
+
_context0.n = 58;
|
|
20175
20303
|
return put(setMessagesHasPrevAC(true));
|
|
20176
20304
|
case 58:
|
|
20177
|
-
|
|
20305
|
+
_context0.n = 59;
|
|
20178
20306
|
return put(setMessagesHasNextAC(channel.lastMessage && result.messages.length > 0 && channel.lastMessage.id !== result.messages[result.messages.length - 1].id));
|
|
20179
20307
|
case 59:
|
|
20180
20308
|
setMessagesToMap(channel.id, result.messages);
|
|
20181
20309
|
setAllMessages([].concat(result.messages));
|
|
20182
|
-
|
|
20310
|
+
_context0.n = 60;
|
|
20183
20311
|
return put(setMessagesAC(JSON.parse(JSON.stringify(result.messages))));
|
|
20184
20312
|
case 60:
|
|
20185
|
-
|
|
20313
|
+
_context0.n = 72;
|
|
20186
20314
|
break;
|
|
20187
20315
|
case 61:
|
|
20188
20316
|
previousAllMessages = getAllMessages();
|
|
20189
20317
|
setMessagesToMap(channel.id, []);
|
|
20190
20318
|
setAllMessages([]);
|
|
20191
20319
|
if (!(cachedMessages && cachedMessages.length)) {
|
|
20192
|
-
|
|
20320
|
+
_context0.n = 62;
|
|
20193
20321
|
break;
|
|
20194
20322
|
}
|
|
20195
20323
|
setMessagesToMap(channel.id, []);
|
|
20196
20324
|
setAllMessages([].concat(cachedMessages));
|
|
20197
|
-
|
|
20325
|
+
_context0.n = 62;
|
|
20198
20326
|
return put(setMessagesAC(JSON.parse(JSON.stringify(cachedMessages))));
|
|
20199
20327
|
case 62:
|
|
20200
20328
|
log.info('load message from server');
|
|
20201
20329
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20202
|
-
|
|
20330
|
+
_context0.n = 64;
|
|
20203
20331
|
break;
|
|
20204
20332
|
}
|
|
20205
|
-
|
|
20333
|
+
_context0.n = 63;
|
|
20206
20334
|
return call(messageQuery.loadPrevious);
|
|
20207
20335
|
case 63:
|
|
20208
|
-
|
|
20209
|
-
|
|
20336
|
+
_t19 = _context0.v;
|
|
20337
|
+
_context0.n = 65;
|
|
20210
20338
|
break;
|
|
20211
20339
|
case 64:
|
|
20212
|
-
|
|
20340
|
+
_t19 = {
|
|
20213
20341
|
messages: [],
|
|
20214
20342
|
hasNext: false
|
|
20215
20343
|
};
|
|
20216
20344
|
case 65:
|
|
20217
|
-
result =
|
|
20345
|
+
result = _t19;
|
|
20218
20346
|
if (!(result.messages.length === 50)) {
|
|
20219
|
-
|
|
20347
|
+
_context0.n = 69;
|
|
20220
20348
|
break;
|
|
20221
20349
|
}
|
|
20222
20350
|
messageQuery.limit = MESSAGES_MAX_LENGTH - 50;
|
|
20223
20351
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
20224
|
-
|
|
20352
|
+
_context0.n = 67;
|
|
20225
20353
|
break;
|
|
20226
20354
|
}
|
|
20227
|
-
|
|
20355
|
+
_context0.n = 66;
|
|
20228
20356
|
return call(messageQuery.loadPreviousMessageId, result.messages[0].id);
|
|
20229
20357
|
case 66:
|
|
20230
|
-
|
|
20231
|
-
|
|
20358
|
+
_t20 = _context0.v;
|
|
20359
|
+
_context0.n = 68;
|
|
20232
20360
|
break;
|
|
20233
20361
|
case 67:
|
|
20234
|
-
|
|
20362
|
+
_t20 = {
|
|
20235
20363
|
messages: [],
|
|
20236
20364
|
hasNext: false
|
|
20237
20365
|
};
|
|
20238
20366
|
case 68:
|
|
20239
|
-
_secondResult4 =
|
|
20367
|
+
_secondResult4 = _t20;
|
|
20240
20368
|
result.messages = [].concat(_secondResult4.messages, result.messages);
|
|
20241
20369
|
result.hasNext = _secondResult4.hasNext;
|
|
20242
20370
|
case 69:
|
|
@@ -20268,18 +20396,18 @@ function getMessagesQuery(action) {
|
|
|
20268
20396
|
updatedMessages = [].concat(updatedMessages, allMessagesAfterLastMessage || []);
|
|
20269
20397
|
setMessagesToMap(channel.id, updatedMessages);
|
|
20270
20398
|
setAllMessages(updatedMessages);
|
|
20271
|
-
|
|
20399
|
+
_context0.n = 70;
|
|
20272
20400
|
return put(setMessagesAC(JSON.parse(JSON.stringify(updatedMessages))));
|
|
20273
20401
|
case 70:
|
|
20274
|
-
|
|
20402
|
+
_context0.n = 71;
|
|
20275
20403
|
return put(setMessagesHasPrevAC(true));
|
|
20276
20404
|
case 71:
|
|
20277
|
-
|
|
20405
|
+
_context0.n = 72;
|
|
20278
20406
|
return put(setMessagesHasNextAC(false));
|
|
20279
20407
|
case 72:
|
|
20280
20408
|
pendingMessages = getPendingMessages(channel.id);
|
|
20281
20409
|
if (!(pendingMessages && pendingMessages.length)) {
|
|
20282
|
-
|
|
20410
|
+
_context0.n = 73;
|
|
20283
20411
|
break;
|
|
20284
20412
|
}
|
|
20285
20413
|
_messagesMap = {};
|
|
@@ -20289,152 +20417,76 @@ function getMessagesQuery(action) {
|
|
|
20289
20417
|
filteredPendingMessages = pendingMessages.filter(function (msg) {
|
|
20290
20418
|
return !_messagesMap[msg.tid || ''];
|
|
20291
20419
|
});
|
|
20292
|
-
|
|
20420
|
+
_context0.n = 73;
|
|
20293
20421
|
return put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
20294
20422
|
case 73:
|
|
20295
20423
|
waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
|
|
20296
20424
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED && waitToSendPendingMessages)) {
|
|
20297
|
-
|
|
20425
|
+
_context0.n = 75;
|
|
20298
20426
|
break;
|
|
20299
20427
|
}
|
|
20300
|
-
|
|
20428
|
+
_context0.n = 74;
|
|
20301
20429
|
return put(setWaitToSendPendingMessagesAC(false));
|
|
20302
20430
|
case 74:
|
|
20303
|
-
|
|
20304
|
-
|
|
20431
|
+
_context0.n = 75;
|
|
20432
|
+
return spawn(sendPendingMessages, connectionState);
|
|
20305
20433
|
case 75:
|
|
20306
|
-
|
|
20307
|
-
|
|
20308
|
-
break;
|
|
20309
|
-
}
|
|
20310
|
-
channelId = _t19.value;
|
|
20311
|
-
_iterator = _createForOfIteratorHelperLoose(pendingMessagesMap[channelId]);
|
|
20434
|
+
_context0.n = 77;
|
|
20435
|
+
break;
|
|
20312
20436
|
case 76:
|
|
20313
|
-
if (
|
|
20314
|
-
|
|
20315
|
-
break;
|
|
20316
|
-
}
|
|
20317
|
-
msg = _step.value;
|
|
20318
|
-
attachments = (_msg$attachments = msg.attachments) === null || _msg$attachments === void 0 ? void 0 : _msg$attachments.filter(function (att) {
|
|
20319
|
-
return att.type !== attachmentTypes.link;
|
|
20320
|
-
});
|
|
20321
|
-
if (!(msg !== null && msg !== void 0 && msg.forwardingDetails)) {
|
|
20322
|
-
_context9.n = 78;
|
|
20437
|
+
if (!channel.isMockChannel) {
|
|
20438
|
+
_context0.n = 77;
|
|
20323
20439
|
break;
|
|
20324
20440
|
}
|
|
20325
|
-
|
|
20326
|
-
return
|
|
20327
|
-
type: RESEND_MESSAGE,
|
|
20328
|
-
payload: {
|
|
20329
|
-
message: msg,
|
|
20330
|
-
connectionState: connectionState,
|
|
20331
|
-
channelId: channelId
|
|
20332
|
-
}
|
|
20333
|
-
});
|
|
20441
|
+
_context0.n = 77;
|
|
20442
|
+
return put(setMessagesAC([]));
|
|
20334
20443
|
case 77:
|
|
20335
|
-
|
|
20444
|
+
_context0.n = 79;
|
|
20336
20445
|
break;
|
|
20337
20446
|
case 78:
|
|
20338
|
-
|
|
20339
|
-
|
|
20340
|
-
|
|
20341
|
-
}
|
|
20342
|
-
_context9.n = 79;
|
|
20343
|
-
return call(sendMessage, {
|
|
20344
|
-
type: RESEND_MESSAGE,
|
|
20345
|
-
payload: {
|
|
20346
|
-
message: msg,
|
|
20347
|
-
connectionState: connectionState,
|
|
20348
|
-
channelId: channelId
|
|
20349
|
-
}
|
|
20350
|
-
});
|
|
20447
|
+
_context0.p = 78;
|
|
20448
|
+
_t21 = _context0.v;
|
|
20449
|
+
log.error('error in message query', _t21);
|
|
20351
20450
|
case 79:
|
|
20352
|
-
|
|
20353
|
-
|
|
20451
|
+
_context0.p = 79;
|
|
20452
|
+
_context0.n = 80;
|
|
20453
|
+
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
20354
20454
|
case 80:
|
|
20355
|
-
|
|
20356
|
-
return call(sendTextMessage, {
|
|
20357
|
-
type: RESEND_MESSAGE,
|
|
20358
|
-
payload: {
|
|
20359
|
-
message: msg,
|
|
20360
|
-
connectionState: connectionState,
|
|
20361
|
-
channelId: channelId
|
|
20362
|
-
}
|
|
20363
|
-
});
|
|
20455
|
+
return _context0.f(79);
|
|
20364
20456
|
case 81:
|
|
20365
|
-
|
|
20366
|
-
break;
|
|
20367
|
-
case 82:
|
|
20368
|
-
_context9.n = 75;
|
|
20369
|
-
break;
|
|
20370
|
-
case 83:
|
|
20371
|
-
pendingPollActionsMap = store.getState().MessageReducer.pendingPollActions;
|
|
20372
|
-
if (!(pendingPollActionsMap && Object.keys(pendingPollActionsMap).length > 0)) {
|
|
20373
|
-
_context9.n = 84;
|
|
20374
|
-
break;
|
|
20375
|
-
}
|
|
20376
|
-
_context9.n = 84;
|
|
20377
|
-
return put(resendPendingPollActionsAC(connectionState));
|
|
20378
|
-
case 84:
|
|
20379
|
-
_context9.n = 85;
|
|
20380
|
-
return put(setWaitToSendPendingMessagesAC(false));
|
|
20381
|
-
case 85:
|
|
20382
|
-
_context9.n = 87;
|
|
20383
|
-
break;
|
|
20384
|
-
case 86:
|
|
20385
|
-
if (!channel.isMockChannel) {
|
|
20386
|
-
_context9.n = 87;
|
|
20387
|
-
break;
|
|
20388
|
-
}
|
|
20389
|
-
_context9.n = 87;
|
|
20390
|
-
return put(setMessagesAC([]));
|
|
20391
|
-
case 87:
|
|
20392
|
-
_context9.n = 89;
|
|
20393
|
-
break;
|
|
20394
|
-
case 88:
|
|
20395
|
-
_context9.p = 88;
|
|
20396
|
-
_t20 = _context9.v;
|
|
20397
|
-
log.error('error in message query', _t20);
|
|
20398
|
-
case 89:
|
|
20399
|
-
_context9.p = 89;
|
|
20400
|
-
_context9.n = 90;
|
|
20401
|
-
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
20402
|
-
case 90:
|
|
20403
|
-
return _context9.f(89);
|
|
20404
|
-
case 91:
|
|
20405
|
-
return _context9.a(2);
|
|
20457
|
+
return _context0.a(2);
|
|
20406
20458
|
}
|
|
20407
|
-
}, _marked7$1, null, [[0,
|
|
20459
|
+
}, _marked7$1, null, [[0, 78, 79, 81]]);
|
|
20408
20460
|
}
|
|
20409
20461
|
function getMessageQuery(action) {
|
|
20410
|
-
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage,
|
|
20411
|
-
return _regenerator().w(function (
|
|
20412
|
-
while (1) switch (
|
|
20462
|
+
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage, _t22;
|
|
20463
|
+
return _regenerator().w(function (_context1) {
|
|
20464
|
+
while (1) switch (_context1.p = _context1.n) {
|
|
20413
20465
|
case 0:
|
|
20414
|
-
|
|
20466
|
+
_context1.p = 0;
|
|
20415
20467
|
payload = action.payload;
|
|
20416
20468
|
channelId = payload.channelId, messageId = payload.messageId;
|
|
20417
|
-
|
|
20469
|
+
_context1.n = 1;
|
|
20418
20470
|
return call(getChannelFromAllChannels, channelId);
|
|
20419
20471
|
case 1:
|
|
20420
|
-
channel =
|
|
20472
|
+
channel = _context1.v;
|
|
20421
20473
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
20422
20474
|
if (!(!channel || connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
20423
|
-
|
|
20475
|
+
_context1.n = 2;
|
|
20424
20476
|
break;
|
|
20425
20477
|
}
|
|
20426
|
-
return
|
|
20478
|
+
return _context1.a(2);
|
|
20427
20479
|
case 2:
|
|
20428
|
-
|
|
20480
|
+
_context1.n = 3;
|
|
20429
20481
|
return call(channel.getMessagesById, [messageId]);
|
|
20430
20482
|
case 3:
|
|
20431
|
-
messages =
|
|
20483
|
+
messages = _context1.v;
|
|
20432
20484
|
fetchedMessage = messages && messages[0] ? JSON.parse(JSON.stringify(messages[0])) : null;
|
|
20433
20485
|
if (!fetchedMessage) {
|
|
20434
|
-
|
|
20486
|
+
_context1.n = 6;
|
|
20435
20487
|
break;
|
|
20436
20488
|
}
|
|
20437
|
-
|
|
20489
|
+
_context1.n = 4;
|
|
20438
20490
|
return put(updateMessageAC(messageId, fetchedMessage));
|
|
20439
20491
|
case 4:
|
|
20440
20492
|
updateMessageOnMap(channel.id, {
|
|
@@ -20442,45 +20494,45 @@ function getMessageQuery(action) {
|
|
|
20442
20494
|
params: fetchedMessage
|
|
20443
20495
|
});
|
|
20444
20496
|
updateMessageOnAllMessages(messageId, fetchedMessage);
|
|
20445
|
-
|
|
20497
|
+
_context1.n = 5;
|
|
20446
20498
|
return put(setScrollToMessagesAC(messageId, false));
|
|
20447
20499
|
case 5:
|
|
20448
20500
|
if (!(channel.lastMessage && channel.lastMessage.id === messageId)) {
|
|
20449
|
-
|
|
20501
|
+
_context1.n = 6;
|
|
20450
20502
|
break;
|
|
20451
20503
|
}
|
|
20452
20504
|
updateChannelLastMessageOnAllChannels(channel.id, fetchedMessage);
|
|
20453
|
-
|
|
20505
|
+
_context1.n = 6;
|
|
20454
20506
|
return put(updateChannelLastMessageAC(fetchedMessage, channel));
|
|
20455
20507
|
case 6:
|
|
20456
|
-
|
|
20508
|
+
_context1.n = 8;
|
|
20457
20509
|
break;
|
|
20458
20510
|
case 7:
|
|
20459
|
-
|
|
20460
|
-
|
|
20461
|
-
log.error('error in message query',
|
|
20511
|
+
_context1.p = 7;
|
|
20512
|
+
_t22 = _context1.v;
|
|
20513
|
+
log.error('error in message query', _t22);
|
|
20462
20514
|
case 8:
|
|
20463
|
-
return
|
|
20515
|
+
return _context1.a(2);
|
|
20464
20516
|
}
|
|
20465
20517
|
}, _marked8$1, null, [[0, 7]]);
|
|
20466
20518
|
}
|
|
20467
20519
|
function loadMoreMessages(action) {
|
|
20468
|
-
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result,
|
|
20469
|
-
return _regenerator().w(function (
|
|
20470
|
-
while (1) switch (
|
|
20520
|
+
var payload, limit, direction, channelId, messageId, hasNext, SceytChatClient, messageQueryBuilder, messageQuery, result, _t23;
|
|
20521
|
+
return _regenerator().w(function (_context10) {
|
|
20522
|
+
while (1) switch (_context10.p = _context10.n) {
|
|
20471
20523
|
case 0:
|
|
20472
|
-
|
|
20524
|
+
_context10.p = 0;
|
|
20473
20525
|
payload = action.payload;
|
|
20474
20526
|
limit = payload.limit, direction = payload.direction, channelId = payload.channelId, messageId = payload.messageId, hasNext = payload.hasNext;
|
|
20475
20527
|
SceytChatClient = getClient();
|
|
20476
20528
|
messageQueryBuilder = new SceytChatClient.MessageListQueryBuilder(channelId);
|
|
20477
20529
|
messageQueryBuilder.reverse(true);
|
|
20478
|
-
|
|
20530
|
+
_context10.n = 1;
|
|
20479
20531
|
return call(messageQueryBuilder.build);
|
|
20480
20532
|
case 1:
|
|
20481
|
-
messageQuery =
|
|
20533
|
+
messageQuery = _context10.v;
|
|
20482
20534
|
messageQuery.limit = limit || 5;
|
|
20483
|
-
|
|
20535
|
+
_context10.n = 2;
|
|
20484
20536
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
20485
20537
|
case 2:
|
|
20486
20538
|
result = {
|
|
@@ -20488,130 +20540,130 @@ function loadMoreMessages(action) {
|
|
|
20488
20540
|
hasNext: false
|
|
20489
20541
|
};
|
|
20490
20542
|
if (!(direction === MESSAGE_LOAD_DIRECTION.PREV)) {
|
|
20491
|
-
|
|
20543
|
+
_context10.n = 6;
|
|
20492
20544
|
break;
|
|
20493
20545
|
}
|
|
20494
20546
|
if (!getHasPrevCached()) {
|
|
20495
|
-
|
|
20547
|
+
_context10.n = 3;
|
|
20496
20548
|
break;
|
|
20497
20549
|
}
|
|
20498
20550
|
result.messages = getFromAllMessagesByMessageId(messageId, MESSAGE_LOAD_DIRECTION.PREV);
|
|
20499
|
-
|
|
20551
|
+
_context10.n = 5;
|
|
20500
20552
|
break;
|
|
20501
20553
|
case 3:
|
|
20502
20554
|
if (!hasNext) {
|
|
20503
|
-
|
|
20555
|
+
_context10.n = 5;
|
|
20504
20556
|
break;
|
|
20505
20557
|
}
|
|
20506
|
-
|
|
20558
|
+
_context10.n = 4;
|
|
20507
20559
|
return call(messageQuery.loadPreviousMessageId, messageId);
|
|
20508
20560
|
case 4:
|
|
20509
|
-
result =
|
|
20561
|
+
result = _context10.v;
|
|
20510
20562
|
if (result.messages.length) {
|
|
20511
20563
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.PREV);
|
|
20512
20564
|
setMessagesToMap(channelId, result.messages);
|
|
20513
20565
|
}
|
|
20514
|
-
|
|
20566
|
+
_context10.n = 5;
|
|
20515
20567
|
return put(setMessagesHasPrevAC(result.hasNext));
|
|
20516
20568
|
case 5:
|
|
20517
|
-
|
|
20569
|
+
_context10.n = 10;
|
|
20518
20570
|
break;
|
|
20519
20571
|
case 6:
|
|
20520
20572
|
if (!getHasNextCached()) {
|
|
20521
|
-
|
|
20573
|
+
_context10.n = 7;
|
|
20522
20574
|
break;
|
|
20523
20575
|
}
|
|
20524
20576
|
result.messages = getFromAllMessagesByMessageId(messageId, MESSAGE_LOAD_DIRECTION.NEXT);
|
|
20525
|
-
|
|
20577
|
+
_context10.n = 9;
|
|
20526
20578
|
break;
|
|
20527
20579
|
case 7:
|
|
20528
20580
|
if (!hasNext) {
|
|
20529
|
-
|
|
20581
|
+
_context10.n = 9;
|
|
20530
20582
|
break;
|
|
20531
20583
|
}
|
|
20532
20584
|
log.info('saga load next from server ... ', messageId);
|
|
20533
20585
|
messageQuery.reverse = false;
|
|
20534
|
-
|
|
20586
|
+
_context10.n = 8;
|
|
20535
20587
|
return call(messageQuery.loadNextMessageId, messageId);
|
|
20536
20588
|
case 8:
|
|
20537
|
-
result =
|
|
20589
|
+
result = _context10.v;
|
|
20538
20590
|
if (result.messages.length) {
|
|
20539
20591
|
addAllMessages(result.messages, MESSAGE_LOAD_DIRECTION.NEXT);
|
|
20540
20592
|
setMessagesToMap(channelId, result.messages);
|
|
20541
20593
|
}
|
|
20542
|
-
|
|
20594
|
+
_context10.n = 9;
|
|
20543
20595
|
return put(setMessagesHasNextAC(result.hasNext));
|
|
20544
20596
|
case 9:
|
|
20545
|
-
|
|
20597
|
+
_context10.n = 10;
|
|
20546
20598
|
return put(setMessagesHasPrevAC(true));
|
|
20547
20599
|
case 10:
|
|
20548
20600
|
if (!(result.messages && result.messages.length && result.messages.length > 0)) {
|
|
20549
|
-
|
|
20601
|
+
_context10.n = 12;
|
|
20550
20602
|
break;
|
|
20551
20603
|
}
|
|
20552
|
-
|
|
20604
|
+
_context10.n = 11;
|
|
20553
20605
|
return put(addMessagesAC(JSON.parse(JSON.stringify(result.messages)), direction));
|
|
20554
20606
|
case 11:
|
|
20555
|
-
|
|
20607
|
+
_context10.n = 16;
|
|
20556
20608
|
break;
|
|
20557
20609
|
case 12:
|
|
20558
|
-
|
|
20610
|
+
_context10.n = 13;
|
|
20559
20611
|
return put(addMessagesAC([], direction));
|
|
20560
20612
|
case 13:
|
|
20561
20613
|
if (!(direction === MESSAGE_LOAD_DIRECTION.NEXT)) {
|
|
20562
|
-
|
|
20614
|
+
_context10.n = 15;
|
|
20563
20615
|
break;
|
|
20564
20616
|
}
|
|
20565
|
-
|
|
20617
|
+
_context10.n = 14;
|
|
20566
20618
|
return put(setMessagesHasNextAC(false));
|
|
20567
20619
|
case 14:
|
|
20568
|
-
|
|
20620
|
+
_context10.n = 16;
|
|
20569
20621
|
break;
|
|
20570
20622
|
case 15:
|
|
20571
|
-
|
|
20623
|
+
_context10.n = 16;
|
|
20572
20624
|
return put(setMessagesHasPrevAC(false));
|
|
20573
20625
|
case 16:
|
|
20574
|
-
|
|
20626
|
+
_context10.n = 17;
|
|
20575
20627
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
20576
20628
|
case 17:
|
|
20577
|
-
|
|
20629
|
+
_context10.n = 19;
|
|
20578
20630
|
break;
|
|
20579
20631
|
case 18:
|
|
20580
|
-
|
|
20581
|
-
|
|
20582
|
-
log.error('error in load more messages',
|
|
20632
|
+
_context10.p = 18;
|
|
20633
|
+
_t23 = _context10.v;
|
|
20634
|
+
log.error('error in load more messages', _t23);
|
|
20583
20635
|
case 19:
|
|
20584
|
-
return
|
|
20636
|
+
return _context10.a(2);
|
|
20585
20637
|
}
|
|
20586
20638
|
}, _marked9$1, null, [[0, 18]]);
|
|
20587
20639
|
}
|
|
20588
20640
|
function addReaction(action) {
|
|
20589
|
-
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam,
|
|
20590
|
-
return _regenerator().w(function (
|
|
20591
|
-
while (1) switch (
|
|
20641
|
+
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam, _t24;
|
|
20642
|
+
return _regenerator().w(function (_context11) {
|
|
20643
|
+
while (1) switch (_context11.p = _context11.n) {
|
|
20592
20644
|
case 0:
|
|
20593
|
-
|
|
20645
|
+
_context11.p = 0;
|
|
20594
20646
|
payload = action.payload;
|
|
20595
20647
|
channelId = payload.channelId, messageId = payload.messageId, key = payload.key, score = payload.score, reason = payload.reason, enforceUnique = payload.enforceUnique;
|
|
20596
20648
|
user = getClient().user;
|
|
20597
|
-
|
|
20649
|
+
_context11.n = 1;
|
|
20598
20650
|
return call(getChannelFromMap, channelId);
|
|
20599
20651
|
case 1:
|
|
20600
|
-
channel =
|
|
20652
|
+
channel = _context11.v;
|
|
20601
20653
|
if (!channel) {
|
|
20602
20654
|
channel = getChannelFromAllChannels(channelId);
|
|
20603
20655
|
if (channel) {
|
|
20604
20656
|
setChannelInMap(channel);
|
|
20605
20657
|
}
|
|
20606
20658
|
}
|
|
20607
|
-
|
|
20659
|
+
_context11.n = 2;
|
|
20608
20660
|
return call(channel.addReaction, messageId, key, score, reason, enforceUnique);
|
|
20609
20661
|
case 2:
|
|
20610
|
-
_yield$call =
|
|
20662
|
+
_yield$call = _context11.v;
|
|
20611
20663
|
message = _yield$call.message;
|
|
20612
20664
|
reaction = _yield$call.reaction;
|
|
20613
20665
|
if (!(user.id === message.user.id)) {
|
|
20614
|
-
|
|
20666
|
+
_context11.n = 4;
|
|
20615
20667
|
break;
|
|
20616
20668
|
}
|
|
20617
20669
|
channelUpdateParam = {
|
|
@@ -20619,99 +20671,99 @@ function addReaction(action) {
|
|
|
20619
20671
|
lastReactedMessage: message,
|
|
20620
20672
|
newReactions: [reaction]
|
|
20621
20673
|
};
|
|
20622
|
-
|
|
20674
|
+
_context11.n = 3;
|
|
20623
20675
|
return put(updateChannelDataAC(channel.id, channelUpdateParam));
|
|
20624
20676
|
case 3:
|
|
20625
20677
|
updateChannelOnAllChannels(channel.id, channelUpdateParam);
|
|
20626
20678
|
case 4:
|
|
20627
|
-
|
|
20679
|
+
_context11.n = 5;
|
|
20628
20680
|
return put(addChannelAC(JSON.parse(JSON.stringify(channel))));
|
|
20629
20681
|
case 5:
|
|
20630
|
-
|
|
20682
|
+
_context11.n = 6;
|
|
20631
20683
|
return put(addReactionToListAC(reaction));
|
|
20632
20684
|
case 6:
|
|
20633
|
-
|
|
20685
|
+
_context11.n = 7;
|
|
20634
20686
|
return put(addReactionToMessageAC(message, reaction, true));
|
|
20635
20687
|
case 7:
|
|
20636
20688
|
addReactionToMessageOnMap(channelId, message, reaction, true);
|
|
20637
20689
|
addReactionOnAllMessages(message, reaction, true);
|
|
20638
|
-
|
|
20690
|
+
_context11.n = 9;
|
|
20639
20691
|
break;
|
|
20640
20692
|
case 8:
|
|
20641
|
-
|
|
20642
|
-
|
|
20643
|
-
log.error('ERROR in add reaction',
|
|
20693
|
+
_context11.p = 8;
|
|
20694
|
+
_t24 = _context11.v;
|
|
20695
|
+
log.error('ERROR in add reaction', _t24.message);
|
|
20644
20696
|
case 9:
|
|
20645
|
-
return
|
|
20697
|
+
return _context11.a(2);
|
|
20646
20698
|
}
|
|
20647
20699
|
}, _marked0$1, null, [[0, 8]]);
|
|
20648
20700
|
}
|
|
20649
20701
|
function deleteReaction(action) {
|
|
20650
|
-
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam,
|
|
20651
|
-
return _regenerator().w(function (
|
|
20652
|
-
while (1) switch (
|
|
20702
|
+
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam, _t25;
|
|
20703
|
+
return _regenerator().w(function (_context12) {
|
|
20704
|
+
while (1) switch (_context12.p = _context12.n) {
|
|
20653
20705
|
case 0:
|
|
20654
|
-
|
|
20706
|
+
_context12.p = 0;
|
|
20655
20707
|
payload = action.payload;
|
|
20656
20708
|
channelId = payload.channelId, messageId = payload.messageId, key = payload.key, isLastReaction = payload.isLastReaction;
|
|
20657
|
-
|
|
20709
|
+
_context12.n = 1;
|
|
20658
20710
|
return call(getChannelFromMap, channelId);
|
|
20659
20711
|
case 1:
|
|
20660
|
-
channel =
|
|
20712
|
+
channel = _context12.v;
|
|
20661
20713
|
if (!channel) {
|
|
20662
20714
|
channel = getChannelFromAllChannels(channelId);
|
|
20663
20715
|
if (channel) {
|
|
20664
20716
|
setChannelInMap(channel);
|
|
20665
20717
|
}
|
|
20666
20718
|
}
|
|
20667
|
-
|
|
20719
|
+
_context12.n = 2;
|
|
20668
20720
|
return call(channel.deleteReaction, messageId, key);
|
|
20669
20721
|
case 2:
|
|
20670
|
-
_yield$call2 =
|
|
20722
|
+
_yield$call2 = _context12.v;
|
|
20671
20723
|
message = _yield$call2.message;
|
|
20672
20724
|
reaction = _yield$call2.reaction;
|
|
20673
20725
|
if (!isLastReaction) {
|
|
20674
|
-
|
|
20726
|
+
_context12.n = 4;
|
|
20675
20727
|
break;
|
|
20676
20728
|
}
|
|
20677
20729
|
channelUpdateParam = {
|
|
20678
20730
|
userMessageReactions: [],
|
|
20679
20731
|
lastReactedMessage: null
|
|
20680
20732
|
};
|
|
20681
|
-
|
|
20733
|
+
_context12.n = 3;
|
|
20682
20734
|
return put(updateChannelDataAC(channel.id, channelUpdateParam));
|
|
20683
20735
|
case 3:
|
|
20684
20736
|
updateChannelOnAllChannels(channel.id, channelUpdateParam);
|
|
20685
20737
|
case 4:
|
|
20686
|
-
|
|
20738
|
+
_context12.n = 5;
|
|
20687
20739
|
return put(deleteReactionFromListAC(reaction));
|
|
20688
20740
|
case 5:
|
|
20689
|
-
|
|
20741
|
+
_context12.n = 6;
|
|
20690
20742
|
return put(deleteReactionFromMessageAC(message, reaction, true));
|
|
20691
20743
|
case 6:
|
|
20692
20744
|
removeReactionToMessageOnMap(channelId, message, reaction, true);
|
|
20693
20745
|
removeReactionOnAllMessages(message, reaction, true);
|
|
20694
|
-
|
|
20746
|
+
_context12.n = 8;
|
|
20695
20747
|
break;
|
|
20696
20748
|
case 7:
|
|
20697
|
-
|
|
20698
|
-
|
|
20699
|
-
log.error('ERROR in delete reaction',
|
|
20749
|
+
_context12.p = 7;
|
|
20750
|
+
_t25 = _context12.v;
|
|
20751
|
+
log.error('ERROR in delete reaction', _t25.message);
|
|
20700
20752
|
case 8:
|
|
20701
|
-
return
|
|
20753
|
+
return _context12.a(2);
|
|
20702
20754
|
}
|
|
20703
20755
|
}, _marked1$1, null, [[0, 7]]);
|
|
20704
20756
|
}
|
|
20705
20757
|
function getReactions(action) {
|
|
20706
|
-
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result,
|
|
20707
|
-
return _regenerator().w(function (
|
|
20708
|
-
while (1) switch (
|
|
20758
|
+
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result, _t26;
|
|
20759
|
+
return _regenerator().w(function (_context13) {
|
|
20760
|
+
while (1) switch (_context13.p = _context13.n) {
|
|
20709
20761
|
case 0:
|
|
20710
|
-
|
|
20762
|
+
_context13.p = 0;
|
|
20711
20763
|
payload = action.payload;
|
|
20712
20764
|
messageId = payload.messageId, key = payload.key, limit = payload.limit;
|
|
20713
20765
|
SceytChatClient = getClient();
|
|
20714
|
-
|
|
20766
|
+
_context13.n = 1;
|
|
20715
20767
|
return put(setReactionsLoadingStateAC(LOADING_STATE.LOADING));
|
|
20716
20768
|
case 1:
|
|
20717
20769
|
reactionQueryBuilder = new SceytChatClient.ReactionListQueryBuilder(messageId);
|
|
@@ -20719,74 +20771,74 @@ function getReactions(action) {
|
|
|
20719
20771
|
if (key) {
|
|
20720
20772
|
reactionQueryBuilder.setKey(key);
|
|
20721
20773
|
}
|
|
20722
|
-
|
|
20774
|
+
_context13.n = 2;
|
|
20723
20775
|
return call(reactionQueryBuilder.build);
|
|
20724
20776
|
case 2:
|
|
20725
|
-
reactionQuery =
|
|
20726
|
-
|
|
20777
|
+
reactionQuery = _context13.v;
|
|
20778
|
+
_context13.n = 3;
|
|
20727
20779
|
return call(reactionQuery.loadNext);
|
|
20728
20780
|
case 3:
|
|
20729
|
-
result =
|
|
20781
|
+
result = _context13.v;
|
|
20730
20782
|
query.ReactionsQuery = reactionQuery;
|
|
20731
|
-
|
|
20783
|
+
_context13.n = 4;
|
|
20732
20784
|
return put(setReactionsListAC(result.reactions, result.hasNext));
|
|
20733
20785
|
case 4:
|
|
20734
|
-
|
|
20786
|
+
_context13.n = 5;
|
|
20735
20787
|
return put(setReactionsLoadingStateAC(LOADING_STATE.LOADED));
|
|
20736
20788
|
case 5:
|
|
20737
|
-
|
|
20789
|
+
_context13.n = 7;
|
|
20738
20790
|
break;
|
|
20739
20791
|
case 6:
|
|
20740
|
-
|
|
20741
|
-
|
|
20742
|
-
log.error('ERROR in get reactions',
|
|
20792
|
+
_context13.p = 6;
|
|
20793
|
+
_t26 = _context13.v;
|
|
20794
|
+
log.error('ERROR in get reactions', _t26.message);
|
|
20743
20795
|
case 7:
|
|
20744
|
-
return
|
|
20796
|
+
return _context13.a(2);
|
|
20745
20797
|
}
|
|
20746
20798
|
}, _marked10$1, null, [[0, 6]]);
|
|
20747
20799
|
}
|
|
20748
20800
|
function loadMoreReactions(action) {
|
|
20749
|
-
var payload, limit, ReactionQuery, result,
|
|
20750
|
-
return _regenerator().w(function (
|
|
20751
|
-
while (1) switch (
|
|
20801
|
+
var payload, limit, ReactionQuery, result, _t27;
|
|
20802
|
+
return _regenerator().w(function (_context14) {
|
|
20803
|
+
while (1) switch (_context14.p = _context14.n) {
|
|
20752
20804
|
case 0:
|
|
20753
|
-
|
|
20805
|
+
_context14.p = 0;
|
|
20754
20806
|
payload = action.payload;
|
|
20755
20807
|
limit = payload.limit;
|
|
20756
|
-
|
|
20808
|
+
_context14.n = 1;
|
|
20757
20809
|
return put(setReactionsLoadingStateAC(LOADING_STATE.LOADING));
|
|
20758
20810
|
case 1:
|
|
20759
20811
|
ReactionQuery = query.ReactionsQuery;
|
|
20760
20812
|
if (limit) {
|
|
20761
20813
|
ReactionQuery.limit = limit;
|
|
20762
20814
|
}
|
|
20763
|
-
|
|
20815
|
+
_context14.n = 2;
|
|
20764
20816
|
return call(ReactionQuery.loadNext);
|
|
20765
20817
|
case 2:
|
|
20766
|
-
result =
|
|
20767
|
-
|
|
20818
|
+
result = _context14.v;
|
|
20819
|
+
_context14.n = 3;
|
|
20768
20820
|
return put(addReactionsToListAC(result.reactions, result.hasNext));
|
|
20769
20821
|
case 3:
|
|
20770
|
-
|
|
20822
|
+
_context14.n = 4;
|
|
20771
20823
|
return put(setReactionsLoadingStateAC(LOADING_STATE.LOADED));
|
|
20772
20824
|
case 4:
|
|
20773
|
-
|
|
20825
|
+
_context14.n = 6;
|
|
20774
20826
|
break;
|
|
20775
20827
|
case 5:
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
log.error('ERROR in load more reactions',
|
|
20828
|
+
_context14.p = 5;
|
|
20829
|
+
_t27 = _context14.v;
|
|
20830
|
+
log.error('ERROR in load more reactions', _t27.message);
|
|
20779
20831
|
case 6:
|
|
20780
|
-
return
|
|
20832
|
+
return _context14.a(2);
|
|
20781
20833
|
}
|
|
20782
20834
|
}, _marked11$1, null, [[0, 5]]);
|
|
20783
20835
|
}
|
|
20784
20836
|
function getMessageAttachments(action) {
|
|
20785
|
-
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result,
|
|
20786
|
-
return _regenerator().w(function (
|
|
20787
|
-
while (1) switch (
|
|
20837
|
+
var _action$payload2, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, _t28;
|
|
20838
|
+
return _regenerator().w(function (_context15) {
|
|
20839
|
+
while (1) switch (_context15.p = _context15.n) {
|
|
20788
20840
|
case 0:
|
|
20789
|
-
|
|
20841
|
+
_context15.p = 0;
|
|
20790
20842
|
_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;
|
|
20791
20843
|
SceytChatClient = getClient();
|
|
20792
20844
|
typeList = [attachmentTypes.video, attachmentTypes.image, attachmentTypes.file, attachmentTypes.link, attachmentTypes.voice];
|
|
@@ -20801,244 +20853,244 @@ function getMessageAttachments(action) {
|
|
|
20801
20853
|
}
|
|
20802
20854
|
AttachmentByTypeQueryBuilder = new SceytChatClient.AttachmentListQueryBuilder(channelId, typeList);
|
|
20803
20855
|
AttachmentByTypeQueryBuilder.limit(limit || 34);
|
|
20804
|
-
|
|
20856
|
+
_context15.n = 1;
|
|
20805
20857
|
return call(AttachmentByTypeQueryBuilder.build);
|
|
20806
20858
|
case 1:
|
|
20807
|
-
AttachmentByTypeQuery =
|
|
20859
|
+
AttachmentByTypeQuery = _context15.v;
|
|
20808
20860
|
if (forPopup) {
|
|
20809
20861
|
AttachmentByTypeQuery.reverse = true;
|
|
20810
20862
|
}
|
|
20811
20863
|
if (!(direction === queryDirection.NEXT)) {
|
|
20812
|
-
|
|
20864
|
+
_context15.n = 3;
|
|
20813
20865
|
break;
|
|
20814
20866
|
}
|
|
20815
|
-
|
|
20867
|
+
_context15.n = 2;
|
|
20816
20868
|
return call(AttachmentByTypeQuery.loadPrevious);
|
|
20817
20869
|
case 2:
|
|
20818
|
-
result =
|
|
20819
|
-
|
|
20870
|
+
result = _context15.v;
|
|
20871
|
+
_context15.n = 7;
|
|
20820
20872
|
break;
|
|
20821
20873
|
case 3:
|
|
20822
20874
|
if (!(direction === queryDirection.NEAR)) {
|
|
20823
|
-
|
|
20875
|
+
_context15.n = 5;
|
|
20824
20876
|
break;
|
|
20825
20877
|
}
|
|
20826
|
-
|
|
20878
|
+
_context15.n = 4;
|
|
20827
20879
|
return call(AttachmentByTypeQuery.loadNearMessageId, attachmentId);
|
|
20828
20880
|
case 4:
|
|
20829
|
-
result =
|
|
20830
|
-
|
|
20881
|
+
result = _context15.v;
|
|
20882
|
+
_context15.n = 7;
|
|
20831
20883
|
break;
|
|
20832
20884
|
case 5:
|
|
20833
|
-
|
|
20885
|
+
_context15.n = 6;
|
|
20834
20886
|
return call(AttachmentByTypeQuery.loadPrevious);
|
|
20835
20887
|
case 6:
|
|
20836
|
-
result =
|
|
20888
|
+
result = _context15.v;
|
|
20837
20889
|
case 7:
|
|
20838
20890
|
if (!forPopup) {
|
|
20839
|
-
|
|
20891
|
+
_context15.n = 10;
|
|
20840
20892
|
break;
|
|
20841
20893
|
}
|
|
20842
20894
|
query.AttachmentByTypeQueryForPopup = AttachmentByTypeQuery;
|
|
20843
|
-
|
|
20895
|
+
_context15.n = 8;
|
|
20844
20896
|
return put(setAttachmentsForPopupAC(JSON.parse(JSON.stringify(result.attachments))));
|
|
20845
20897
|
case 8:
|
|
20846
|
-
|
|
20898
|
+
_context15.n = 9;
|
|
20847
20899
|
return put(setAttachmentsCompleteForPopupAC(result.hasNext));
|
|
20848
20900
|
case 9:
|
|
20849
|
-
|
|
20901
|
+
_context15.n = 12;
|
|
20850
20902
|
break;
|
|
20851
20903
|
case 10:
|
|
20852
20904
|
query.AttachmentByTypeQuery = AttachmentByTypeQuery;
|
|
20853
|
-
|
|
20905
|
+
_context15.n = 11;
|
|
20854
20906
|
return put(setAttachmentsCompleteAC(result.hasNext));
|
|
20855
20907
|
case 11:
|
|
20856
|
-
|
|
20908
|
+
_context15.n = 12;
|
|
20857
20909
|
return put(setAttachmentsAC(JSON.parse(JSON.stringify(result.attachments))));
|
|
20858
20910
|
case 12:
|
|
20859
|
-
|
|
20911
|
+
_context15.n = 14;
|
|
20860
20912
|
break;
|
|
20861
20913
|
case 13:
|
|
20862
|
-
|
|
20863
|
-
|
|
20864
|
-
log.error('error in message attachment query',
|
|
20914
|
+
_context15.p = 13;
|
|
20915
|
+
_t28 = _context15.v;
|
|
20916
|
+
log.error('error in message attachment query', _t28);
|
|
20865
20917
|
case 14:
|
|
20866
|
-
return
|
|
20918
|
+
return _context15.a(2);
|
|
20867
20919
|
}
|
|
20868
20920
|
}, _marked12$1, null, [[0, 13]]);
|
|
20869
20921
|
}
|
|
20870
20922
|
function loadMoreMessageAttachments(action) {
|
|
20871
|
-
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext,
|
|
20872
|
-
return _regenerator().w(function (
|
|
20873
|
-
while (1) switch (
|
|
20923
|
+
var _action$payload3, limit, direction, forPopup, AttachmentQuery, _yield$call3, attachments, hasNext, _t29;
|
|
20924
|
+
return _regenerator().w(function (_context16) {
|
|
20925
|
+
while (1) switch (_context16.p = _context16.n) {
|
|
20874
20926
|
case 0:
|
|
20875
|
-
|
|
20927
|
+
_context16.p = 0;
|
|
20876
20928
|
_action$payload3 = action.payload, limit = _action$payload3.limit, direction = _action$payload3.direction, forPopup = _action$payload3.forPopup;
|
|
20877
20929
|
if (forPopup) {
|
|
20878
20930
|
AttachmentQuery = query.AttachmentByTypeQueryForPopup;
|
|
20879
20931
|
} else {
|
|
20880
20932
|
AttachmentQuery = query.AttachmentByTypeQuery;
|
|
20881
20933
|
}
|
|
20882
|
-
|
|
20934
|
+
_context16.n = 1;
|
|
20883
20935
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADING));
|
|
20884
20936
|
case 1:
|
|
20885
20937
|
AttachmentQuery.limit = limit;
|
|
20886
|
-
|
|
20938
|
+
_context16.n = 2;
|
|
20887
20939
|
return call(AttachmentQuery.loadPrevious);
|
|
20888
20940
|
case 2:
|
|
20889
|
-
_yield$call3 =
|
|
20941
|
+
_yield$call3 = _context16.v;
|
|
20890
20942
|
attachments = _yield$call3.attachments;
|
|
20891
20943
|
hasNext = _yield$call3.hasNext;
|
|
20892
20944
|
if (!forPopup) {
|
|
20893
|
-
|
|
20945
|
+
_context16.n = 4;
|
|
20894
20946
|
break;
|
|
20895
20947
|
}
|
|
20896
|
-
|
|
20948
|
+
_context16.n = 3;
|
|
20897
20949
|
return put(addAttachmentsForPopupAC(attachments, direction));
|
|
20898
20950
|
case 3:
|
|
20899
|
-
|
|
20951
|
+
_context16.n = 7;
|
|
20900
20952
|
break;
|
|
20901
20953
|
case 4:
|
|
20902
|
-
|
|
20954
|
+
_context16.n = 5;
|
|
20903
20955
|
return put(setAttachmentsCompleteAC(hasNext));
|
|
20904
20956
|
case 5:
|
|
20905
|
-
|
|
20957
|
+
_context16.n = 6;
|
|
20906
20958
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
20907
20959
|
case 6:
|
|
20908
|
-
|
|
20960
|
+
_context16.n = 7;
|
|
20909
20961
|
return put(addAttachmentsAC(attachments));
|
|
20910
20962
|
case 7:
|
|
20911
|
-
|
|
20963
|
+
_context16.n = 9;
|
|
20912
20964
|
break;
|
|
20913
20965
|
case 8:
|
|
20914
|
-
|
|
20915
|
-
|
|
20916
|
-
log.error('error in message attachment query',
|
|
20966
|
+
_context16.p = 8;
|
|
20967
|
+
_t29 = _context16.v;
|
|
20968
|
+
log.error('error in message attachment query', _t29);
|
|
20917
20969
|
case 9:
|
|
20918
|
-
return
|
|
20970
|
+
return _context16.a(2);
|
|
20919
20971
|
}
|
|
20920
20972
|
}, _marked13$1, null, [[0, 8]]);
|
|
20921
20973
|
}
|
|
20922
20974
|
function pauseAttachmentUploading(action) {
|
|
20923
|
-
var attachmentId, isPaused,
|
|
20924
|
-
return _regenerator().w(function (
|
|
20925
|
-
while (1) switch (
|
|
20975
|
+
var attachmentId, isPaused, _t30;
|
|
20976
|
+
return _regenerator().w(function (_context17) {
|
|
20977
|
+
while (1) switch (_context17.p = _context17.n) {
|
|
20926
20978
|
case 0:
|
|
20927
|
-
|
|
20979
|
+
_context17.p = 0;
|
|
20928
20980
|
attachmentId = action.payload.attachmentId;
|
|
20929
20981
|
if (!getCustomUploader()) {
|
|
20930
|
-
|
|
20982
|
+
_context17.n = 1;
|
|
20931
20983
|
break;
|
|
20932
20984
|
}
|
|
20933
20985
|
isPaused = pauseUpload(attachmentId);
|
|
20934
20986
|
if (!isPaused) {
|
|
20935
|
-
|
|
20987
|
+
_context17.n = 1;
|
|
20936
20988
|
break;
|
|
20937
20989
|
}
|
|
20938
|
-
|
|
20990
|
+
_context17.n = 1;
|
|
20939
20991
|
return put(updateAttachmentUploadingStateAC(UPLOAD_STATE.PAUSED, attachmentId));
|
|
20940
20992
|
case 1:
|
|
20941
|
-
|
|
20993
|
+
_context17.n = 3;
|
|
20942
20994
|
break;
|
|
20943
20995
|
case 2:
|
|
20944
|
-
|
|
20945
|
-
|
|
20946
|
-
log.error('error in pause attachment uploading',
|
|
20996
|
+
_context17.p = 2;
|
|
20997
|
+
_t30 = _context17.v;
|
|
20998
|
+
log.error('error in pause attachment uploading', _t30);
|
|
20947
20999
|
case 3:
|
|
20948
|
-
return
|
|
21000
|
+
return _context17.a(2);
|
|
20949
21001
|
}
|
|
20950
21002
|
}, _marked14$1, null, [[0, 2]]);
|
|
20951
21003
|
}
|
|
20952
21004
|
function resumeAttachmentUploading(action) {
|
|
20953
|
-
var attachmentId, isResumed,
|
|
20954
|
-
return _regenerator().w(function (
|
|
20955
|
-
while (1) switch (
|
|
21005
|
+
var attachmentId, isResumed, _t31;
|
|
21006
|
+
return _regenerator().w(function (_context18) {
|
|
21007
|
+
while (1) switch (_context18.p = _context18.n) {
|
|
20956
21008
|
case 0:
|
|
20957
|
-
|
|
21009
|
+
_context18.p = 0;
|
|
20958
21010
|
attachmentId = action.payload.attachmentId;
|
|
20959
21011
|
log.info('resume for attachment ... ', attachmentId);
|
|
20960
21012
|
if (!getCustomUploader()) {
|
|
20961
|
-
|
|
21013
|
+
_context18.n = 1;
|
|
20962
21014
|
break;
|
|
20963
21015
|
}
|
|
20964
21016
|
isResumed = resumeUpload(attachmentId);
|
|
20965
21017
|
if (!isResumed) {
|
|
20966
|
-
|
|
21018
|
+
_context18.n = 1;
|
|
20967
21019
|
break;
|
|
20968
21020
|
}
|
|
20969
|
-
|
|
21021
|
+
_context18.n = 1;
|
|
20970
21022
|
return put(updateAttachmentUploadingStateAC(UPLOAD_STATE.UPLOADING, attachmentId));
|
|
20971
21023
|
case 1:
|
|
20972
|
-
|
|
21024
|
+
_context18.n = 3;
|
|
20973
21025
|
break;
|
|
20974
21026
|
case 2:
|
|
20975
|
-
|
|
20976
|
-
|
|
20977
|
-
log.error('error in resume attachment uploading',
|
|
21027
|
+
_context18.p = 2;
|
|
21028
|
+
_t31 = _context18.v;
|
|
21029
|
+
log.error('error in resume attachment uploading', _t31);
|
|
20978
21030
|
case 3:
|
|
20979
|
-
return
|
|
21031
|
+
return _context18.a(2);
|
|
20980
21032
|
}
|
|
20981
21033
|
}, _marked15$1, null, [[0, 2]]);
|
|
20982
21034
|
}
|
|
20983
21035
|
function getMessageMarkers(action) {
|
|
20984
|
-
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers,
|
|
20985
|
-
return _regenerator().w(function (
|
|
20986
|
-
while (1) switch (
|
|
21036
|
+
var _action$payload4, messageId, channelId, deliveryStatus, sceytChatClient, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkers, _t32;
|
|
21037
|
+
return _regenerator().w(function (_context19) {
|
|
21038
|
+
while (1) switch (_context19.p = _context19.n) {
|
|
20987
21039
|
case 0:
|
|
20988
|
-
|
|
20989
|
-
|
|
21040
|
+
_context19.p = 0;
|
|
21041
|
+
_context19.n = 1;
|
|
20990
21042
|
return put(setMessagesMarkersLoadingStateAC(LOADING_STATE.LOADING));
|
|
20991
21043
|
case 1:
|
|
20992
21044
|
_action$payload4 = action.payload, messageId = _action$payload4.messageId, channelId = _action$payload4.channelId, deliveryStatus = _action$payload4.deliveryStatus;
|
|
20993
21045
|
sceytChatClient = getClient();
|
|
20994
21046
|
if (!sceytChatClient) {
|
|
20995
|
-
|
|
21047
|
+
_context19.n = 4;
|
|
20996
21048
|
break;
|
|
20997
21049
|
}
|
|
20998
21050
|
messageMarkerListQueryBuilder = new sceytChatClient.MessageMarkerListQueryBuilder(channelId, String(messageId), deliveryStatus);
|
|
20999
|
-
|
|
21051
|
+
_context19.n = 2;
|
|
21000
21052
|
return call(messageMarkerListQueryBuilder.build);
|
|
21001
21053
|
case 2:
|
|
21002
|
-
messageMarkerListQuery =
|
|
21003
|
-
|
|
21054
|
+
messageMarkerListQuery = _context19.v;
|
|
21055
|
+
_context19.n = 3;
|
|
21004
21056
|
return call(messageMarkerListQuery.loadNext);
|
|
21005
21057
|
case 3:
|
|
21006
|
-
messageMarkers =
|
|
21007
|
-
|
|
21058
|
+
messageMarkers = _context19.v;
|
|
21059
|
+
_context19.n = 4;
|
|
21008
21060
|
return put(setMessageMarkersAC(channelId, messageId, messageMarkers.markers, deliveryStatus));
|
|
21009
21061
|
case 4:
|
|
21010
|
-
|
|
21062
|
+
_context19.n = 6;
|
|
21011
21063
|
break;
|
|
21012
21064
|
case 5:
|
|
21013
|
-
|
|
21014
|
-
|
|
21015
|
-
log.error('error in get message markers',
|
|
21065
|
+
_context19.p = 5;
|
|
21066
|
+
_t32 = _context19.v;
|
|
21067
|
+
log.error('error in get message markers', _t32);
|
|
21016
21068
|
case 6:
|
|
21017
|
-
|
|
21018
|
-
|
|
21069
|
+
_context19.p = 6;
|
|
21070
|
+
_context19.n = 7;
|
|
21019
21071
|
return put(setMessagesMarkersLoadingStateAC(LOADING_STATE.LOADED));
|
|
21020
21072
|
case 7:
|
|
21021
|
-
return
|
|
21073
|
+
return _context19.f(6);
|
|
21022
21074
|
case 8:
|
|
21023
|
-
return
|
|
21075
|
+
return _context19.a(2);
|
|
21024
21076
|
}
|
|
21025
21077
|
}, _marked16$1, null, [[0, 5, 6, 8]]);
|
|
21026
21078
|
}
|
|
21027
21079
|
function executeAddPollVote(channelId, pollId, optionId, message, isResend) {
|
|
21028
21080
|
var _user$presence, _message$pollDetails, _message$pollDetails2, _message$pollDetails3, _message$pollDetails4;
|
|
21029
21081
|
var channel, user, vote, objs, _message$pollDetails5, _message$pollDetails6, _message$pollDetails7, _iterator2, _step2, obj;
|
|
21030
|
-
return _regenerator().w(function (
|
|
21031
|
-
while (1) switch (
|
|
21082
|
+
return _regenerator().w(function (_context20) {
|
|
21083
|
+
while (1) switch (_context20.n) {
|
|
21032
21084
|
case 0:
|
|
21033
|
-
|
|
21085
|
+
_context20.n = 1;
|
|
21034
21086
|
return call(getChannelFromMap, channelId);
|
|
21035
21087
|
case 1:
|
|
21036
|
-
channel =
|
|
21088
|
+
channel = _context20.v;
|
|
21037
21089
|
if (message.pollDetails) {
|
|
21038
|
-
|
|
21090
|
+
_context20.n = 2;
|
|
21039
21091
|
break;
|
|
21040
21092
|
}
|
|
21041
|
-
return
|
|
21093
|
+
return _context20.a(2);
|
|
21042
21094
|
case 2:
|
|
21043
21095
|
user = getClient().user;
|
|
21044
21096
|
vote = {
|
|
@@ -21076,13 +21128,13 @@ function executeAddPollVote(channelId, pollId, optionId, message, isResend) {
|
|
|
21076
21128
|
incrementVotesPerOptionCount: 1
|
|
21077
21129
|
});
|
|
21078
21130
|
if (isResend) {
|
|
21079
|
-
|
|
21131
|
+
_context20.n = 5;
|
|
21080
21132
|
break;
|
|
21081
21133
|
}
|
|
21082
21134
|
_iterator2 = _createForOfIteratorHelperLoose(objs);
|
|
21083
21135
|
case 3:
|
|
21084
21136
|
if ((_step2 = _iterator2()).done) {
|
|
21085
|
-
|
|
21137
|
+
_context20.n = 5;
|
|
21086
21138
|
break;
|
|
21087
21139
|
}
|
|
21088
21140
|
obj = _step2.value;
|
|
@@ -21091,46 +21143,46 @@ function executeAddPollVote(channelId, pollId, optionId, message, isResend) {
|
|
|
21091
21143
|
params: {}
|
|
21092
21144
|
}, obj);
|
|
21093
21145
|
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21094
|
-
|
|
21146
|
+
_context20.n = 4;
|
|
21095
21147
|
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21096
21148
|
case 4:
|
|
21097
|
-
|
|
21149
|
+
_context20.n = 3;
|
|
21098
21150
|
break;
|
|
21099
21151
|
case 5:
|
|
21100
21152
|
if (!channel) {
|
|
21101
|
-
|
|
21153
|
+
_context20.n = 7;
|
|
21102
21154
|
break;
|
|
21103
21155
|
}
|
|
21104
|
-
|
|
21156
|
+
_context20.n = 6;
|
|
21105
21157
|
return call(channel.addVote, message.id, pollId, [optionId]);
|
|
21106
21158
|
case 6:
|
|
21107
|
-
|
|
21159
|
+
_context20.n = 7;
|
|
21108
21160
|
return put(removePendingPollActionAC(message.id, 'ADD_POLL_VOTE', optionId));
|
|
21109
21161
|
case 7:
|
|
21110
|
-
return
|
|
21162
|
+
return _context20.a(2);
|
|
21111
21163
|
}
|
|
21112
21164
|
}, _marked17$1);
|
|
21113
21165
|
}
|
|
21114
21166
|
function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
21115
21167
|
var channel, obj;
|
|
21116
|
-
return _regenerator().w(function (
|
|
21117
|
-
while (1) switch (
|
|
21168
|
+
return _regenerator().w(function (_context21) {
|
|
21169
|
+
while (1) switch (_context21.n) {
|
|
21118
21170
|
case 0:
|
|
21119
|
-
|
|
21171
|
+
_context21.n = 1;
|
|
21120
21172
|
return call(getChannelFromMap, channelId);
|
|
21121
21173
|
case 1:
|
|
21122
|
-
channel =
|
|
21174
|
+
channel = _context21.v;
|
|
21123
21175
|
if (channel) {
|
|
21124
|
-
|
|
21176
|
+
_context21.n = 2;
|
|
21125
21177
|
break;
|
|
21126
21178
|
}
|
|
21127
|
-
return
|
|
21179
|
+
return _context21.a(2);
|
|
21128
21180
|
case 2:
|
|
21129
21181
|
if (message.pollDetails) {
|
|
21130
|
-
|
|
21182
|
+
_context21.n = 3;
|
|
21131
21183
|
break;
|
|
21132
21184
|
}
|
|
21133
|
-
return
|
|
21185
|
+
return _context21.a(2);
|
|
21134
21186
|
case 3:
|
|
21135
21187
|
obj = {
|
|
21136
21188
|
type: 'addOwn',
|
|
@@ -21142,24 +21194,24 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
|
21142
21194
|
params: {}
|
|
21143
21195
|
}, obj);
|
|
21144
21196
|
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21145
|
-
|
|
21197
|
+
_context21.n = 4;
|
|
21146
21198
|
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21147
21199
|
case 4:
|
|
21148
|
-
return
|
|
21200
|
+
return _context21.a(2);
|
|
21149
21201
|
}
|
|
21150
21202
|
}, _marked18$1);
|
|
21151
21203
|
}
|
|
21152
21204
|
function addPollVote(action) {
|
|
21153
|
-
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,
|
|
21154
|
-
return _regenerator().w(function (
|
|
21155
|
-
while (1) switch (
|
|
21205
|
+
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, _t33;
|
|
21206
|
+
return _regenerator().w(function (_context22) {
|
|
21207
|
+
while (1) switch (_context22.p = _context22.n) {
|
|
21156
21208
|
case 0:
|
|
21157
|
-
|
|
21209
|
+
_context22.p = 0;
|
|
21158
21210
|
payload = action.payload;
|
|
21159
21211
|
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, message = payload.message, isResend = payload.isResend;
|
|
21160
21212
|
sceytChatClient = getClient();
|
|
21161
21213
|
if (!sceytChatClient) {
|
|
21162
|
-
|
|
21214
|
+
_context22.n = 7;
|
|
21163
21215
|
break;
|
|
21164
21216
|
}
|
|
21165
21217
|
connectionState = sceytChatClient.connectionState;
|
|
@@ -21186,7 +21238,7 @@ function addPollVote(action) {
|
|
|
21186
21238
|
}
|
|
21187
21239
|
};
|
|
21188
21240
|
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21189
|
-
|
|
21241
|
+
_context22.n = 6;
|
|
21190
21242
|
break;
|
|
21191
21243
|
}
|
|
21192
21244
|
pendingAction = {
|
|
@@ -21198,22 +21250,22 @@ function addPollVote(action) {
|
|
|
21198
21250
|
};
|
|
21199
21251
|
conflictCheck = checkPendingPollActionConflict(pendingAction);
|
|
21200
21252
|
if (!(conflictCheck.hasConflict && !conflictCheck.shouldSkip)) {
|
|
21201
|
-
|
|
21253
|
+
_context22.n = 4;
|
|
21202
21254
|
break;
|
|
21203
21255
|
}
|
|
21204
|
-
|
|
21256
|
+
_context22.n = 1;
|
|
21205
21257
|
return call(getChannelFromMap, channelId);
|
|
21206
21258
|
case 1:
|
|
21207
|
-
channel =
|
|
21259
|
+
channel = _context22.v;
|
|
21208
21260
|
if (!channel) {
|
|
21209
|
-
|
|
21261
|
+
_context22.n = 3;
|
|
21210
21262
|
break;
|
|
21211
21263
|
}
|
|
21212
21264
|
currentMessage = ((_Object$values2 = Object.values(getMessagesFromMap(channelId) || {})) === null || _Object$values2 === void 0 ? void 0 : _Object$values2.find(function (msg) {
|
|
21213
21265
|
return msg.id === message.id || msg.tid === message.id;
|
|
21214
21266
|
})) || message;
|
|
21215
21267
|
hasNext = ((_store$getState$Messa = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa === void 0 ? void 0 : _store$getState$Messa[pollId]) || false;
|
|
21216
|
-
|
|
21268
|
+
_context22.n = 2;
|
|
21217
21269
|
return put(addPollVotesToListAC(pollId, optionId, [(_currentMessage$pollD = currentMessage.pollDetails) === null || _currentMessage$pollD === void 0 ? void 0 : (_currentMessage$pollD2 = _currentMessage$pollD.voteDetails) === null || _currentMessage$pollD2 === void 0 ? void 0 : (_currentMessage$pollD3 = _currentMessage$pollD2.ownVotes) === null || _currentMessage$pollD3 === void 0 ? void 0 : _currentMessage$pollD3[0]], hasNext, message.id));
|
|
21218
21270
|
case 2:
|
|
21219
21271
|
obj = {
|
|
@@ -21226,60 +21278,60 @@ function addPollVote(action) {
|
|
|
21226
21278
|
params: {}
|
|
21227
21279
|
}, obj);
|
|
21228
21280
|
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21229
|
-
|
|
21281
|
+
_context22.n = 3;
|
|
21230
21282
|
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21231
21283
|
case 3:
|
|
21232
|
-
|
|
21284
|
+
_context22.n = 5;
|
|
21233
21285
|
break;
|
|
21234
21286
|
case 4:
|
|
21235
21287
|
if (conflictCheck.shouldSkip) {
|
|
21236
|
-
|
|
21288
|
+
_context22.n = 5;
|
|
21237
21289
|
break;
|
|
21238
21290
|
}
|
|
21239
|
-
return
|
|
21291
|
+
return _context22.d(_regeneratorValues(updateMessageOptimisticallyForAddPollVote(channelId, message, vote)), 5);
|
|
21240
21292
|
case 5:
|
|
21241
21293
|
if (!conflictCheck.shouldSkip) {
|
|
21242
21294
|
setPendingPollAction(pendingAction);
|
|
21243
21295
|
}
|
|
21244
|
-
return
|
|
21296
|
+
return _context22.a(2);
|
|
21245
21297
|
case 6:
|
|
21246
|
-
return
|
|
21298
|
+
return _context22.d(_regeneratorValues(executeAddPollVote(channelId, pollId, optionId, message, isResend)), 7);
|
|
21247
21299
|
case 7:
|
|
21248
|
-
|
|
21300
|
+
_context22.n = 9;
|
|
21249
21301
|
break;
|
|
21250
21302
|
case 8:
|
|
21251
|
-
|
|
21252
|
-
|
|
21253
|
-
log.error('error in add poll vote',
|
|
21303
|
+
_context22.p = 8;
|
|
21304
|
+
_t33 = _context22.v;
|
|
21305
|
+
log.error('error in add poll vote', _t33);
|
|
21254
21306
|
case 9:
|
|
21255
|
-
return
|
|
21307
|
+
return _context22.a(2);
|
|
21256
21308
|
}
|
|
21257
21309
|
}, _marked19$1, null, [[0, 8]]);
|
|
21258
21310
|
}
|
|
21259
21311
|
function executeDeletePollVote(channelId, pollId, optionId, message, isResend) {
|
|
21260
21312
|
var _message$pollDetails8, _message$pollDetails9, _message$pollDetails0;
|
|
21261
21313
|
var channel, vote, obj;
|
|
21262
|
-
return _regenerator().w(function (
|
|
21263
|
-
while (1) switch (
|
|
21314
|
+
return _regenerator().w(function (_context23) {
|
|
21315
|
+
while (1) switch (_context23.n) {
|
|
21264
21316
|
case 0:
|
|
21265
|
-
|
|
21317
|
+
_context23.n = 1;
|
|
21266
21318
|
return call(getChannelFromMap, channelId);
|
|
21267
21319
|
case 1:
|
|
21268
|
-
channel =
|
|
21320
|
+
channel = _context23.v;
|
|
21269
21321
|
if (message.pollDetails) {
|
|
21270
|
-
|
|
21322
|
+
_context23.n = 2;
|
|
21271
21323
|
break;
|
|
21272
21324
|
}
|
|
21273
|
-
return
|
|
21325
|
+
return _context23.a(2);
|
|
21274
21326
|
case 2:
|
|
21275
21327
|
vote = (_message$pollDetails8 = message.pollDetails) === null || _message$pollDetails8 === void 0 ? void 0 : (_message$pollDetails9 = _message$pollDetails8.voteDetails) === null || _message$pollDetails9 === void 0 ? void 0 : (_message$pollDetails0 = _message$pollDetails9.ownVotes) === null || _message$pollDetails0 === void 0 ? void 0 : _message$pollDetails0.find(function (vote) {
|
|
21276
21328
|
return vote.optionId === optionId;
|
|
21277
21329
|
});
|
|
21278
21330
|
if (vote) {
|
|
21279
|
-
|
|
21331
|
+
_context23.n = 3;
|
|
21280
21332
|
break;
|
|
21281
21333
|
}
|
|
21282
|
-
return
|
|
21334
|
+
return _context23.a(2);
|
|
21283
21335
|
case 3:
|
|
21284
21336
|
obj = {
|
|
21285
21337
|
type: 'deleteOwn',
|
|
@@ -21287,7 +21339,7 @@ function executeDeletePollVote(channelId, pollId, optionId, message, isResend) {
|
|
|
21287
21339
|
incrementVotesPerOptionCount: -1
|
|
21288
21340
|
};
|
|
21289
21341
|
if (isResend) {
|
|
21290
|
-
|
|
21342
|
+
_context23.n = 4;
|
|
21291
21343
|
break;
|
|
21292
21344
|
}
|
|
21293
21345
|
updateMessageOnMap(channel.id, {
|
|
@@ -21295,43 +21347,43 @@ function executeDeletePollVote(channelId, pollId, optionId, message, isResend) {
|
|
|
21295
21347
|
params: {}
|
|
21296
21348
|
}, obj);
|
|
21297
21349
|
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21298
|
-
|
|
21350
|
+
_context23.n = 4;
|
|
21299
21351
|
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21300
21352
|
case 4:
|
|
21301
21353
|
if (!channel) {
|
|
21302
|
-
|
|
21354
|
+
_context23.n = 6;
|
|
21303
21355
|
break;
|
|
21304
21356
|
}
|
|
21305
|
-
|
|
21357
|
+
_context23.n = 5;
|
|
21306
21358
|
return call(channel.deleteVote, message.id, pollId, [optionId]);
|
|
21307
21359
|
case 5:
|
|
21308
|
-
|
|
21360
|
+
_context23.n = 6;
|
|
21309
21361
|
return put(removePendingPollActionAC(message.id, 'DELETE_POLL_VOTE', optionId));
|
|
21310
21362
|
case 6:
|
|
21311
|
-
return
|
|
21363
|
+
return _context23.a(2);
|
|
21312
21364
|
}
|
|
21313
21365
|
}, _marked20$1);
|
|
21314
21366
|
}
|
|
21315
21367
|
function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote) {
|
|
21316
21368
|
var channel, obj;
|
|
21317
|
-
return _regenerator().w(function (
|
|
21318
|
-
while (1) switch (
|
|
21369
|
+
return _regenerator().w(function (_context24) {
|
|
21370
|
+
while (1) switch (_context24.n) {
|
|
21319
21371
|
case 0:
|
|
21320
|
-
|
|
21372
|
+
_context24.n = 1;
|
|
21321
21373
|
return call(getChannelFromMap, channelId);
|
|
21322
21374
|
case 1:
|
|
21323
|
-
channel =
|
|
21375
|
+
channel = _context24.v;
|
|
21324
21376
|
if (channel) {
|
|
21325
|
-
|
|
21377
|
+
_context24.n = 2;
|
|
21326
21378
|
break;
|
|
21327
21379
|
}
|
|
21328
|
-
return
|
|
21380
|
+
return _context24.a(2);
|
|
21329
21381
|
case 2:
|
|
21330
21382
|
if (message.pollDetails) {
|
|
21331
|
-
|
|
21383
|
+
_context24.n = 3;
|
|
21332
21384
|
break;
|
|
21333
21385
|
}
|
|
21334
|
-
return
|
|
21386
|
+
return _context24.a(2);
|
|
21335
21387
|
case 3:
|
|
21336
21388
|
obj = {
|
|
21337
21389
|
type: 'deleteOwn',
|
|
@@ -21343,24 +21395,24 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
|
|
|
21343
21395
|
params: {}
|
|
21344
21396
|
}, obj);
|
|
21345
21397
|
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21346
|
-
|
|
21398
|
+
_context24.n = 4;
|
|
21347
21399
|
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21348
21400
|
case 4:
|
|
21349
|
-
return
|
|
21401
|
+
return _context24.a(2);
|
|
21350
21402
|
}
|
|
21351
21403
|
}, _marked21$1);
|
|
21352
21404
|
}
|
|
21353
21405
|
function deletePollVote(action) {
|
|
21354
|
-
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,
|
|
21355
|
-
return _regenerator().w(function (
|
|
21356
|
-
while (1) switch (
|
|
21406
|
+
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, _t34;
|
|
21407
|
+
return _regenerator().w(function (_context25) {
|
|
21408
|
+
while (1) switch (_context25.p = _context25.n) {
|
|
21357
21409
|
case 0:
|
|
21358
|
-
|
|
21410
|
+
_context25.p = 0;
|
|
21359
21411
|
payload = action.payload;
|
|
21360
21412
|
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, message = payload.message, isResend = payload.isResend;
|
|
21361
21413
|
sceytChatClient = getClient();
|
|
21362
21414
|
if (!sceytChatClient) {
|
|
21363
|
-
|
|
21415
|
+
_context25.n = 8;
|
|
21364
21416
|
break;
|
|
21365
21417
|
}
|
|
21366
21418
|
connectionState = sceytChatClient.connectionState;
|
|
@@ -21368,13 +21420,13 @@ function deletePollVote(action) {
|
|
|
21368
21420
|
return vote.optionId === optionId;
|
|
21369
21421
|
});
|
|
21370
21422
|
if (vote) {
|
|
21371
|
-
|
|
21423
|
+
_context25.n = 1;
|
|
21372
21424
|
break;
|
|
21373
21425
|
}
|
|
21374
|
-
return
|
|
21426
|
+
return _context25.a(2);
|
|
21375
21427
|
case 1:
|
|
21376
21428
|
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21377
|
-
|
|
21429
|
+
_context25.n = 7;
|
|
21378
21430
|
break;
|
|
21379
21431
|
}
|
|
21380
21432
|
pendingAction = {
|
|
@@ -21386,21 +21438,21 @@ function deletePollVote(action) {
|
|
|
21386
21438
|
};
|
|
21387
21439
|
conflictCheck = checkPendingPollActionConflict(pendingAction);
|
|
21388
21440
|
if (!(conflictCheck.hasConflict && conflictCheck.shouldSkip)) {
|
|
21389
|
-
|
|
21441
|
+
_context25.n = 5;
|
|
21390
21442
|
break;
|
|
21391
21443
|
}
|
|
21392
|
-
|
|
21444
|
+
_context25.n = 2;
|
|
21393
21445
|
return call(getChannelFromMap, channelId);
|
|
21394
21446
|
case 2:
|
|
21395
|
-
channel =
|
|
21447
|
+
channel = _context25.v;
|
|
21396
21448
|
if (!channel) {
|
|
21397
|
-
|
|
21449
|
+
_context25.n = 4;
|
|
21398
21450
|
break;
|
|
21399
21451
|
}
|
|
21400
21452
|
currentMessage = ((_Object$values3 = Object.values(getMessagesFromMap(channelId) || {})) === null || _Object$values3 === void 0 ? void 0 : _Object$values3.find(function (msg) {
|
|
21401
21453
|
return msg.id === message.id || msg.tid === message.id;
|
|
21402
21454
|
})) || message;
|
|
21403
|
-
|
|
21455
|
+
_context25.n = 3;
|
|
21404
21456
|
return put(deletePollVotesFromListAC(pollId, optionId, [(_currentMessage$pollD4 = currentMessage.pollDetails) === null || _currentMessage$pollD4 === void 0 ? void 0 : (_currentMessage$pollD5 = _currentMessage$pollD4.voteDetails) === null || _currentMessage$pollD5 === void 0 ? void 0 : (_currentMessage$pollD6 = _currentMessage$pollD5.ownVotes) === null || _currentMessage$pollD6 === void 0 ? void 0 : _currentMessage$pollD6[0]], message.id));
|
|
21405
21457
|
case 3:
|
|
21406
21458
|
obj = {
|
|
@@ -21413,45 +21465,45 @@ function deletePollVote(action) {
|
|
|
21413
21465
|
params: {}
|
|
21414
21466
|
}, obj);
|
|
21415
21467
|
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21416
|
-
|
|
21468
|
+
_context25.n = 4;
|
|
21417
21469
|
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21418
21470
|
case 4:
|
|
21419
|
-
|
|
21471
|
+
_context25.n = 6;
|
|
21420
21472
|
break;
|
|
21421
21473
|
case 5:
|
|
21422
21474
|
if (conflictCheck.shouldSkip) {
|
|
21423
|
-
|
|
21475
|
+
_context25.n = 6;
|
|
21424
21476
|
break;
|
|
21425
21477
|
}
|
|
21426
|
-
return
|
|
21478
|
+
return _context25.d(_regeneratorValues(updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)), 6);
|
|
21427
21479
|
case 6:
|
|
21428
21480
|
if (!conflictCheck.shouldSkip) {
|
|
21429
21481
|
setPendingPollAction(pendingAction);
|
|
21430
21482
|
}
|
|
21431
|
-
return
|
|
21483
|
+
return _context25.a(2);
|
|
21432
21484
|
case 7:
|
|
21433
|
-
return
|
|
21485
|
+
return _context25.d(_regeneratorValues(executeDeletePollVote(channelId, pollId, optionId, message, isResend)), 8);
|
|
21434
21486
|
case 8:
|
|
21435
|
-
|
|
21487
|
+
_context25.n = 10;
|
|
21436
21488
|
break;
|
|
21437
21489
|
case 9:
|
|
21438
|
-
|
|
21439
|
-
|
|
21440
|
-
log.error('error in delete poll vote',
|
|
21490
|
+
_context25.p = 9;
|
|
21491
|
+
_t34 = _context25.v;
|
|
21492
|
+
log.error('error in delete poll vote', _t34);
|
|
21441
21493
|
case 10:
|
|
21442
|
-
return
|
|
21494
|
+
return _context25.a(2);
|
|
21443
21495
|
}
|
|
21444
21496
|
}, _marked22$1, null, [[0, 9]]);
|
|
21445
21497
|
}
|
|
21446
21498
|
function executeClosePoll(channelId, pollId, message) {
|
|
21447
21499
|
var channel, obj;
|
|
21448
|
-
return _regenerator().w(function (
|
|
21449
|
-
while (1) switch (
|
|
21500
|
+
return _regenerator().w(function (_context26) {
|
|
21501
|
+
while (1) switch (_context26.n) {
|
|
21450
21502
|
case 0:
|
|
21451
|
-
|
|
21503
|
+
_context26.n = 1;
|
|
21452
21504
|
return call(getChannelFromMap, channelId);
|
|
21453
21505
|
case 1:
|
|
21454
|
-
channel =
|
|
21506
|
+
channel = _context26.v;
|
|
21455
21507
|
obj = {
|
|
21456
21508
|
type: 'close',
|
|
21457
21509
|
incrementVotesPerOptionCount: 0
|
|
@@ -21461,37 +21513,37 @@ function executeClosePoll(channelId, pollId, message) {
|
|
|
21461
21513
|
params: {}
|
|
21462
21514
|
}, obj);
|
|
21463
21515
|
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21464
|
-
|
|
21516
|
+
_context26.n = 2;
|
|
21465
21517
|
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21466
21518
|
case 2:
|
|
21467
21519
|
if (!channel) {
|
|
21468
|
-
|
|
21520
|
+
_context26.n = 4;
|
|
21469
21521
|
break;
|
|
21470
21522
|
}
|
|
21471
|
-
|
|
21523
|
+
_context26.n = 3;
|
|
21472
21524
|
return call(channel.closePoll, message.id, pollId);
|
|
21473
21525
|
case 3:
|
|
21474
|
-
|
|
21526
|
+
_context26.n = 4;
|
|
21475
21527
|
return put(removePendingPollActionAC(message.id, 'CLOSE_POLL'));
|
|
21476
21528
|
case 4:
|
|
21477
|
-
return
|
|
21529
|
+
return _context26.a(2);
|
|
21478
21530
|
}
|
|
21479
21531
|
}, _marked23$1);
|
|
21480
21532
|
}
|
|
21481
21533
|
function updateMessageOptimisticallyForClosePoll(channelId, message) {
|
|
21482
21534
|
var channel, pollDetails;
|
|
21483
|
-
return _regenerator().w(function (
|
|
21484
|
-
while (1) switch (
|
|
21535
|
+
return _regenerator().w(function (_context27) {
|
|
21536
|
+
while (1) switch (_context27.n) {
|
|
21485
21537
|
case 0:
|
|
21486
|
-
|
|
21538
|
+
_context27.n = 1;
|
|
21487
21539
|
return call(getChannelFromMap, channelId);
|
|
21488
21540
|
case 1:
|
|
21489
|
-
channel =
|
|
21541
|
+
channel = _context27.v;
|
|
21490
21542
|
if (channel) {
|
|
21491
|
-
|
|
21543
|
+
_context27.n = 2;
|
|
21492
21544
|
break;
|
|
21493
21545
|
}
|
|
21494
|
-
return
|
|
21546
|
+
return _context27.a(2);
|
|
21495
21547
|
case 2:
|
|
21496
21548
|
pollDetails = JSON.parse(JSON.stringify(message.pollDetails));
|
|
21497
21549
|
pollDetails.closed = true;
|
|
@@ -21505,34 +21557,34 @@ function updateMessageOptimisticallyForClosePoll(channelId, message) {
|
|
|
21505
21557
|
updateMessageOnAllMessages(message.id, {
|
|
21506
21558
|
pollDetails: pollDetails
|
|
21507
21559
|
});
|
|
21508
|
-
|
|
21560
|
+
_context27.n = 3;
|
|
21509
21561
|
return put(updateMessageAC(message.id, {
|
|
21510
21562
|
pollDetails: pollDetails
|
|
21511
21563
|
}));
|
|
21512
21564
|
case 3:
|
|
21513
|
-
return
|
|
21565
|
+
return _context27.a(2);
|
|
21514
21566
|
}
|
|
21515
21567
|
}, _marked24$1);
|
|
21516
21568
|
}
|
|
21517
21569
|
function closePoll(action) {
|
|
21518
|
-
var payload, channelId, pollId, message, sceytChatClient, connectionState,
|
|
21519
|
-
return _regenerator().w(function (
|
|
21520
|
-
while (1) switch (
|
|
21570
|
+
var payload, channelId, pollId, message, sceytChatClient, connectionState, _t35;
|
|
21571
|
+
return _regenerator().w(function (_context28) {
|
|
21572
|
+
while (1) switch (_context28.p = _context28.n) {
|
|
21521
21573
|
case 0:
|
|
21522
|
-
|
|
21574
|
+
_context28.p = 0;
|
|
21523
21575
|
payload = action.payload;
|
|
21524
21576
|
channelId = payload.channelId, pollId = payload.pollId, message = payload.message;
|
|
21525
21577
|
sceytChatClient = getClient();
|
|
21526
21578
|
if (!sceytChatClient) {
|
|
21527
|
-
|
|
21579
|
+
_context28.n = 3;
|
|
21528
21580
|
break;
|
|
21529
21581
|
}
|
|
21530
21582
|
connectionState = sceytChatClient.connectionState;
|
|
21531
21583
|
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21532
|
-
|
|
21584
|
+
_context28.n = 2;
|
|
21533
21585
|
break;
|
|
21534
21586
|
}
|
|
21535
|
-
return
|
|
21587
|
+
return _context28.d(_regeneratorValues(updateMessageOptimisticallyForClosePoll(channelId, message)), 1);
|
|
21536
21588
|
case 1:
|
|
21537
21589
|
setPendingPollAction({
|
|
21538
21590
|
type: 'CLOSE_POLL',
|
|
@@ -21540,38 +21592,38 @@ function closePoll(action) {
|
|
|
21540
21592
|
pollId: pollId,
|
|
21541
21593
|
message: message
|
|
21542
21594
|
});
|
|
21543
|
-
return
|
|
21595
|
+
return _context28.a(2);
|
|
21544
21596
|
case 2:
|
|
21545
|
-
return
|
|
21597
|
+
return _context28.d(_regeneratorValues(executeClosePoll(channelId, pollId, message)), 3);
|
|
21546
21598
|
case 3:
|
|
21547
|
-
|
|
21599
|
+
_context28.n = 5;
|
|
21548
21600
|
break;
|
|
21549
21601
|
case 4:
|
|
21550
|
-
|
|
21551
|
-
|
|
21552
|
-
log.error('error in close poll',
|
|
21602
|
+
_context28.p = 4;
|
|
21603
|
+
_t35 = _context28.v;
|
|
21604
|
+
log.error('error in close poll', _t35);
|
|
21553
21605
|
case 5:
|
|
21554
|
-
return
|
|
21606
|
+
return _context28.a(2);
|
|
21555
21607
|
}
|
|
21556
21608
|
}, _marked25$1, null, [[0, 4]]);
|
|
21557
21609
|
}
|
|
21558
21610
|
function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
|
|
21559
21611
|
var channel, _iterator3, _step3, obj;
|
|
21560
|
-
return _regenerator().w(function (
|
|
21561
|
-
while (1) switch (
|
|
21612
|
+
return _regenerator().w(function (_context29) {
|
|
21613
|
+
while (1) switch (_context29.n) {
|
|
21562
21614
|
case 0:
|
|
21563
|
-
|
|
21615
|
+
_context29.n = 1;
|
|
21564
21616
|
return call(getChannelFromMap, channelId);
|
|
21565
21617
|
case 1:
|
|
21566
|
-
channel =
|
|
21618
|
+
channel = _context29.v;
|
|
21567
21619
|
if (isResend) {
|
|
21568
|
-
|
|
21620
|
+
_context29.n = 4;
|
|
21569
21621
|
break;
|
|
21570
21622
|
}
|
|
21571
21623
|
_iterator3 = _createForOfIteratorHelperLoose(objs);
|
|
21572
21624
|
case 2:
|
|
21573
21625
|
if ((_step3 = _iterator3()).done) {
|
|
21574
|
-
|
|
21626
|
+
_context29.n = 4;
|
|
21575
21627
|
break;
|
|
21576
21628
|
}
|
|
21577
21629
|
obj = _step3.value;
|
|
@@ -21580,45 +21632,45 @@ function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
|
|
|
21580
21632
|
params: {}
|
|
21581
21633
|
}, obj);
|
|
21582
21634
|
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21583
|
-
|
|
21635
|
+
_context29.n = 3;
|
|
21584
21636
|
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21585
21637
|
case 3:
|
|
21586
|
-
|
|
21638
|
+
_context29.n = 2;
|
|
21587
21639
|
break;
|
|
21588
21640
|
case 4:
|
|
21589
21641
|
if (!channel) {
|
|
21590
|
-
|
|
21642
|
+
_context29.n = 6;
|
|
21591
21643
|
break;
|
|
21592
21644
|
}
|
|
21593
|
-
|
|
21645
|
+
_context29.n = 5;
|
|
21594
21646
|
return call(channel.retractVote, message.id, pollId);
|
|
21595
21647
|
case 5:
|
|
21596
|
-
|
|
21648
|
+
_context29.n = 6;
|
|
21597
21649
|
return put(removePendingPollActionAC(message.id || '', 'RETRACT_POLL_VOTE'));
|
|
21598
21650
|
case 6:
|
|
21599
|
-
return
|
|
21651
|
+
return _context29.a(2);
|
|
21600
21652
|
}
|
|
21601
21653
|
}, _marked26$1);
|
|
21602
21654
|
}
|
|
21603
21655
|
function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs) {
|
|
21604
21656
|
var channel, _iterator4, _step4, obj;
|
|
21605
|
-
return _regenerator().w(function (
|
|
21606
|
-
while (1) switch (
|
|
21657
|
+
return _regenerator().w(function (_context30) {
|
|
21658
|
+
while (1) switch (_context30.n) {
|
|
21607
21659
|
case 0:
|
|
21608
|
-
|
|
21660
|
+
_context30.n = 1;
|
|
21609
21661
|
return call(getChannelFromMap, channelId);
|
|
21610
21662
|
case 1:
|
|
21611
|
-
channel =
|
|
21663
|
+
channel = _context30.v;
|
|
21612
21664
|
if (channel) {
|
|
21613
|
-
|
|
21665
|
+
_context30.n = 2;
|
|
21614
21666
|
break;
|
|
21615
21667
|
}
|
|
21616
|
-
return
|
|
21668
|
+
return _context30.a(2);
|
|
21617
21669
|
case 2:
|
|
21618
21670
|
_iterator4 = _createForOfIteratorHelperLoose(objs);
|
|
21619
21671
|
case 3:
|
|
21620
21672
|
if ((_step4 = _iterator4()).done) {
|
|
21621
|
-
|
|
21673
|
+
_context30.n = 5;
|
|
21622
21674
|
break;
|
|
21623
21675
|
}
|
|
21624
21676
|
obj = _step4.value;
|
|
@@ -21627,27 +21679,27 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
|
|
|
21627
21679
|
params: {}
|
|
21628
21680
|
});
|
|
21629
21681
|
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21630
|
-
|
|
21682
|
+
_context30.n = 4;
|
|
21631
21683
|
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21632
21684
|
case 4:
|
|
21633
|
-
|
|
21685
|
+
_context30.n = 3;
|
|
21634
21686
|
break;
|
|
21635
21687
|
case 5:
|
|
21636
|
-
return
|
|
21688
|
+
return _context30.a(2);
|
|
21637
21689
|
}
|
|
21638
21690
|
}, _marked27$1);
|
|
21639
21691
|
}
|
|
21640
21692
|
function retractPollVote(action) {
|
|
21641
|
-
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator5, _step5, _message$pollDetails12, _message$pollDetails13, vote,
|
|
21642
|
-
return _regenerator().w(function (
|
|
21643
|
-
while (1) switch (
|
|
21693
|
+
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator5, _step5, _message$pollDetails12, _message$pollDetails13, vote, _t36;
|
|
21694
|
+
return _regenerator().w(function (_context31) {
|
|
21695
|
+
while (1) switch (_context31.p = _context31.n) {
|
|
21644
21696
|
case 0:
|
|
21645
|
-
|
|
21697
|
+
_context31.p = 0;
|
|
21646
21698
|
payload = action.payload;
|
|
21647
21699
|
channelId = payload.channelId, pollId = payload.pollId, message = payload.message, isResend = payload.isResend;
|
|
21648
21700
|
sceytChatClient = getClient();
|
|
21649
21701
|
if (!sceytChatClient) {
|
|
21650
|
-
|
|
21702
|
+
_context31.n = 3;
|
|
21651
21703
|
break;
|
|
21652
21704
|
}
|
|
21653
21705
|
connectionState = sceytChatClient.connectionState;
|
|
@@ -21661,10 +21713,10 @@ function retractPollVote(action) {
|
|
|
21661
21713
|
});
|
|
21662
21714
|
}
|
|
21663
21715
|
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21664
|
-
|
|
21716
|
+
_context31.n = 2;
|
|
21665
21717
|
break;
|
|
21666
21718
|
}
|
|
21667
|
-
return
|
|
21719
|
+
return _context31.d(_regeneratorValues(updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)), 1);
|
|
21668
21720
|
case 1:
|
|
21669
21721
|
setPendingPollAction({
|
|
21670
21722
|
type: 'RETRACT_POLL_VOTE',
|
|
@@ -21672,39 +21724,39 @@ function retractPollVote(action) {
|
|
|
21672
21724
|
pollId: pollId,
|
|
21673
21725
|
message: message
|
|
21674
21726
|
});
|
|
21675
|
-
return
|
|
21727
|
+
return _context31.a(2);
|
|
21676
21728
|
case 2:
|
|
21677
|
-
return
|
|
21729
|
+
return _context31.d(_regeneratorValues(executeRetractPollVote(channelId, pollId, message, objs, isResend)), 3);
|
|
21678
21730
|
case 3:
|
|
21679
|
-
|
|
21731
|
+
_context31.n = 5;
|
|
21680
21732
|
break;
|
|
21681
21733
|
case 4:
|
|
21682
|
-
|
|
21683
|
-
|
|
21684
|
-
log.error('error in retract poll vote',
|
|
21734
|
+
_context31.p = 4;
|
|
21735
|
+
_t36 = _context31.v;
|
|
21736
|
+
log.error('error in retract poll vote', _t36);
|
|
21685
21737
|
case 5:
|
|
21686
|
-
return
|
|
21738
|
+
return _context31.a(2);
|
|
21687
21739
|
}
|
|
21688
21740
|
}, _marked28$1, null, [[0, 4]]);
|
|
21689
21741
|
}
|
|
21690
21742
|
function resendPendingPollActions(action) {
|
|
21691
|
-
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy,
|
|
21692
|
-
return _regenerator().w(function (
|
|
21693
|
-
while (1) switch (
|
|
21743
|
+
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy, _t37;
|
|
21744
|
+
return _regenerator().w(function (_context32) {
|
|
21745
|
+
while (1) switch (_context32.p = _context32.n) {
|
|
21694
21746
|
case 0:
|
|
21695
|
-
|
|
21747
|
+
_context32.p = 0;
|
|
21696
21748
|
payload = action.payload;
|
|
21697
21749
|
connectionState = payload.connectionState;
|
|
21698
21750
|
sceytChatClient = getClient();
|
|
21699
21751
|
if (!(!sceytChatClient || connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21700
|
-
|
|
21752
|
+
_context32.n = 1;
|
|
21701
21753
|
break;
|
|
21702
21754
|
}
|
|
21703
|
-
return
|
|
21755
|
+
return _context32.a(2);
|
|
21704
21756
|
case 1:
|
|
21705
21757
|
pendingPollActionsMap = store.getState().MessageReducer.pendingPollActions;
|
|
21706
21758
|
pendingPollActionsMapCopy = JSON.parse(JSON.stringify(pendingPollActionsMap));
|
|
21707
|
-
|
|
21759
|
+
_context32.n = 2;
|
|
21708
21760
|
return call(function () {
|
|
21709
21761
|
return new Promise(function (resolve) {
|
|
21710
21762
|
return setTimeout(resolve, 1000);
|
|
@@ -21740,32 +21792,32 @@ function resendPendingPollActions(action) {
|
|
|
21740
21792
|
}
|
|
21741
21793
|
});
|
|
21742
21794
|
});
|
|
21743
|
-
|
|
21795
|
+
_context32.n = 4;
|
|
21744
21796
|
break;
|
|
21745
21797
|
case 3:
|
|
21746
|
-
|
|
21747
|
-
|
|
21748
|
-
log.error('error in resend pending poll actions',
|
|
21798
|
+
_context32.p = 3;
|
|
21799
|
+
_t37 = _context32.v;
|
|
21800
|
+
log.error('error in resend pending poll actions', _t37);
|
|
21749
21801
|
case 4:
|
|
21750
|
-
return
|
|
21802
|
+
return _context32.a(2);
|
|
21751
21803
|
}
|
|
21752
21804
|
}, _marked29$1, null, [[0, 3]]);
|
|
21753
21805
|
}
|
|
21754
21806
|
function getPollVotes(action) {
|
|
21755
|
-
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes,
|
|
21756
|
-
return _regenerator().w(function (
|
|
21757
|
-
while (1) switch (
|
|
21807
|
+
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes, _t38;
|
|
21808
|
+
return _regenerator().w(function (_context33) {
|
|
21809
|
+
while (1) switch (_context33.p = _context33.n) {
|
|
21758
21810
|
case 0:
|
|
21759
|
-
|
|
21811
|
+
_context33.p = 0;
|
|
21760
21812
|
payload = action.payload;
|
|
21761
21813
|
messageId = payload.messageId, pollId = payload.pollId, optionId = payload.optionId, limit = payload.limit;
|
|
21762
21814
|
key = pollId + "_" + optionId;
|
|
21763
|
-
|
|
21815
|
+
_context33.n = 1;
|
|
21764
21816
|
return put(setPollVotesLoadingStateAC(pollId, optionId, LOADING_STATE.LOADING));
|
|
21765
21817
|
case 1:
|
|
21766
21818
|
SceytChatClient = getClient();
|
|
21767
21819
|
if (!(!SceytChatClient || !SceytChatClient.PollVotesQueryBuilder)) {
|
|
21768
|
-
|
|
21820
|
+
_context33.n = 2;
|
|
21769
21821
|
break;
|
|
21770
21822
|
}
|
|
21771
21823
|
throw new Error('SceytChatClient or PollVotesQueryBuilder not available');
|
|
@@ -21773,14 +21825,14 @@ function getPollVotes(action) {
|
|
|
21773
21825
|
queryBuilder = new SceytChatClient.PollVotesQueryBuilder(messageId, pollId);
|
|
21774
21826
|
queryBuilder.setOptionId(optionId);
|
|
21775
21827
|
queryBuilder.limit(limit || 20);
|
|
21776
|
-
|
|
21828
|
+
_context33.n = 3;
|
|
21777
21829
|
return call(queryBuilder.build);
|
|
21778
21830
|
case 3:
|
|
21779
|
-
pollVotesQuery =
|
|
21780
|
-
|
|
21831
|
+
pollVotesQuery = _context33.v;
|
|
21832
|
+
_context33.n = 4;
|
|
21781
21833
|
return call(pollVotesQuery.loadNext);
|
|
21782
21834
|
case 4:
|
|
21783
|
-
result =
|
|
21835
|
+
result = _context33.v;
|
|
21784
21836
|
if (!query.PollVotesQueries) {
|
|
21785
21837
|
query.PollVotesQueries = {};
|
|
21786
21838
|
}
|
|
@@ -21808,39 +21860,39 @@ function getPollVotes(action) {
|
|
|
21808
21860
|
}
|
|
21809
21861
|
};
|
|
21810
21862
|
});
|
|
21811
|
-
|
|
21863
|
+
_context33.n = 5;
|
|
21812
21864
|
return put(setPollVotesListAC(pollId, optionId, formattedVotes, result.hasNext || false));
|
|
21813
21865
|
case 5:
|
|
21814
|
-
|
|
21866
|
+
_context33.n = 6;
|
|
21815
21867
|
return put(setPollVotesLoadingStateAC(pollId, optionId, LOADING_STATE.LOADED));
|
|
21816
21868
|
case 6:
|
|
21817
|
-
|
|
21869
|
+
_context33.n = 8;
|
|
21818
21870
|
break;
|
|
21819
21871
|
case 7:
|
|
21820
|
-
|
|
21821
|
-
|
|
21822
|
-
log.error('ERROR in get poll votes',
|
|
21823
|
-
|
|
21872
|
+
_context33.p = 7;
|
|
21873
|
+
_t38 = _context33.v;
|
|
21874
|
+
log.error('ERROR in get poll votes', _t38);
|
|
21875
|
+
_context33.n = 8;
|
|
21824
21876
|
return put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
21825
21877
|
case 8:
|
|
21826
|
-
return
|
|
21878
|
+
return _context33.a(2);
|
|
21827
21879
|
}
|
|
21828
21880
|
}, _marked30$1, null, [[0, 7]]);
|
|
21829
21881
|
}
|
|
21830
21882
|
function loadMorePollVotes(action) {
|
|
21831
|
-
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes,
|
|
21832
|
-
return _regenerator().w(function (
|
|
21833
|
-
while (1) switch (
|
|
21883
|
+
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes, _t39;
|
|
21884
|
+
return _regenerator().w(function (_context34) {
|
|
21885
|
+
while (1) switch (_context34.p = _context34.n) {
|
|
21834
21886
|
case 0:
|
|
21835
|
-
|
|
21887
|
+
_context34.p = 0;
|
|
21836
21888
|
payload = action.payload;
|
|
21837
21889
|
pollId = payload.pollId, optionId = payload.optionId, limit = payload.limit;
|
|
21838
21890
|
key = pollId + "_" + optionId;
|
|
21839
|
-
|
|
21891
|
+
_context34.n = 1;
|
|
21840
21892
|
return put(setPollVotesLoadingStateAC(pollId, optionId, LOADING_STATE.LOADING));
|
|
21841
21893
|
case 1:
|
|
21842
21894
|
if (!(!query.PollVotesQueries || !query.PollVotesQueries[key])) {
|
|
21843
|
-
|
|
21895
|
+
_context34.n = 2;
|
|
21844
21896
|
break;
|
|
21845
21897
|
}
|
|
21846
21898
|
throw new Error('Poll votes query not found');
|
|
@@ -21849,10 +21901,10 @@ function loadMorePollVotes(action) {
|
|
|
21849
21901
|
if (limit && pollVotesQuery.limit < limit) {
|
|
21850
21902
|
pollVotesQuery.limit = limit;
|
|
21851
21903
|
}
|
|
21852
|
-
|
|
21904
|
+
_context34.n = 3;
|
|
21853
21905
|
return call(pollVotesQuery.loadNext);
|
|
21854
21906
|
case 3:
|
|
21855
|
-
result =
|
|
21907
|
+
result = _context34.v;
|
|
21856
21908
|
formattedVotes = (result.votes || []).map(function (vote) {
|
|
21857
21909
|
return {
|
|
21858
21910
|
optionId: vote.optionId || optionId,
|
|
@@ -21876,105 +21928,105 @@ function loadMorePollVotes(action) {
|
|
|
21876
21928
|
}
|
|
21877
21929
|
};
|
|
21878
21930
|
});
|
|
21879
|
-
|
|
21931
|
+
_context34.n = 4;
|
|
21880
21932
|
return put(addPollVotesToListAC(pollId, optionId, formattedVotes, result.hasNext || false));
|
|
21881
21933
|
case 4:
|
|
21882
|
-
|
|
21934
|
+
_context34.n = 5;
|
|
21883
21935
|
return put(setPollVotesLoadingStateAC(pollId, optionId, LOADING_STATE.LOADED));
|
|
21884
21936
|
case 5:
|
|
21885
|
-
|
|
21937
|
+
_context34.n = 7;
|
|
21886
21938
|
break;
|
|
21887
21939
|
case 6:
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
log.error('ERROR in load more poll votes',
|
|
21891
|
-
|
|
21940
|
+
_context34.p = 6;
|
|
21941
|
+
_t39 = _context34.v;
|
|
21942
|
+
log.error('ERROR in load more poll votes', _t39);
|
|
21943
|
+
_context34.n = 7;
|
|
21892
21944
|
return put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
21893
21945
|
case 7:
|
|
21894
|
-
return
|
|
21946
|
+
return _context34.a(2);
|
|
21895
21947
|
}
|
|
21896
21948
|
}, _marked31$1, null, [[0, 6]]);
|
|
21897
21949
|
}
|
|
21898
21950
|
function MessageSaga() {
|
|
21899
|
-
return _regenerator().w(function (
|
|
21900
|
-
while (1) switch (
|
|
21951
|
+
return _regenerator().w(function (_context35) {
|
|
21952
|
+
while (1) switch (_context35.n) {
|
|
21901
21953
|
case 0:
|
|
21902
|
-
|
|
21954
|
+
_context35.n = 1;
|
|
21903
21955
|
return takeEvery(SEND_MESSAGE, sendMessage);
|
|
21904
21956
|
case 1:
|
|
21905
|
-
|
|
21957
|
+
_context35.n = 2;
|
|
21906
21958
|
return takeEvery(SEND_TEXT_MESSAGE, sendTextMessage);
|
|
21907
21959
|
case 2:
|
|
21908
|
-
|
|
21960
|
+
_context35.n = 3;
|
|
21909
21961
|
return takeEvery(FORWARD_MESSAGE, forwardMessage);
|
|
21910
21962
|
case 3:
|
|
21911
|
-
|
|
21963
|
+
_context35.n = 4;
|
|
21912
21964
|
return takeEvery(RESEND_MESSAGE, resendMessage);
|
|
21913
21965
|
case 4:
|
|
21914
|
-
|
|
21966
|
+
_context35.n = 5;
|
|
21915
21967
|
return takeLatest(EDIT_MESSAGE, editMessage);
|
|
21916
21968
|
case 5:
|
|
21917
|
-
|
|
21969
|
+
_context35.n = 6;
|
|
21918
21970
|
return takeEvery(DELETE_MESSAGE, deleteMessage);
|
|
21919
21971
|
case 6:
|
|
21920
|
-
|
|
21972
|
+
_context35.n = 7;
|
|
21921
21973
|
return takeLatest(GET_MESSAGES, getMessagesQuery);
|
|
21922
21974
|
case 7:
|
|
21923
|
-
|
|
21975
|
+
_context35.n = 8;
|
|
21924
21976
|
return takeEvery(GET_MESSAGE, getMessageQuery);
|
|
21925
21977
|
case 8:
|
|
21926
|
-
|
|
21978
|
+
_context35.n = 9;
|
|
21927
21979
|
return takeLatest(GET_MESSAGE_MARKERS, getMessageMarkers);
|
|
21928
21980
|
case 9:
|
|
21929
|
-
|
|
21981
|
+
_context35.n = 10;
|
|
21930
21982
|
return takeLatest(GET_MESSAGES_ATTACHMENTS, getMessageAttachments);
|
|
21931
21983
|
case 10:
|
|
21932
|
-
|
|
21984
|
+
_context35.n = 11;
|
|
21933
21985
|
return takeLatest(LOAD_MORE_MESSAGES_ATTACHMENTS, loadMoreMessageAttachments);
|
|
21934
21986
|
case 11:
|
|
21935
|
-
|
|
21987
|
+
_context35.n = 12;
|
|
21936
21988
|
return takeLatest(ADD_REACTION, addReaction);
|
|
21937
21989
|
case 12:
|
|
21938
|
-
|
|
21990
|
+
_context35.n = 13;
|
|
21939
21991
|
return takeLatest(DELETE_REACTION, deleteReaction);
|
|
21940
21992
|
case 13:
|
|
21941
|
-
|
|
21993
|
+
_context35.n = 14;
|
|
21942
21994
|
return takeEvery(LOAD_MORE_MESSAGES, loadMoreMessages);
|
|
21943
21995
|
case 14:
|
|
21944
|
-
|
|
21996
|
+
_context35.n = 15;
|
|
21945
21997
|
return takeEvery(GET_REACTIONS, getReactions);
|
|
21946
21998
|
case 15:
|
|
21947
|
-
|
|
21999
|
+
_context35.n = 16;
|
|
21948
22000
|
return takeEvery(LOAD_MORE_REACTIONS, loadMoreReactions);
|
|
21949
22001
|
case 16:
|
|
21950
|
-
|
|
22002
|
+
_context35.n = 17;
|
|
21951
22003
|
return takeEvery(PAUSE_ATTACHMENT_UPLOADING, pauseAttachmentUploading);
|
|
21952
22004
|
case 17:
|
|
21953
|
-
|
|
22005
|
+
_context35.n = 18;
|
|
21954
22006
|
return takeEvery(RESUME_ATTACHMENT_UPLOADING, resumeAttachmentUploading);
|
|
21955
22007
|
case 18:
|
|
21956
|
-
|
|
22008
|
+
_context35.n = 19;
|
|
21957
22009
|
return takeEvery(ADD_POLL_VOTE, addPollVote);
|
|
21958
22010
|
case 19:
|
|
21959
|
-
|
|
22011
|
+
_context35.n = 20;
|
|
21960
22012
|
return takeEvery(DELETE_POLL_VOTE, deletePollVote);
|
|
21961
22013
|
case 20:
|
|
21962
|
-
|
|
22014
|
+
_context35.n = 21;
|
|
21963
22015
|
return takeEvery(CLOSE_POLL, closePoll);
|
|
21964
22016
|
case 21:
|
|
21965
|
-
|
|
22017
|
+
_context35.n = 22;
|
|
21966
22018
|
return takeEvery(RETRACT_POLL_VOTE, retractPollVote);
|
|
21967
22019
|
case 22:
|
|
21968
|
-
|
|
22020
|
+
_context35.n = 23;
|
|
21969
22021
|
return takeEvery(GET_POLL_VOTES, getPollVotes);
|
|
21970
22022
|
case 23:
|
|
21971
|
-
|
|
22023
|
+
_context35.n = 24;
|
|
21972
22024
|
return takeEvery(LOAD_MORE_POLL_VOTES, loadMorePollVotes);
|
|
21973
22025
|
case 24:
|
|
21974
|
-
|
|
22026
|
+
_context35.n = 25;
|
|
21975
22027
|
return takeEvery(RESEND_PENDING_POLL_ACTIONS, resendPendingPollActions);
|
|
21976
22028
|
case 25:
|
|
21977
|
-
return
|
|
22029
|
+
return _context35.a(2);
|
|
21978
22030
|
}
|
|
21979
22031
|
}, _marked32$1);
|
|
21980
22032
|
}
|