sceyt-chat-react-uikit 1.7.8-beta.5 → 1.7.8-beta.6
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 +118 -142
- package/index.modern.js +118 -142
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -10740,6 +10740,12 @@ function setPendingPollActionsMapAC(messageId, event) {
|
|
|
10740
10740
|
event: event
|
|
10741
10741
|
});
|
|
10742
10742
|
}
|
|
10743
|
+
function updatePendingPollActionAC(messageId, message) {
|
|
10744
|
+
return updatePendingPollAction({
|
|
10745
|
+
messageId: messageId,
|
|
10746
|
+
message: message
|
|
10747
|
+
});
|
|
10748
|
+
}
|
|
10743
10749
|
function setPendingMessageAC(channelId, message) {
|
|
10744
10750
|
return setPendingMessage$1({
|
|
10745
10751
|
channelId: channelId,
|
|
@@ -11841,10 +11847,24 @@ var messageSlice = createSlice({
|
|
|
11841
11847
|
}
|
|
11842
11848
|
state.pendingPollActions[messageId] = [].concat(state.pendingPollActions[messageId], [event]);
|
|
11843
11849
|
},
|
|
11844
|
-
|
|
11850
|
+
updatePendingPollAction: function updatePendingPollAction(state, action) {
|
|
11845
11851
|
var _action$payload20 = action.payload,
|
|
11846
|
-
|
|
11852
|
+
messageId = _action$payload20.messageId,
|
|
11847
11853
|
message = _action$payload20.message;
|
|
11854
|
+
if (!state.pendingPollActions[messageId]) {
|
|
11855
|
+
return;
|
|
11856
|
+
}
|
|
11857
|
+
state.pendingPollActions[messageId] = state.pendingPollActions[messageId].map(function (action) {
|
|
11858
|
+
var _action$message, _action$message2;
|
|
11859
|
+
return ((_action$message = action.message) === null || _action$message === void 0 ? void 0 : _action$message.id) === messageId || ((_action$message2 = action.message) === null || _action$message2 === void 0 ? void 0 : _action$message2.tid) === messageId ? _extends({}, action, {
|
|
11860
|
+
message: message
|
|
11861
|
+
}) : action;
|
|
11862
|
+
});
|
|
11863
|
+
},
|
|
11864
|
+
setPendingMessage: function setPendingMessage(state, action) {
|
|
11865
|
+
var _action$payload21 = action.payload,
|
|
11866
|
+
channelId = _action$payload21.channelId,
|
|
11867
|
+
message = _action$payload21.message;
|
|
11848
11868
|
if (!state.pendingMessagesMap[channelId]) {
|
|
11849
11869
|
state.pendingMessagesMap[channelId] = [];
|
|
11850
11870
|
}
|
|
@@ -11856,9 +11876,9 @@ var messageSlice = createSlice({
|
|
|
11856
11876
|
}
|
|
11857
11877
|
},
|
|
11858
11878
|
removePendingMessage: function removePendingMessage(state, action) {
|
|
11859
|
-
var _action$
|
|
11860
|
-
channelId = _action$
|
|
11861
|
-
messageId = _action$
|
|
11879
|
+
var _action$payload22 = action.payload,
|
|
11880
|
+
channelId = _action$payload22.channelId,
|
|
11881
|
+
messageId = _action$payload22.messageId;
|
|
11862
11882
|
if (state.pendingMessagesMap[channelId]) {
|
|
11863
11883
|
state.pendingMessagesMap[channelId] = state.pendingMessagesMap[channelId].filter(function (msg) {
|
|
11864
11884
|
return !(msg.id === messageId || msg.tid === messageId);
|
|
@@ -11869,10 +11889,10 @@ var messageSlice = createSlice({
|
|
|
11869
11889
|
}
|
|
11870
11890
|
},
|
|
11871
11891
|
updatePendingMessage: function updatePendingMessage(state, action) {
|
|
11872
|
-
var _action$
|
|
11873
|
-
channelId = _action$
|
|
11874
|
-
messageId = _action$
|
|
11875
|
-
updatedMessage = _action$
|
|
11892
|
+
var _action$payload23 = action.payload,
|
|
11893
|
+
channelId = _action$payload23.channelId,
|
|
11894
|
+
messageId = _action$payload23.messageId,
|
|
11895
|
+
updatedMessage = _action$payload23.updatedMessage;
|
|
11876
11896
|
if (state.pendingMessagesMap[channelId]) {
|
|
11877
11897
|
state.pendingMessagesMap[channelId] = state.pendingMessagesMap[channelId].map(function (msg) {
|
|
11878
11898
|
if (msg.id === messageId || msg.tid === messageId) {
|
|
@@ -11947,7 +11967,8 @@ var _messageSlice$actions = messageSlice.actions,
|
|
|
11947
11967
|
setPendingPollActionsMap = _messageSlice$actions.setPendingPollActionsMap,
|
|
11948
11968
|
setPendingMessage$1 = _messageSlice$actions.setPendingMessage,
|
|
11949
11969
|
removePendingMessage = _messageSlice$actions.removePendingMessage,
|
|
11950
|
-
updatePendingMessage = _messageSlice$actions.updatePendingMessage
|
|
11970
|
+
updatePendingMessage = _messageSlice$actions.updatePendingMessage,
|
|
11971
|
+
updatePendingPollAction = _messageSlice$actions.updatePendingPollAction;
|
|
11951
11972
|
var MessageReducer = messageSlice.reducer;
|
|
11952
11973
|
|
|
11953
11974
|
var initialState$2 = {
|
|
@@ -15425,6 +15446,7 @@ function watchForEvents() {
|
|
|
15425
15446
|
}
|
|
15426
15447
|
return _context.a(3, 183);
|
|
15427
15448
|
case 99:
|
|
15449
|
+
console.log('CHANNEL_EVENT_TYPES.POLL_ADDED ... ');
|
|
15428
15450
|
_channel10 = args.channel, pollDetails = args.pollDetails, _messageId = args.messageId;
|
|
15429
15451
|
pollDetailsData = pollDetails;
|
|
15430
15452
|
_context.n = 100;
|
|
@@ -15509,6 +15531,7 @@ function watchForEvents() {
|
|
|
15509
15531
|
case 108:
|
|
15510
15532
|
return _context.a(3, 183);
|
|
15511
15533
|
case 109:
|
|
15534
|
+
console.log('CHANNEL_EVENT_TYPES.POLL_DELETED ... ');
|
|
15512
15535
|
_channel11 = args.channel, _pollDetails = args.pollDetails, _messageId2 = args.messageId;
|
|
15513
15536
|
_pollDetailsData = _pollDetails;
|
|
15514
15537
|
_context.n = 110;
|
|
@@ -15568,6 +15591,7 @@ function watchForEvents() {
|
|
|
15568
15591
|
case 116:
|
|
15569
15592
|
return _context.a(3, 183);
|
|
15570
15593
|
case 117:
|
|
15594
|
+
console.log('CHANNEL_EVENT_TYPES.POLL_RETRACTED ... ');
|
|
15571
15595
|
_channel12 = args.channel, _pollDetails2 = args.pollDetails, _messageId3 = args.messageId;
|
|
15572
15596
|
_context.n = 118;
|
|
15573
15597
|
return effects.call(getActiveChannelId);
|
|
@@ -15626,6 +15650,7 @@ function watchForEvents() {
|
|
|
15626
15650
|
case 124:
|
|
15627
15651
|
return _context.a(3, 183);
|
|
15628
15652
|
case 125:
|
|
15653
|
+
console.log('CHANNEL_EVENT_TYPES.POLL_CLOSED ... ');
|
|
15629
15654
|
_channel13 = args.channel, _messageId4 = args.messageId;
|
|
15630
15655
|
_context.n = 126;
|
|
15631
15656
|
return effects.call(getActiveChannelId);
|
|
@@ -19358,7 +19383,7 @@ function sendMessage(action) {
|
|
|
19358
19383
|
messagesToSend.push(messageToSend);
|
|
19359
19384
|
case 12:
|
|
19360
19385
|
_loop2 = /*#__PURE__*/_regenerator().m(function _callee3() {
|
|
19361
|
-
var messageAttachment, messageToSend, messageCopy, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData,
|
|
19386
|
+
var messageAttachment, messageToSend, messageCopy, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, stringifiedMessageUpdateData, activeChannelId, channelUpdateParam, isErrorResendable, _t;
|
|
19362
19387
|
return _regenerator().w(function (_context3) {
|
|
19363
19388
|
while (1) switch (_context3.p = _context3.n) {
|
|
19364
19389
|
case 0:
|
|
@@ -19460,23 +19485,23 @@ function sendMessage(action) {
|
|
|
19460
19485
|
createdAt: messageResponse.createdAt,
|
|
19461
19486
|
channelId: channel.id
|
|
19462
19487
|
};
|
|
19488
|
+
stringifiedMessageUpdateData = JSON.parse(JSON.stringify(messageUpdateData));
|
|
19463
19489
|
activeChannelId = getActiveChannelId();
|
|
19464
19490
|
if (!(activeChannelId === channel.id)) {
|
|
19465
19491
|
_context3.n = 9;
|
|
19466
19492
|
break;
|
|
19467
19493
|
}
|
|
19468
19494
|
_context3.n = 9;
|
|
19469
|
-
return effects.put(updateMessageAC(messageToSend.tid,
|
|
19495
|
+
return effects.put(updateMessageAC(messageToSend.tid, stringifiedMessageUpdateData, true));
|
|
19470
19496
|
case 9:
|
|
19471
19497
|
_context3.n = 10;
|
|
19472
19498
|
return effects.put(removePendingMessageAC(channel.id, messageToSend.tid));
|
|
19473
19499
|
case 10:
|
|
19474
|
-
addMessageToMap(channel.id,
|
|
19500
|
+
addMessageToMap(channel.id, stringifiedMessageUpdateData);
|
|
19475
19501
|
updateMessageOnAllMessages(messageToSend.tid, messageUpdateData);
|
|
19476
|
-
|
|
19477
|
-
updateChannelLastMessageOnAllChannels(channel.id, messageToUpdate);
|
|
19502
|
+
updateChannelLastMessageOnAllChannels(channel.id, stringifiedMessageUpdateData);
|
|
19478
19503
|
channelUpdateParam = {
|
|
19479
|
-
lastMessage:
|
|
19504
|
+
lastMessage: stringifiedMessageUpdateData,
|
|
19480
19505
|
lastReactedMessage: null
|
|
19481
19506
|
};
|
|
19482
19507
|
if (!channel.unread) {
|
|
@@ -19567,7 +19592,7 @@ function sendMessage(action) {
|
|
|
19567
19592
|
}, _marked$3, null, [[1, 16, 17, 19]]);
|
|
19568
19593
|
}
|
|
19569
19594
|
function sendTextMessage(action) {
|
|
19570
|
-
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend, _messageResponse, messageResponse, messageUpdateData, activeChannelId, messageToUpdate, channelUpdateParam, isErrorResendable, _activeChannelId, _t3;
|
|
19595
|
+
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend, _messageResponse, messageResponse, messageUpdateData, activeChannelId, stringifiedMessageUpdateData, messageToUpdate, channelUpdateParam, isErrorResendable, _activeChannelId, _t3;
|
|
19571
19596
|
return _regenerator().w(function (_context5) {
|
|
19572
19597
|
while (1) switch (_context5.p = _context5.n) {
|
|
19573
19598
|
case 0:
|
|
@@ -19655,7 +19680,7 @@ function sendTextMessage(action) {
|
|
|
19655
19680
|
return effects.call(updateMessage$1, action.type, pendingMessage, channel.id, true, message);
|
|
19656
19681
|
case 8:
|
|
19657
19682
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19658
|
-
_context5.n =
|
|
19683
|
+
_context5.n = 18;
|
|
19659
19684
|
break;
|
|
19660
19685
|
}
|
|
19661
19686
|
if (!sendMessageHandler) {
|
|
@@ -19699,10 +19724,14 @@ function sendTextMessage(action) {
|
|
|
19699
19724
|
_context5.n = 13;
|
|
19700
19725
|
return effects.put(updateMessageAC(messageToSend.tid, messageUpdateData, true));
|
|
19701
19726
|
case 13:
|
|
19727
|
+
stringifiedMessageUpdateData = JSON.parse(JSON.stringify(messageUpdateData));
|
|
19702
19728
|
_context5.n = 14;
|
|
19703
|
-
return effects.put(
|
|
19729
|
+
return effects.put(updatePendingPollActionAC(messageToSend.tid, stringifiedMessageUpdateData));
|
|
19704
19730
|
case 14:
|
|
19705
|
-
|
|
19731
|
+
_context5.n = 15;
|
|
19732
|
+
return effects.put(removePendingMessageAC(channel.id, messageToSend.tid));
|
|
19733
|
+
case 15:
|
|
19734
|
+
addMessageToMap(channel.id, stringifiedMessageUpdateData);
|
|
19706
19735
|
if (activeChannelId === channel.id) {
|
|
19707
19736
|
updateMessageOnAllMessages(messageToSend.tid, messageUpdateData);
|
|
19708
19737
|
}
|
|
@@ -19712,42 +19741,42 @@ function sendTextMessage(action) {
|
|
|
19712
19741
|
lastMessage: messageToUpdate,
|
|
19713
19742
|
lastReactedMessage: null
|
|
19714
19743
|
};
|
|
19715
|
-
_context5.n =
|
|
19744
|
+
_context5.n = 16;
|
|
19716
19745
|
return effects.put(updateChannelDataAC(channel.id, channelUpdateParam, true));
|
|
19717
|
-
case
|
|
19746
|
+
case 16:
|
|
19718
19747
|
updateChannelOnAllChannels(channel.id, channelUpdateParam);
|
|
19719
19748
|
if (!channel.unread) {
|
|
19720
|
-
_context5.n =
|
|
19749
|
+
_context5.n = 17;
|
|
19721
19750
|
break;
|
|
19722
19751
|
}
|
|
19723
|
-
_context5.n =
|
|
19752
|
+
_context5.n = 17;
|
|
19724
19753
|
return effects.put(markChannelAsReadAC(channel.id));
|
|
19725
|
-
case
|
|
19754
|
+
case 17:
|
|
19726
19755
|
channel.lastMessage = messageToUpdate;
|
|
19727
|
-
_context5.n =
|
|
19756
|
+
_context5.n = 19;
|
|
19728
19757
|
break;
|
|
19729
|
-
case 17:
|
|
19730
|
-
throw new Error('Connection required to send message');
|
|
19731
19758
|
case 18:
|
|
19732
|
-
|
|
19733
|
-
break;
|
|
19759
|
+
throw new Error('Connection required to send message');
|
|
19734
19760
|
case 19:
|
|
19735
|
-
_context5.
|
|
19761
|
+
_context5.n = 23;
|
|
19762
|
+
break;
|
|
19763
|
+
case 20:
|
|
19764
|
+
_context5.p = 20;
|
|
19736
19765
|
_t3 = _context5.v;
|
|
19737
19766
|
log.error('error on send text message ... ', _t3 === null || _t3 === void 0 ? void 0 : _t3.type);
|
|
19738
19767
|
isErrorResendable = isResendableError(_t3 === null || _t3 === void 0 ? void 0 : _t3.type);
|
|
19739
19768
|
if (!(!isErrorResendable && channel.id && sendMessageTid)) {
|
|
19740
|
-
_context5.n =
|
|
19769
|
+
_context5.n = 22;
|
|
19741
19770
|
break;
|
|
19742
19771
|
}
|
|
19743
|
-
_context5.n =
|
|
19772
|
+
_context5.n = 21;
|
|
19744
19773
|
return effects.put(removePendingMessageAC(channel.id, sendMessageTid));
|
|
19745
|
-
case 20:
|
|
19746
|
-
_context5.n = 22;
|
|
19747
|
-
break;
|
|
19748
19774
|
case 21:
|
|
19775
|
+
_context5.n = 23;
|
|
19776
|
+
break;
|
|
19777
|
+
case 22:
|
|
19749
19778
|
if (!(channel.id && sendMessageTid)) {
|
|
19750
|
-
_context5.n =
|
|
19779
|
+
_context5.n = 23;
|
|
19751
19780
|
break;
|
|
19752
19781
|
}
|
|
19753
19782
|
updateMessageOnMap(channel.id, {
|
|
@@ -19758,26 +19787,26 @@ function sendTextMessage(action) {
|
|
|
19758
19787
|
});
|
|
19759
19788
|
_activeChannelId = getActiveChannelId();
|
|
19760
19789
|
if (!(_activeChannelId === channel.id)) {
|
|
19761
|
-
_context5.n =
|
|
19790
|
+
_context5.n = 23;
|
|
19762
19791
|
break;
|
|
19763
19792
|
}
|
|
19764
19793
|
updateMessageOnAllMessages(sendMessageTid, {
|
|
19765
19794
|
state: MESSAGE_STATUS.FAILED
|
|
19766
19795
|
});
|
|
19767
|
-
_context5.n =
|
|
19796
|
+
_context5.n = 23;
|
|
19768
19797
|
return effects.put(updateMessageAC(sendMessageTid, {
|
|
19769
19798
|
state: MESSAGE_STATUS.FAILED
|
|
19770
19799
|
}));
|
|
19771
|
-
case 22:
|
|
19772
|
-
_context5.p = 22;
|
|
19773
|
-
_context5.n = 23;
|
|
19774
|
-
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19775
19800
|
case 23:
|
|
19776
|
-
|
|
19801
|
+
_context5.p = 23;
|
|
19802
|
+
_context5.n = 24;
|
|
19803
|
+
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19777
19804
|
case 24:
|
|
19805
|
+
return _context5.f(23);
|
|
19806
|
+
case 25:
|
|
19778
19807
|
return _context5.a(2);
|
|
19779
19808
|
}
|
|
19780
|
-
}, _marked2$2, null, [[3,
|
|
19809
|
+
}, _marked2$2, null, [[3, 20, 23, 25]]);
|
|
19781
19810
|
}
|
|
19782
19811
|
function forwardMessage(action) {
|
|
19783
19812
|
var payload, message, channelId, connectionState, isForward, pendingMessage, channel, activeChannelId, messageTid, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, pollDetails, messageToSend, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, isErrorResendable, _activeChannelId2, _t4;
|
|
@@ -21447,9 +21476,9 @@ function getMessageMarkers(action) {
|
|
|
21447
21476
|
}
|
|
21448
21477
|
}, _marked16$1, null, [[0, 5, 6, 8]]);
|
|
21449
21478
|
}
|
|
21450
|
-
function executeAddPollVote(channelId, pollId, optionId, message
|
|
21479
|
+
function executeAddPollVote(channelId, pollId, optionId, message) {
|
|
21451
21480
|
var _user$presence, _message$pollDetails, _message$pollDetails2, _message$pollDetails3, _message$pollDetails4;
|
|
21452
|
-
var channel, user, vote, objs, _message$pollDetails5, _message$pollDetails6, _message$pollDetails7
|
|
21481
|
+
var channel, user, vote, objs, _message$pollDetails5, _message$pollDetails6, _message$pollDetails7;
|
|
21453
21482
|
return _regenerator().w(function (_context22) {
|
|
21454
21483
|
while (1) switch (_context22.n) {
|
|
21455
21484
|
case 0:
|
|
@@ -21498,38 +21527,16 @@ function executeAddPollVote(channelId, pollId, optionId, message, isResend) {
|
|
|
21498
21527
|
vote: vote,
|
|
21499
21528
|
incrementVotesPerOptionCount: 1
|
|
21500
21529
|
});
|
|
21501
|
-
if (
|
|
21502
|
-
_context22.n =
|
|
21503
|
-
break;
|
|
21504
|
-
}
|
|
21505
|
-
_iterator2 = _createForOfIteratorHelperLoose(objs);
|
|
21506
|
-
case 3:
|
|
21507
|
-
if ((_step2 = _iterator2()).done) {
|
|
21508
|
-
_context22.n = 5;
|
|
21530
|
+
if (!(channel && message.id)) {
|
|
21531
|
+
_context22.n = 4;
|
|
21509
21532
|
break;
|
|
21510
21533
|
}
|
|
21511
|
-
obj = _step2.value;
|
|
21512
|
-
updateMessageOnMap(channel.id, {
|
|
21513
|
-
messageId: message.id,
|
|
21514
|
-
params: {}
|
|
21515
|
-
}, obj);
|
|
21516
|
-
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21517
|
-
_context22.n = 4;
|
|
21518
|
-
return effects.put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21519
|
-
case 4:
|
|
21520
21534
|
_context22.n = 3;
|
|
21521
|
-
break;
|
|
21522
|
-
case 5:
|
|
21523
|
-
if (!channel) {
|
|
21524
|
-
_context22.n = 7;
|
|
21525
|
-
break;
|
|
21526
|
-
}
|
|
21527
|
-
_context22.n = 6;
|
|
21528
21535
|
return effects.call(channel.addVote, message.id, pollId, [optionId]);
|
|
21529
|
-
case
|
|
21530
|
-
_context22.n =
|
|
21536
|
+
case 3:
|
|
21537
|
+
_context22.n = 4;
|
|
21531
21538
|
return effects.put(removePendingPollActionAC(message.id, 'ADD_POLL_VOTE', optionId));
|
|
21532
|
-
case
|
|
21539
|
+
case 4:
|
|
21533
21540
|
return _context22.a(2);
|
|
21534
21541
|
}
|
|
21535
21542
|
}, _marked17$1);
|
|
@@ -21573,7 +21580,7 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
|
21573
21580
|
}, _marked18$1);
|
|
21574
21581
|
}
|
|
21575
21582
|
function addPollVote(action) {
|
|
21576
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence2,
|
|
21583
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence2, user, vote, pendingAction, conflictCheck, channel, _Object$values, _store$getState$Messa, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj, _t32;
|
|
21577
21584
|
return _regenerator().w(function (_context24) {
|
|
21578
21585
|
while (1) switch (_context24.p = _context24.n) {
|
|
21579
21586
|
case 0:
|
|
@@ -21582,10 +21589,9 @@ function addPollVote(action) {
|
|
|
21582
21589
|
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, message = payload.message, isResend = payload.isResend;
|
|
21583
21590
|
sceytChatClient = getClient();
|
|
21584
21591
|
if (!sceytChatClient) {
|
|
21585
|
-
_context24.n =
|
|
21592
|
+
_context24.n = 6;
|
|
21586
21593
|
break;
|
|
21587
21594
|
}
|
|
21588
|
-
connectionState = sceytChatClient.connectionState;
|
|
21589
21595
|
user = sceytChatClient.user;
|
|
21590
21596
|
vote = {
|
|
21591
21597
|
optionId: optionId,
|
|
@@ -21608,10 +21614,6 @@ function addPollVote(action) {
|
|
|
21608
21614
|
createdAt: new Date().getTime()
|
|
21609
21615
|
}
|
|
21610
21616
|
};
|
|
21611
|
-
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21612
|
-
_context24.n = 6;
|
|
21613
|
-
break;
|
|
21614
|
-
}
|
|
21615
21617
|
pendingAction = {
|
|
21616
21618
|
type: 'ADD_POLL_VOTE',
|
|
21617
21619
|
channelId: channelId,
|
|
@@ -21661,27 +21663,25 @@ function addPollVote(action) {
|
|
|
21661
21663
|
}
|
|
21662
21664
|
return _context24.d(_regeneratorValues(updateMessageOptimisticallyForAddPollVote(channelId, message, vote)), 5);
|
|
21663
21665
|
case 5:
|
|
21664
|
-
if (!conflictCheck.shouldSkip) {
|
|
21666
|
+
if (!conflictCheck.shouldSkip && !isResend) {
|
|
21665
21667
|
setPendingPollAction(pendingAction);
|
|
21666
21668
|
}
|
|
21667
|
-
return _context24.
|
|
21669
|
+
return _context24.d(_regeneratorValues(executeAddPollVote(channelId, pollId, optionId, message)), 6);
|
|
21668
21670
|
case 6:
|
|
21669
|
-
|
|
21670
|
-
case 7:
|
|
21671
|
-
_context24.n = 9;
|
|
21671
|
+
_context24.n = 8;
|
|
21672
21672
|
break;
|
|
21673
|
-
case
|
|
21674
|
-
_context24.p =
|
|
21673
|
+
case 7:
|
|
21674
|
+
_context24.p = 7;
|
|
21675
21675
|
_t32 = _context24.v;
|
|
21676
21676
|
log.error('error in add poll vote', _t32);
|
|
21677
|
-
case
|
|
21677
|
+
case 8:
|
|
21678
21678
|
return _context24.a(2);
|
|
21679
21679
|
}
|
|
21680
|
-
}, _marked19$1, null, [[0,
|
|
21680
|
+
}, _marked19$1, null, [[0, 7]]);
|
|
21681
21681
|
}
|
|
21682
|
-
function executeDeletePollVote(channelId, pollId, optionId, message
|
|
21682
|
+
function executeDeletePollVote(channelId, pollId, optionId, message) {
|
|
21683
21683
|
var _message$pollDetails8, _message$pollDetails9, _message$pollDetails0;
|
|
21684
|
-
var channel, vote
|
|
21684
|
+
var channel, vote;
|
|
21685
21685
|
return _regenerator().w(function (_context25) {
|
|
21686
21686
|
while (1) switch (_context25.n) {
|
|
21687
21687
|
case 0:
|
|
@@ -21704,33 +21704,16 @@ function executeDeletePollVote(channelId, pollId, optionId, message, isResend) {
|
|
|
21704
21704
|
}
|
|
21705
21705
|
return _context25.a(2);
|
|
21706
21706
|
case 3:
|
|
21707
|
-
|
|
21708
|
-
|
|
21709
|
-
vote: vote,
|
|
21710
|
-
incrementVotesPerOptionCount: -1
|
|
21711
|
-
};
|
|
21712
|
-
if (isResend) {
|
|
21713
|
-
_context25.n = 4;
|
|
21707
|
+
if (!(channel && message.id)) {
|
|
21708
|
+
_context25.n = 5;
|
|
21714
21709
|
break;
|
|
21715
21710
|
}
|
|
21716
|
-
updateMessageOnMap(channel.id, {
|
|
21717
|
-
messageId: message.id,
|
|
21718
|
-
params: {}
|
|
21719
|
-
}, obj);
|
|
21720
|
-
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21721
21711
|
_context25.n = 4;
|
|
21722
|
-
return effects.
|
|
21712
|
+
return effects.call(channel.deleteVote, message.id, pollId, [optionId]);
|
|
21723
21713
|
case 4:
|
|
21724
|
-
if (!channel) {
|
|
21725
|
-
_context25.n = 6;
|
|
21726
|
-
break;
|
|
21727
|
-
}
|
|
21728
21714
|
_context25.n = 5;
|
|
21729
|
-
return effects.call(channel.deleteVote, message.id, pollId, [optionId]);
|
|
21730
|
-
case 5:
|
|
21731
|
-
_context25.n = 6;
|
|
21732
21715
|
return effects.put(removePendingPollActionAC(message.id, 'DELETE_POLL_VOTE', optionId));
|
|
21733
|
-
case
|
|
21716
|
+
case 5:
|
|
21734
21717
|
return _context25.a(2);
|
|
21735
21718
|
}
|
|
21736
21719
|
}, _marked20$1);
|
|
@@ -21774,7 +21757,7 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
|
|
|
21774
21757
|
}, _marked21$1);
|
|
21775
21758
|
}
|
|
21776
21759
|
function deletePollVote(action) {
|
|
21777
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11,
|
|
21760
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11, vote, pendingAction, conflictCheck, channel, _Object$values2, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj, _t33;
|
|
21778
21761
|
return _regenerator().w(function (_context27) {
|
|
21779
21762
|
while (1) switch (_context27.p = _context27.n) {
|
|
21780
21763
|
case 0:
|
|
@@ -21783,10 +21766,9 @@ function deletePollVote(action) {
|
|
|
21783
21766
|
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, message = payload.message, isResend = payload.isResend;
|
|
21784
21767
|
sceytChatClient = getClient();
|
|
21785
21768
|
if (!sceytChatClient) {
|
|
21786
|
-
_context27.n =
|
|
21769
|
+
_context27.n = 7;
|
|
21787
21770
|
break;
|
|
21788
21771
|
}
|
|
21789
|
-
connectionState = sceytChatClient.connectionState;
|
|
21790
21772
|
vote = (_message$pollDetails1 = message.pollDetails) === null || _message$pollDetails1 === void 0 ? void 0 : (_message$pollDetails10 = _message$pollDetails1.voteDetails) === null || _message$pollDetails10 === void 0 ? void 0 : (_message$pollDetails11 = _message$pollDetails10.ownVotes) === null || _message$pollDetails11 === void 0 ? void 0 : _message$pollDetails11.find(function (vote) {
|
|
21791
21773
|
return vote.optionId === optionId;
|
|
21792
21774
|
});
|
|
@@ -21796,10 +21778,6 @@ function deletePollVote(action) {
|
|
|
21796
21778
|
}
|
|
21797
21779
|
return _context27.a(2);
|
|
21798
21780
|
case 1:
|
|
21799
|
-
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21800
|
-
_context27.n = 7;
|
|
21801
|
-
break;
|
|
21802
|
-
}
|
|
21803
21781
|
pendingAction = {
|
|
21804
21782
|
type: 'DELETE_POLL_VOTE',
|
|
21805
21783
|
channelId: channelId,
|
|
@@ -21848,23 +21826,21 @@ function deletePollVote(action) {
|
|
|
21848
21826
|
}
|
|
21849
21827
|
return _context27.d(_regeneratorValues(updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)), 6);
|
|
21850
21828
|
case 6:
|
|
21851
|
-
if (!conflictCheck.shouldSkip) {
|
|
21829
|
+
if (!conflictCheck.shouldSkip && !isResend) {
|
|
21852
21830
|
setPendingPollAction(pendingAction);
|
|
21853
21831
|
}
|
|
21854
|
-
return _context27.
|
|
21832
|
+
return _context27.d(_regeneratorValues(executeDeletePollVote(channelId, pollId, optionId, message)), 7);
|
|
21855
21833
|
case 7:
|
|
21856
|
-
|
|
21857
|
-
case 8:
|
|
21858
|
-
_context27.n = 10;
|
|
21834
|
+
_context27.n = 9;
|
|
21859
21835
|
break;
|
|
21860
|
-
case
|
|
21861
|
-
_context27.p =
|
|
21836
|
+
case 8:
|
|
21837
|
+
_context27.p = 8;
|
|
21862
21838
|
_t33 = _context27.v;
|
|
21863
21839
|
log.error('error in delete poll vote', _t33);
|
|
21864
|
-
case
|
|
21840
|
+
case 9:
|
|
21865
21841
|
return _context27.a(2);
|
|
21866
21842
|
}
|
|
21867
|
-
}, _marked22$1, null, [[0,
|
|
21843
|
+
}, _marked22$1, null, [[0, 8]]);
|
|
21868
21844
|
}
|
|
21869
21845
|
function executeClosePoll(channelId, pollId, message) {
|
|
21870
21846
|
var channel, obj;
|
|
@@ -21887,7 +21863,7 @@ function executeClosePoll(channelId, pollId, message) {
|
|
|
21887
21863
|
_context28.n = 2;
|
|
21888
21864
|
return effects.put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21889
21865
|
case 2:
|
|
21890
|
-
if (!channel) {
|
|
21866
|
+
if (!(channel && message.id)) {
|
|
21891
21867
|
_context28.n = 4;
|
|
21892
21868
|
break;
|
|
21893
21869
|
}
|
|
@@ -21979,7 +21955,7 @@ function closePoll(action) {
|
|
|
21979
21955
|
}, _marked25$1, null, [[0, 4]]);
|
|
21980
21956
|
}
|
|
21981
21957
|
function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
|
|
21982
|
-
var channel,
|
|
21958
|
+
var channel, _iterator2, _step2, obj;
|
|
21983
21959
|
return _regenerator().w(function (_context31) {
|
|
21984
21960
|
while (1) switch (_context31.n) {
|
|
21985
21961
|
case 0:
|
|
@@ -21991,13 +21967,13 @@ function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
|
|
|
21991
21967
|
_context31.n = 4;
|
|
21992
21968
|
break;
|
|
21993
21969
|
}
|
|
21994
|
-
|
|
21970
|
+
_iterator2 = _createForOfIteratorHelperLoose(objs);
|
|
21995
21971
|
case 2:
|
|
21996
|
-
if ((
|
|
21972
|
+
if ((_step2 = _iterator2()).done) {
|
|
21997
21973
|
_context31.n = 4;
|
|
21998
21974
|
break;
|
|
21999
21975
|
}
|
|
22000
|
-
obj =
|
|
21976
|
+
obj = _step2.value;
|
|
22001
21977
|
updateMessageOnMap(channelId, {
|
|
22002
21978
|
messageId: message.id,
|
|
22003
21979
|
params: {}
|
|
@@ -22009,7 +21985,7 @@ function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
|
|
|
22009
21985
|
_context31.n = 2;
|
|
22010
21986
|
break;
|
|
22011
21987
|
case 4:
|
|
22012
|
-
if (!channel) {
|
|
21988
|
+
if (!(channel && message.id)) {
|
|
22013
21989
|
_context31.n = 6;
|
|
22014
21990
|
break;
|
|
22015
21991
|
}
|
|
@@ -22024,7 +22000,7 @@ function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
|
|
|
22024
22000
|
}, _marked26$1);
|
|
22025
22001
|
}
|
|
22026
22002
|
function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs) {
|
|
22027
|
-
var channel,
|
|
22003
|
+
var channel, _iterator3, _step3, obj;
|
|
22028
22004
|
return _regenerator().w(function (_context32) {
|
|
22029
22005
|
while (1) switch (_context32.n) {
|
|
22030
22006
|
case 0:
|
|
@@ -22038,13 +22014,13 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
|
|
|
22038
22014
|
}
|
|
22039
22015
|
return _context32.a(2);
|
|
22040
22016
|
case 2:
|
|
22041
|
-
|
|
22017
|
+
_iterator3 = _createForOfIteratorHelperLoose(objs);
|
|
22042
22018
|
case 3:
|
|
22043
|
-
if ((
|
|
22019
|
+
if ((_step3 = _iterator3()).done) {
|
|
22044
22020
|
_context32.n = 5;
|
|
22045
22021
|
break;
|
|
22046
22022
|
}
|
|
22047
|
-
obj =
|
|
22023
|
+
obj = _step3.value;
|
|
22048
22024
|
updateMessageOnMap(channelId, {
|
|
22049
22025
|
messageId: message.id,
|
|
22050
22026
|
params: {}
|
|
@@ -22061,7 +22037,7 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
|
|
|
22061
22037
|
}, _marked27$1);
|
|
22062
22038
|
}
|
|
22063
22039
|
function retractPollVote(action) {
|
|
22064
|
-
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs,
|
|
22040
|
+
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator4, _step4, _message$pollDetails12, _message$pollDetails13, vote, _t35;
|
|
22065
22041
|
return _regenerator().w(function (_context33) {
|
|
22066
22042
|
while (1) switch (_context33.p = _context33.n) {
|
|
22067
22043
|
case 0:
|
|
@@ -22075,8 +22051,8 @@ function retractPollVote(action) {
|
|
|
22075
22051
|
}
|
|
22076
22052
|
connectionState = sceytChatClient.connectionState;
|
|
22077
22053
|
objs = [];
|
|
22078
|
-
for (
|
|
22079
|
-
vote =
|
|
22054
|
+
for (_iterator4 = _createForOfIteratorHelperLoose(((_message$pollDetails12 = message.pollDetails) === null || _message$pollDetails12 === void 0 ? void 0 : (_message$pollDetails13 = _message$pollDetails12.voteDetails) === null || _message$pollDetails13 === void 0 ? void 0 : _message$pollDetails13.ownVotes) || []); !(_step4 = _iterator4()).done;) {
|
|
22055
|
+
vote = _step4.value;
|
|
22080
22056
|
objs.push({
|
|
22081
22057
|
type: 'deleteOwn',
|
|
22082
22058
|
vote: vote,
|
package/index.modern.js
CHANGED
|
@@ -10739,6 +10739,12 @@ function setPendingPollActionsMapAC(messageId, event) {
|
|
|
10739
10739
|
event: event
|
|
10740
10740
|
});
|
|
10741
10741
|
}
|
|
10742
|
+
function updatePendingPollActionAC(messageId, message) {
|
|
10743
|
+
return updatePendingPollAction({
|
|
10744
|
+
messageId: messageId,
|
|
10745
|
+
message: message
|
|
10746
|
+
});
|
|
10747
|
+
}
|
|
10742
10748
|
function setPendingMessageAC(channelId, message) {
|
|
10743
10749
|
return setPendingMessage$1({
|
|
10744
10750
|
channelId: channelId,
|
|
@@ -11840,10 +11846,24 @@ var messageSlice = createSlice({
|
|
|
11840
11846
|
}
|
|
11841
11847
|
state.pendingPollActions[messageId] = [].concat(state.pendingPollActions[messageId], [event]);
|
|
11842
11848
|
},
|
|
11843
|
-
|
|
11849
|
+
updatePendingPollAction: function updatePendingPollAction(state, action) {
|
|
11844
11850
|
var _action$payload20 = action.payload,
|
|
11845
|
-
|
|
11851
|
+
messageId = _action$payload20.messageId,
|
|
11846
11852
|
message = _action$payload20.message;
|
|
11853
|
+
if (!state.pendingPollActions[messageId]) {
|
|
11854
|
+
return;
|
|
11855
|
+
}
|
|
11856
|
+
state.pendingPollActions[messageId] = state.pendingPollActions[messageId].map(function (action) {
|
|
11857
|
+
var _action$message, _action$message2;
|
|
11858
|
+
return ((_action$message = action.message) === null || _action$message === void 0 ? void 0 : _action$message.id) === messageId || ((_action$message2 = action.message) === null || _action$message2 === void 0 ? void 0 : _action$message2.tid) === messageId ? _extends({}, action, {
|
|
11859
|
+
message: message
|
|
11860
|
+
}) : action;
|
|
11861
|
+
});
|
|
11862
|
+
},
|
|
11863
|
+
setPendingMessage: function setPendingMessage(state, action) {
|
|
11864
|
+
var _action$payload21 = action.payload,
|
|
11865
|
+
channelId = _action$payload21.channelId,
|
|
11866
|
+
message = _action$payload21.message;
|
|
11847
11867
|
if (!state.pendingMessagesMap[channelId]) {
|
|
11848
11868
|
state.pendingMessagesMap[channelId] = [];
|
|
11849
11869
|
}
|
|
@@ -11855,9 +11875,9 @@ var messageSlice = createSlice({
|
|
|
11855
11875
|
}
|
|
11856
11876
|
},
|
|
11857
11877
|
removePendingMessage: function removePendingMessage(state, action) {
|
|
11858
|
-
var _action$
|
|
11859
|
-
channelId = _action$
|
|
11860
|
-
messageId = _action$
|
|
11878
|
+
var _action$payload22 = action.payload,
|
|
11879
|
+
channelId = _action$payload22.channelId,
|
|
11880
|
+
messageId = _action$payload22.messageId;
|
|
11861
11881
|
if (state.pendingMessagesMap[channelId]) {
|
|
11862
11882
|
state.pendingMessagesMap[channelId] = state.pendingMessagesMap[channelId].filter(function (msg) {
|
|
11863
11883
|
return !(msg.id === messageId || msg.tid === messageId);
|
|
@@ -11868,10 +11888,10 @@ var messageSlice = createSlice({
|
|
|
11868
11888
|
}
|
|
11869
11889
|
},
|
|
11870
11890
|
updatePendingMessage: function updatePendingMessage(state, action) {
|
|
11871
|
-
var _action$
|
|
11872
|
-
channelId = _action$
|
|
11873
|
-
messageId = _action$
|
|
11874
|
-
updatedMessage = _action$
|
|
11891
|
+
var _action$payload23 = action.payload,
|
|
11892
|
+
channelId = _action$payload23.channelId,
|
|
11893
|
+
messageId = _action$payload23.messageId,
|
|
11894
|
+
updatedMessage = _action$payload23.updatedMessage;
|
|
11875
11895
|
if (state.pendingMessagesMap[channelId]) {
|
|
11876
11896
|
state.pendingMessagesMap[channelId] = state.pendingMessagesMap[channelId].map(function (msg) {
|
|
11877
11897
|
if (msg.id === messageId || msg.tid === messageId) {
|
|
@@ -11946,7 +11966,8 @@ var _messageSlice$actions = messageSlice.actions,
|
|
|
11946
11966
|
setPendingPollActionsMap = _messageSlice$actions.setPendingPollActionsMap,
|
|
11947
11967
|
setPendingMessage$1 = _messageSlice$actions.setPendingMessage,
|
|
11948
11968
|
removePendingMessage = _messageSlice$actions.removePendingMessage,
|
|
11949
|
-
updatePendingMessage = _messageSlice$actions.updatePendingMessage
|
|
11969
|
+
updatePendingMessage = _messageSlice$actions.updatePendingMessage,
|
|
11970
|
+
updatePendingPollAction = _messageSlice$actions.updatePendingPollAction;
|
|
11950
11971
|
var MessageReducer = messageSlice.reducer;
|
|
11951
11972
|
|
|
11952
11973
|
var initialState$2 = {
|
|
@@ -15424,6 +15445,7 @@ function watchForEvents() {
|
|
|
15424
15445
|
}
|
|
15425
15446
|
return _context.a(3, 183);
|
|
15426
15447
|
case 99:
|
|
15448
|
+
console.log('CHANNEL_EVENT_TYPES.POLL_ADDED ... ');
|
|
15427
15449
|
_channel10 = args.channel, pollDetails = args.pollDetails, _messageId = args.messageId;
|
|
15428
15450
|
pollDetailsData = pollDetails;
|
|
15429
15451
|
_context.n = 100;
|
|
@@ -15508,6 +15530,7 @@ function watchForEvents() {
|
|
|
15508
15530
|
case 108:
|
|
15509
15531
|
return _context.a(3, 183);
|
|
15510
15532
|
case 109:
|
|
15533
|
+
console.log('CHANNEL_EVENT_TYPES.POLL_DELETED ... ');
|
|
15511
15534
|
_channel11 = args.channel, _pollDetails = args.pollDetails, _messageId2 = args.messageId;
|
|
15512
15535
|
_pollDetailsData = _pollDetails;
|
|
15513
15536
|
_context.n = 110;
|
|
@@ -15567,6 +15590,7 @@ function watchForEvents() {
|
|
|
15567
15590
|
case 116:
|
|
15568
15591
|
return _context.a(3, 183);
|
|
15569
15592
|
case 117:
|
|
15593
|
+
console.log('CHANNEL_EVENT_TYPES.POLL_RETRACTED ... ');
|
|
15570
15594
|
_channel12 = args.channel, _pollDetails2 = args.pollDetails, _messageId3 = args.messageId;
|
|
15571
15595
|
_context.n = 118;
|
|
15572
15596
|
return call(getActiveChannelId);
|
|
@@ -15625,6 +15649,7 @@ function watchForEvents() {
|
|
|
15625
15649
|
case 124:
|
|
15626
15650
|
return _context.a(3, 183);
|
|
15627
15651
|
case 125:
|
|
15652
|
+
console.log('CHANNEL_EVENT_TYPES.POLL_CLOSED ... ');
|
|
15628
15653
|
_channel13 = args.channel, _messageId4 = args.messageId;
|
|
15629
15654
|
_context.n = 126;
|
|
15630
15655
|
return call(getActiveChannelId);
|
|
@@ -19357,7 +19382,7 @@ function sendMessage(action) {
|
|
|
19357
19382
|
messagesToSend.push(messageToSend);
|
|
19358
19383
|
case 12:
|
|
19359
19384
|
_loop2 = /*#__PURE__*/_regenerator().m(function _callee3() {
|
|
19360
|
-
var messageAttachment, messageToSend, messageCopy, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData,
|
|
19385
|
+
var messageAttachment, messageToSend, messageCopy, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, pendingAttachment, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, stringifiedMessageUpdateData, activeChannelId, channelUpdateParam, isErrorResendable, _t;
|
|
19361
19386
|
return _regenerator().w(function (_context3) {
|
|
19362
19387
|
while (1) switch (_context3.p = _context3.n) {
|
|
19363
19388
|
case 0:
|
|
@@ -19459,23 +19484,23 @@ function sendMessage(action) {
|
|
|
19459
19484
|
createdAt: messageResponse.createdAt,
|
|
19460
19485
|
channelId: channel.id
|
|
19461
19486
|
};
|
|
19487
|
+
stringifiedMessageUpdateData = JSON.parse(JSON.stringify(messageUpdateData));
|
|
19462
19488
|
activeChannelId = getActiveChannelId();
|
|
19463
19489
|
if (!(activeChannelId === channel.id)) {
|
|
19464
19490
|
_context3.n = 9;
|
|
19465
19491
|
break;
|
|
19466
19492
|
}
|
|
19467
19493
|
_context3.n = 9;
|
|
19468
|
-
return put(updateMessageAC(messageToSend.tid,
|
|
19494
|
+
return put(updateMessageAC(messageToSend.tid, stringifiedMessageUpdateData, true));
|
|
19469
19495
|
case 9:
|
|
19470
19496
|
_context3.n = 10;
|
|
19471
19497
|
return put(removePendingMessageAC(channel.id, messageToSend.tid));
|
|
19472
19498
|
case 10:
|
|
19473
|
-
addMessageToMap(channel.id,
|
|
19499
|
+
addMessageToMap(channel.id, stringifiedMessageUpdateData);
|
|
19474
19500
|
updateMessageOnAllMessages(messageToSend.tid, messageUpdateData);
|
|
19475
|
-
|
|
19476
|
-
updateChannelLastMessageOnAllChannels(channel.id, messageToUpdate);
|
|
19501
|
+
updateChannelLastMessageOnAllChannels(channel.id, stringifiedMessageUpdateData);
|
|
19477
19502
|
channelUpdateParam = {
|
|
19478
|
-
lastMessage:
|
|
19503
|
+
lastMessage: stringifiedMessageUpdateData,
|
|
19479
19504
|
lastReactedMessage: null
|
|
19480
19505
|
};
|
|
19481
19506
|
if (!channel.unread) {
|
|
@@ -19566,7 +19591,7 @@ function sendMessage(action) {
|
|
|
19566
19591
|
}, _marked$3, null, [[1, 16, 17, 19]]);
|
|
19567
19592
|
}
|
|
19568
19593
|
function sendTextMessage(action) {
|
|
19569
|
-
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend, _messageResponse, messageResponse, messageUpdateData, activeChannelId, messageToUpdate, channelUpdateParam, isErrorResendable, _activeChannelId, _t3;
|
|
19594
|
+
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend, _messageResponse, messageResponse, messageUpdateData, activeChannelId, stringifiedMessageUpdateData, messageToUpdate, channelUpdateParam, isErrorResendable, _activeChannelId, _t3;
|
|
19570
19595
|
return _regenerator().w(function (_context5) {
|
|
19571
19596
|
while (1) switch (_context5.p = _context5.n) {
|
|
19572
19597
|
case 0:
|
|
@@ -19654,7 +19679,7 @@ function sendTextMessage(action) {
|
|
|
19654
19679
|
return call(updateMessage$1, action.type, pendingMessage, channel.id, true, message);
|
|
19655
19680
|
case 8:
|
|
19656
19681
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
19657
|
-
_context5.n =
|
|
19682
|
+
_context5.n = 18;
|
|
19658
19683
|
break;
|
|
19659
19684
|
}
|
|
19660
19685
|
if (!sendMessageHandler) {
|
|
@@ -19698,10 +19723,14 @@ function sendTextMessage(action) {
|
|
|
19698
19723
|
_context5.n = 13;
|
|
19699
19724
|
return put(updateMessageAC(messageToSend.tid, messageUpdateData, true));
|
|
19700
19725
|
case 13:
|
|
19726
|
+
stringifiedMessageUpdateData = JSON.parse(JSON.stringify(messageUpdateData));
|
|
19701
19727
|
_context5.n = 14;
|
|
19702
|
-
return put(
|
|
19728
|
+
return put(updatePendingPollActionAC(messageToSend.tid, stringifiedMessageUpdateData));
|
|
19703
19729
|
case 14:
|
|
19704
|
-
|
|
19730
|
+
_context5.n = 15;
|
|
19731
|
+
return put(removePendingMessageAC(channel.id, messageToSend.tid));
|
|
19732
|
+
case 15:
|
|
19733
|
+
addMessageToMap(channel.id, stringifiedMessageUpdateData);
|
|
19705
19734
|
if (activeChannelId === channel.id) {
|
|
19706
19735
|
updateMessageOnAllMessages(messageToSend.tid, messageUpdateData);
|
|
19707
19736
|
}
|
|
@@ -19711,42 +19740,42 @@ function sendTextMessage(action) {
|
|
|
19711
19740
|
lastMessage: messageToUpdate,
|
|
19712
19741
|
lastReactedMessage: null
|
|
19713
19742
|
};
|
|
19714
|
-
_context5.n =
|
|
19743
|
+
_context5.n = 16;
|
|
19715
19744
|
return put(updateChannelDataAC(channel.id, channelUpdateParam, true));
|
|
19716
|
-
case
|
|
19745
|
+
case 16:
|
|
19717
19746
|
updateChannelOnAllChannels(channel.id, channelUpdateParam);
|
|
19718
19747
|
if (!channel.unread) {
|
|
19719
|
-
_context5.n =
|
|
19748
|
+
_context5.n = 17;
|
|
19720
19749
|
break;
|
|
19721
19750
|
}
|
|
19722
|
-
_context5.n =
|
|
19751
|
+
_context5.n = 17;
|
|
19723
19752
|
return put(markChannelAsReadAC(channel.id));
|
|
19724
|
-
case
|
|
19753
|
+
case 17:
|
|
19725
19754
|
channel.lastMessage = messageToUpdate;
|
|
19726
|
-
_context5.n =
|
|
19755
|
+
_context5.n = 19;
|
|
19727
19756
|
break;
|
|
19728
|
-
case 17:
|
|
19729
|
-
throw new Error('Connection required to send message');
|
|
19730
19757
|
case 18:
|
|
19731
|
-
|
|
19732
|
-
break;
|
|
19758
|
+
throw new Error('Connection required to send message');
|
|
19733
19759
|
case 19:
|
|
19734
|
-
_context5.
|
|
19760
|
+
_context5.n = 23;
|
|
19761
|
+
break;
|
|
19762
|
+
case 20:
|
|
19763
|
+
_context5.p = 20;
|
|
19735
19764
|
_t3 = _context5.v;
|
|
19736
19765
|
log.error('error on send text message ... ', _t3 === null || _t3 === void 0 ? void 0 : _t3.type);
|
|
19737
19766
|
isErrorResendable = isResendableError(_t3 === null || _t3 === void 0 ? void 0 : _t3.type);
|
|
19738
19767
|
if (!(!isErrorResendable && channel.id && sendMessageTid)) {
|
|
19739
|
-
_context5.n =
|
|
19768
|
+
_context5.n = 22;
|
|
19740
19769
|
break;
|
|
19741
19770
|
}
|
|
19742
|
-
_context5.n =
|
|
19771
|
+
_context5.n = 21;
|
|
19743
19772
|
return put(removePendingMessageAC(channel.id, sendMessageTid));
|
|
19744
|
-
case 20:
|
|
19745
|
-
_context5.n = 22;
|
|
19746
|
-
break;
|
|
19747
19773
|
case 21:
|
|
19774
|
+
_context5.n = 23;
|
|
19775
|
+
break;
|
|
19776
|
+
case 22:
|
|
19748
19777
|
if (!(channel.id && sendMessageTid)) {
|
|
19749
|
-
_context5.n =
|
|
19778
|
+
_context5.n = 23;
|
|
19750
19779
|
break;
|
|
19751
19780
|
}
|
|
19752
19781
|
updateMessageOnMap(channel.id, {
|
|
@@ -19757,26 +19786,26 @@ function sendTextMessage(action) {
|
|
|
19757
19786
|
});
|
|
19758
19787
|
_activeChannelId = getActiveChannelId();
|
|
19759
19788
|
if (!(_activeChannelId === channel.id)) {
|
|
19760
|
-
_context5.n =
|
|
19789
|
+
_context5.n = 23;
|
|
19761
19790
|
break;
|
|
19762
19791
|
}
|
|
19763
19792
|
updateMessageOnAllMessages(sendMessageTid, {
|
|
19764
19793
|
state: MESSAGE_STATUS.FAILED
|
|
19765
19794
|
});
|
|
19766
|
-
_context5.n =
|
|
19795
|
+
_context5.n = 23;
|
|
19767
19796
|
return put(updateMessageAC(sendMessageTid, {
|
|
19768
19797
|
state: MESSAGE_STATUS.FAILED
|
|
19769
19798
|
}));
|
|
19770
|
-
case 22:
|
|
19771
|
-
_context5.p = 22;
|
|
19772
|
-
_context5.n = 23;
|
|
19773
|
-
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19774
19799
|
case 23:
|
|
19775
|
-
|
|
19800
|
+
_context5.p = 23;
|
|
19801
|
+
_context5.n = 24;
|
|
19802
|
+
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
19776
19803
|
case 24:
|
|
19804
|
+
return _context5.f(23);
|
|
19805
|
+
case 25:
|
|
19777
19806
|
return _context5.a(2);
|
|
19778
19807
|
}
|
|
19779
|
-
}, _marked2$2, null, [[3,
|
|
19808
|
+
}, _marked2$2, null, [[3, 20, 23, 25]]);
|
|
19780
19809
|
}
|
|
19781
19810
|
function forwardMessage(action) {
|
|
19782
19811
|
var payload, message, channelId, connectionState, isForward, pendingMessage, channel, activeChannelId, messageTid, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, pollDetails, messageToSend, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam, isErrorResendable, _activeChannelId2, _t4;
|
|
@@ -21446,9 +21475,9 @@ function getMessageMarkers(action) {
|
|
|
21446
21475
|
}
|
|
21447
21476
|
}, _marked16$1, null, [[0, 5, 6, 8]]);
|
|
21448
21477
|
}
|
|
21449
|
-
function executeAddPollVote(channelId, pollId, optionId, message
|
|
21478
|
+
function executeAddPollVote(channelId, pollId, optionId, message) {
|
|
21450
21479
|
var _user$presence, _message$pollDetails, _message$pollDetails2, _message$pollDetails3, _message$pollDetails4;
|
|
21451
|
-
var channel, user, vote, objs, _message$pollDetails5, _message$pollDetails6, _message$pollDetails7
|
|
21480
|
+
var channel, user, vote, objs, _message$pollDetails5, _message$pollDetails6, _message$pollDetails7;
|
|
21452
21481
|
return _regenerator().w(function (_context22) {
|
|
21453
21482
|
while (1) switch (_context22.n) {
|
|
21454
21483
|
case 0:
|
|
@@ -21497,38 +21526,16 @@ function executeAddPollVote(channelId, pollId, optionId, message, isResend) {
|
|
|
21497
21526
|
vote: vote,
|
|
21498
21527
|
incrementVotesPerOptionCount: 1
|
|
21499
21528
|
});
|
|
21500
|
-
if (
|
|
21501
|
-
_context22.n =
|
|
21502
|
-
break;
|
|
21503
|
-
}
|
|
21504
|
-
_iterator2 = _createForOfIteratorHelperLoose(objs);
|
|
21505
|
-
case 3:
|
|
21506
|
-
if ((_step2 = _iterator2()).done) {
|
|
21507
|
-
_context22.n = 5;
|
|
21529
|
+
if (!(channel && message.id)) {
|
|
21530
|
+
_context22.n = 4;
|
|
21508
21531
|
break;
|
|
21509
21532
|
}
|
|
21510
|
-
obj = _step2.value;
|
|
21511
|
-
updateMessageOnMap(channel.id, {
|
|
21512
|
-
messageId: message.id,
|
|
21513
|
-
params: {}
|
|
21514
|
-
}, obj);
|
|
21515
|
-
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21516
|
-
_context22.n = 4;
|
|
21517
|
-
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21518
|
-
case 4:
|
|
21519
21533
|
_context22.n = 3;
|
|
21520
|
-
break;
|
|
21521
|
-
case 5:
|
|
21522
|
-
if (!channel) {
|
|
21523
|
-
_context22.n = 7;
|
|
21524
|
-
break;
|
|
21525
|
-
}
|
|
21526
|
-
_context22.n = 6;
|
|
21527
21534
|
return call(channel.addVote, message.id, pollId, [optionId]);
|
|
21528
|
-
case
|
|
21529
|
-
_context22.n =
|
|
21535
|
+
case 3:
|
|
21536
|
+
_context22.n = 4;
|
|
21530
21537
|
return put(removePendingPollActionAC(message.id, 'ADD_POLL_VOTE', optionId));
|
|
21531
|
-
case
|
|
21538
|
+
case 4:
|
|
21532
21539
|
return _context22.a(2);
|
|
21533
21540
|
}
|
|
21534
21541
|
}, _marked17$1);
|
|
@@ -21572,7 +21579,7 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
|
21572
21579
|
}, _marked18$1);
|
|
21573
21580
|
}
|
|
21574
21581
|
function addPollVote(action) {
|
|
21575
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence2,
|
|
21582
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence2, user, vote, pendingAction, conflictCheck, channel, _Object$values, _store$getState$Messa, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj, _t32;
|
|
21576
21583
|
return _regenerator().w(function (_context24) {
|
|
21577
21584
|
while (1) switch (_context24.p = _context24.n) {
|
|
21578
21585
|
case 0:
|
|
@@ -21581,10 +21588,9 @@ function addPollVote(action) {
|
|
|
21581
21588
|
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, message = payload.message, isResend = payload.isResend;
|
|
21582
21589
|
sceytChatClient = getClient();
|
|
21583
21590
|
if (!sceytChatClient) {
|
|
21584
|
-
_context24.n =
|
|
21591
|
+
_context24.n = 6;
|
|
21585
21592
|
break;
|
|
21586
21593
|
}
|
|
21587
|
-
connectionState = sceytChatClient.connectionState;
|
|
21588
21594
|
user = sceytChatClient.user;
|
|
21589
21595
|
vote = {
|
|
21590
21596
|
optionId: optionId,
|
|
@@ -21607,10 +21613,6 @@ function addPollVote(action) {
|
|
|
21607
21613
|
createdAt: new Date().getTime()
|
|
21608
21614
|
}
|
|
21609
21615
|
};
|
|
21610
|
-
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21611
|
-
_context24.n = 6;
|
|
21612
|
-
break;
|
|
21613
|
-
}
|
|
21614
21616
|
pendingAction = {
|
|
21615
21617
|
type: 'ADD_POLL_VOTE',
|
|
21616
21618
|
channelId: channelId,
|
|
@@ -21660,27 +21662,25 @@ function addPollVote(action) {
|
|
|
21660
21662
|
}
|
|
21661
21663
|
return _context24.d(_regeneratorValues(updateMessageOptimisticallyForAddPollVote(channelId, message, vote)), 5);
|
|
21662
21664
|
case 5:
|
|
21663
|
-
if (!conflictCheck.shouldSkip) {
|
|
21665
|
+
if (!conflictCheck.shouldSkip && !isResend) {
|
|
21664
21666
|
setPendingPollAction(pendingAction);
|
|
21665
21667
|
}
|
|
21666
|
-
return _context24.
|
|
21668
|
+
return _context24.d(_regeneratorValues(executeAddPollVote(channelId, pollId, optionId, message)), 6);
|
|
21667
21669
|
case 6:
|
|
21668
|
-
|
|
21669
|
-
case 7:
|
|
21670
|
-
_context24.n = 9;
|
|
21670
|
+
_context24.n = 8;
|
|
21671
21671
|
break;
|
|
21672
|
-
case
|
|
21673
|
-
_context24.p =
|
|
21672
|
+
case 7:
|
|
21673
|
+
_context24.p = 7;
|
|
21674
21674
|
_t32 = _context24.v;
|
|
21675
21675
|
log.error('error in add poll vote', _t32);
|
|
21676
|
-
case
|
|
21676
|
+
case 8:
|
|
21677
21677
|
return _context24.a(2);
|
|
21678
21678
|
}
|
|
21679
|
-
}, _marked19$1, null, [[0,
|
|
21679
|
+
}, _marked19$1, null, [[0, 7]]);
|
|
21680
21680
|
}
|
|
21681
|
-
function executeDeletePollVote(channelId, pollId, optionId, message
|
|
21681
|
+
function executeDeletePollVote(channelId, pollId, optionId, message) {
|
|
21682
21682
|
var _message$pollDetails8, _message$pollDetails9, _message$pollDetails0;
|
|
21683
|
-
var channel, vote
|
|
21683
|
+
var channel, vote;
|
|
21684
21684
|
return _regenerator().w(function (_context25) {
|
|
21685
21685
|
while (1) switch (_context25.n) {
|
|
21686
21686
|
case 0:
|
|
@@ -21703,33 +21703,16 @@ function executeDeletePollVote(channelId, pollId, optionId, message, isResend) {
|
|
|
21703
21703
|
}
|
|
21704
21704
|
return _context25.a(2);
|
|
21705
21705
|
case 3:
|
|
21706
|
-
|
|
21707
|
-
|
|
21708
|
-
vote: vote,
|
|
21709
|
-
incrementVotesPerOptionCount: -1
|
|
21710
|
-
};
|
|
21711
|
-
if (isResend) {
|
|
21712
|
-
_context25.n = 4;
|
|
21706
|
+
if (!(channel && message.id)) {
|
|
21707
|
+
_context25.n = 5;
|
|
21713
21708
|
break;
|
|
21714
21709
|
}
|
|
21715
|
-
updateMessageOnMap(channel.id, {
|
|
21716
|
-
messageId: message.id,
|
|
21717
|
-
params: {}
|
|
21718
|
-
}, obj);
|
|
21719
|
-
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21720
21710
|
_context25.n = 4;
|
|
21721
|
-
return
|
|
21711
|
+
return call(channel.deleteVote, message.id, pollId, [optionId]);
|
|
21722
21712
|
case 4:
|
|
21723
|
-
if (!channel) {
|
|
21724
|
-
_context25.n = 6;
|
|
21725
|
-
break;
|
|
21726
|
-
}
|
|
21727
21713
|
_context25.n = 5;
|
|
21728
|
-
return call(channel.deleteVote, message.id, pollId, [optionId]);
|
|
21729
|
-
case 5:
|
|
21730
|
-
_context25.n = 6;
|
|
21731
21714
|
return put(removePendingPollActionAC(message.id, 'DELETE_POLL_VOTE', optionId));
|
|
21732
|
-
case
|
|
21715
|
+
case 5:
|
|
21733
21716
|
return _context25.a(2);
|
|
21734
21717
|
}
|
|
21735
21718
|
}, _marked20$1);
|
|
@@ -21773,7 +21756,7 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
|
|
|
21773
21756
|
}, _marked21$1);
|
|
21774
21757
|
}
|
|
21775
21758
|
function deletePollVote(action) {
|
|
21776
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11,
|
|
21759
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11, vote, pendingAction, conflictCheck, channel, _Object$values2, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj, _t33;
|
|
21777
21760
|
return _regenerator().w(function (_context27) {
|
|
21778
21761
|
while (1) switch (_context27.p = _context27.n) {
|
|
21779
21762
|
case 0:
|
|
@@ -21782,10 +21765,9 @@ function deletePollVote(action) {
|
|
|
21782
21765
|
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, message = payload.message, isResend = payload.isResend;
|
|
21783
21766
|
sceytChatClient = getClient();
|
|
21784
21767
|
if (!sceytChatClient) {
|
|
21785
|
-
_context27.n =
|
|
21768
|
+
_context27.n = 7;
|
|
21786
21769
|
break;
|
|
21787
21770
|
}
|
|
21788
|
-
connectionState = sceytChatClient.connectionState;
|
|
21789
21771
|
vote = (_message$pollDetails1 = message.pollDetails) === null || _message$pollDetails1 === void 0 ? void 0 : (_message$pollDetails10 = _message$pollDetails1.voteDetails) === null || _message$pollDetails10 === void 0 ? void 0 : (_message$pollDetails11 = _message$pollDetails10.ownVotes) === null || _message$pollDetails11 === void 0 ? void 0 : _message$pollDetails11.find(function (vote) {
|
|
21790
21772
|
return vote.optionId === optionId;
|
|
21791
21773
|
});
|
|
@@ -21795,10 +21777,6 @@ function deletePollVote(action) {
|
|
|
21795
21777
|
}
|
|
21796
21778
|
return _context27.a(2);
|
|
21797
21779
|
case 1:
|
|
21798
|
-
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21799
|
-
_context27.n = 7;
|
|
21800
|
-
break;
|
|
21801
|
-
}
|
|
21802
21780
|
pendingAction = {
|
|
21803
21781
|
type: 'DELETE_POLL_VOTE',
|
|
21804
21782
|
channelId: channelId,
|
|
@@ -21847,23 +21825,21 @@ function deletePollVote(action) {
|
|
|
21847
21825
|
}
|
|
21848
21826
|
return _context27.d(_regeneratorValues(updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)), 6);
|
|
21849
21827
|
case 6:
|
|
21850
|
-
if (!conflictCheck.shouldSkip) {
|
|
21828
|
+
if (!conflictCheck.shouldSkip && !isResend) {
|
|
21851
21829
|
setPendingPollAction(pendingAction);
|
|
21852
21830
|
}
|
|
21853
|
-
return _context27.
|
|
21831
|
+
return _context27.d(_regeneratorValues(executeDeletePollVote(channelId, pollId, optionId, message)), 7);
|
|
21854
21832
|
case 7:
|
|
21855
|
-
|
|
21856
|
-
case 8:
|
|
21857
|
-
_context27.n = 10;
|
|
21833
|
+
_context27.n = 9;
|
|
21858
21834
|
break;
|
|
21859
|
-
case
|
|
21860
|
-
_context27.p =
|
|
21835
|
+
case 8:
|
|
21836
|
+
_context27.p = 8;
|
|
21861
21837
|
_t33 = _context27.v;
|
|
21862
21838
|
log.error('error in delete poll vote', _t33);
|
|
21863
|
-
case
|
|
21839
|
+
case 9:
|
|
21864
21840
|
return _context27.a(2);
|
|
21865
21841
|
}
|
|
21866
|
-
}, _marked22$1, null, [[0,
|
|
21842
|
+
}, _marked22$1, null, [[0, 8]]);
|
|
21867
21843
|
}
|
|
21868
21844
|
function executeClosePoll(channelId, pollId, message) {
|
|
21869
21845
|
var channel, obj;
|
|
@@ -21886,7 +21862,7 @@ function executeClosePoll(channelId, pollId, message) {
|
|
|
21886
21862
|
_context28.n = 2;
|
|
21887
21863
|
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21888
21864
|
case 2:
|
|
21889
|
-
if (!channel) {
|
|
21865
|
+
if (!(channel && message.id)) {
|
|
21890
21866
|
_context28.n = 4;
|
|
21891
21867
|
break;
|
|
21892
21868
|
}
|
|
@@ -21978,7 +21954,7 @@ function closePoll(action) {
|
|
|
21978
21954
|
}, _marked25$1, null, [[0, 4]]);
|
|
21979
21955
|
}
|
|
21980
21956
|
function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
|
|
21981
|
-
var channel,
|
|
21957
|
+
var channel, _iterator2, _step2, obj;
|
|
21982
21958
|
return _regenerator().w(function (_context31) {
|
|
21983
21959
|
while (1) switch (_context31.n) {
|
|
21984
21960
|
case 0:
|
|
@@ -21990,13 +21966,13 @@ function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
|
|
|
21990
21966
|
_context31.n = 4;
|
|
21991
21967
|
break;
|
|
21992
21968
|
}
|
|
21993
|
-
|
|
21969
|
+
_iterator2 = _createForOfIteratorHelperLoose(objs);
|
|
21994
21970
|
case 2:
|
|
21995
|
-
if ((
|
|
21971
|
+
if ((_step2 = _iterator2()).done) {
|
|
21996
21972
|
_context31.n = 4;
|
|
21997
21973
|
break;
|
|
21998
21974
|
}
|
|
21999
|
-
obj =
|
|
21975
|
+
obj = _step2.value;
|
|
22000
21976
|
updateMessageOnMap(channelId, {
|
|
22001
21977
|
messageId: message.id,
|
|
22002
21978
|
params: {}
|
|
@@ -22008,7 +21984,7 @@ function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
|
|
|
22008
21984
|
_context31.n = 2;
|
|
22009
21985
|
break;
|
|
22010
21986
|
case 4:
|
|
22011
|
-
if (!channel) {
|
|
21987
|
+
if (!(channel && message.id)) {
|
|
22012
21988
|
_context31.n = 6;
|
|
22013
21989
|
break;
|
|
22014
21990
|
}
|
|
@@ -22023,7 +21999,7 @@ function executeRetractPollVote(channelId, pollId, message, objs, isResend) {
|
|
|
22023
21999
|
}, _marked26$1);
|
|
22024
22000
|
}
|
|
22025
22001
|
function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs) {
|
|
22026
|
-
var channel,
|
|
22002
|
+
var channel, _iterator3, _step3, obj;
|
|
22027
22003
|
return _regenerator().w(function (_context32) {
|
|
22028
22004
|
while (1) switch (_context32.n) {
|
|
22029
22005
|
case 0:
|
|
@@ -22037,13 +22013,13 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
|
|
|
22037
22013
|
}
|
|
22038
22014
|
return _context32.a(2);
|
|
22039
22015
|
case 2:
|
|
22040
|
-
|
|
22016
|
+
_iterator3 = _createForOfIteratorHelperLoose(objs);
|
|
22041
22017
|
case 3:
|
|
22042
|
-
if ((
|
|
22018
|
+
if ((_step3 = _iterator3()).done) {
|
|
22043
22019
|
_context32.n = 5;
|
|
22044
22020
|
break;
|
|
22045
22021
|
}
|
|
22046
|
-
obj =
|
|
22022
|
+
obj = _step3.value;
|
|
22047
22023
|
updateMessageOnMap(channelId, {
|
|
22048
22024
|
messageId: message.id,
|
|
22049
22025
|
params: {}
|
|
@@ -22060,7 +22036,7 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
|
|
|
22060
22036
|
}, _marked27$1);
|
|
22061
22037
|
}
|
|
22062
22038
|
function retractPollVote(action) {
|
|
22063
|
-
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs,
|
|
22039
|
+
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator4, _step4, _message$pollDetails12, _message$pollDetails13, vote, _t35;
|
|
22064
22040
|
return _regenerator().w(function (_context33) {
|
|
22065
22041
|
while (1) switch (_context33.p = _context33.n) {
|
|
22066
22042
|
case 0:
|
|
@@ -22074,8 +22050,8 @@ function retractPollVote(action) {
|
|
|
22074
22050
|
}
|
|
22075
22051
|
connectionState = sceytChatClient.connectionState;
|
|
22076
22052
|
objs = [];
|
|
22077
|
-
for (
|
|
22078
|
-
vote =
|
|
22053
|
+
for (_iterator4 = _createForOfIteratorHelperLoose(((_message$pollDetails12 = message.pollDetails) === null || _message$pollDetails12 === void 0 ? void 0 : (_message$pollDetails13 = _message$pollDetails12.voteDetails) === null || _message$pollDetails13 === void 0 ? void 0 : _message$pollDetails13.ownVotes) || []); !(_step4 = _iterator4()).done;) {
|
|
22054
|
+
vote = _step4.value;
|
|
22079
22055
|
objs.push({
|
|
22080
22056
|
type: 'deleteOwn',
|
|
22081
22057
|
vote: vote,
|