sceyt-chat-react-uikit 1.7.5-beta.18 → 1.7.5-beta.19
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 +593 -576
- package/index.modern.js +593 -576
- package/package.json +1 -1
- package/types/index.d.ts +2 -2
package/index.modern.js
CHANGED
|
@@ -8957,21 +8957,59 @@ var EditorTheme = {
|
|
|
8957
8957
|
var isMessageUnsupported = function isMessageUnsupported(message) {
|
|
8958
8958
|
return (message === null || message === void 0 ? void 0 : message.type) !== MESSAGE_TYPE.TEXT && (message === null || message === void 0 ? void 0 : message.type) !== MESSAGE_TYPE.MEDIA && (message === null || message === void 0 ? void 0 : message.type) !== MESSAGE_TYPE.FILE && (message === null || message === void 0 ? void 0 : message.type) !== MESSAGE_TYPE.LINK && (message === null || message === void 0 ? void 0 : message.type) !== MESSAGE_TYPE.POLL && (message === null || message === void 0 ? void 0 : message.type) !== MESSAGE_TYPE.DELETED && (message === null || message === void 0 ? void 0 : message.type) !== MESSAGE_TYPE.SYSTEM;
|
|
8959
8959
|
};
|
|
8960
|
-
var
|
|
8960
|
+
var deleteVoteFromPollDetails = function deleteVoteFromPollDetails(votes, deletedVote) {
|
|
8961
8961
|
var newVotes = [];
|
|
8962
|
-
var
|
|
8962
|
+
for (var _iterator = _createForOfIteratorHelperLoose(votes), _step; !(_step = _iterator()).done;) {
|
|
8963
8963
|
var vote = _step.value;
|
|
8964
|
-
if (
|
|
8965
|
-
return deletedVote.optionId === vote.optionId && deletedVote.user.id === vote.user.id;
|
|
8966
|
-
})) {
|
|
8964
|
+
if (deletedVote.optionId !== vote.optionId || deletedVote.user.id !== vote.user.id) {
|
|
8967
8965
|
newVotes.push(vote);
|
|
8968
8966
|
}
|
|
8969
|
-
};
|
|
8970
|
-
for (var _iterator = _createForOfIteratorHelperLoose(votes), _step; !(_step = _iterator()).done;) {
|
|
8971
|
-
_loop();
|
|
8972
8967
|
}
|
|
8973
8968
|
return newVotes;
|
|
8974
8969
|
};
|
|
8970
|
+
var handleVoteDetails = function handleVoteDetails(voteDetails, message) {
|
|
8971
|
+
var _extends2;
|
|
8972
|
+
if (!voteDetails || !(message !== null && message !== void 0 && message.pollDetails)) {
|
|
8973
|
+
return undefined;
|
|
8974
|
+
}
|
|
8975
|
+
var existingPollDetails = message.pollDetails;
|
|
8976
|
+
var existingVoteDetails = existingPollDetails.voteDetails || {
|
|
8977
|
+
votesPerOption: {},
|
|
8978
|
+
votes: [],
|
|
8979
|
+
ownVotes: []
|
|
8980
|
+
};
|
|
8981
|
+
if (voteDetails.type === 'close') {
|
|
8982
|
+
return _extends({}, existingPollDetails, {
|
|
8983
|
+
closed: true
|
|
8984
|
+
});
|
|
8985
|
+
}
|
|
8986
|
+
if (!voteDetails.vote) {
|
|
8987
|
+
return existingPollDetails;
|
|
8988
|
+
}
|
|
8989
|
+
var vote = voteDetails.vote;
|
|
8990
|
+
var optionId = vote.optionId;
|
|
8991
|
+
var currentVotesPerOption = existingVoteDetails.votesPerOption || {};
|
|
8992
|
+
var newVotesPerOption = _extends({}, currentVotesPerOption, (_extends2 = {}, _extends2[optionId] = (currentVotesPerOption[optionId] || 0) + voteDetails.incrementVotesPerOptionCount, _extends2));
|
|
8993
|
+
var newVotes = existingVoteDetails.votes || [];
|
|
8994
|
+
var newOwnVotes = existingVoteDetails.ownVotes || [];
|
|
8995
|
+
if (voteDetails.type === 'add') {
|
|
8996
|
+
newVotes = [].concat(newVotes, [vote]);
|
|
8997
|
+
} else if (voteDetails.type === 'delete') {
|
|
8998
|
+
newVotes = deleteVoteFromPollDetails(newVotes, vote);
|
|
8999
|
+
} else if (voteDetails.type === 'addOwn') {
|
|
9000
|
+
newOwnVotes = [].concat(newOwnVotes, [vote]);
|
|
9001
|
+
} else if (voteDetails.type === 'deleteOwn') {
|
|
9002
|
+
newOwnVotes = deleteVoteFromPollDetails(newOwnVotes, vote);
|
|
9003
|
+
}
|
|
9004
|
+
var newVoteDetails = {
|
|
9005
|
+
votesPerOption: newVotesPerOption,
|
|
9006
|
+
votes: newVotes,
|
|
9007
|
+
ownVotes: newOwnVotes
|
|
9008
|
+
};
|
|
9009
|
+
return _extends({}, existingPollDetails, {
|
|
9010
|
+
voteDetails: newVoteDetails
|
|
9011
|
+
});
|
|
9012
|
+
};
|
|
8975
9013
|
|
|
8976
9014
|
var baseUrlForInviteMembers = '';
|
|
8977
9015
|
var autoSelectFitsChannel = false;
|
|
@@ -10026,35 +10064,13 @@ var addAllMessages = function addAllMessages(messages, direction) {
|
|
|
10026
10064
|
var updateMessageOnAllMessages = function updateMessageOnAllMessages(messageId, updatedParams, voteDetails) {
|
|
10027
10065
|
activeChannelAllMessages = activeChannelAllMessages.map(function (message) {
|
|
10028
10066
|
if (message.tid === messageId || message.id === messageId) {
|
|
10029
|
-
var _message$pollDetails$;
|
|
10030
10067
|
if (updatedParams.state === MESSAGE_STATUS.DELETE) {
|
|
10031
10068
|
return _extends({}, updatedParams);
|
|
10032
10069
|
}
|
|
10033
|
-
var updatedMessage = _extends({}, message, updatedParams
|
|
10034
|
-
|
|
10035
|
-
voteDetails: _extends({}, message.pollDetails.voteDetails, {
|
|
10036
|
-
votes: [].concat(((_message$pollDetails$ = message.pollDetails.voteDetails) === null || _message$pollDetails$ === void 0 ? void 0 : _message$pollDetails$.votes) || [], voteDetails.votes),
|
|
10037
|
-
votesPerOption: voteDetails.votesPerOption
|
|
10038
|
-
})
|
|
10039
|
-
})
|
|
10040
|
-
} : {});
|
|
10041
|
-
if (voteDetails && voteDetails.deletedVotes && updatedMessage.pollDetails) {
|
|
10042
|
-
var _updatedMessage$pollD;
|
|
10043
|
-
updatedMessage = _extends({}, updatedMessage, {
|
|
10044
|
-
pollDetails: _extends({}, updatedMessage.pollDetails, {
|
|
10045
|
-
voteDetails: _extends({}, updatedMessage.pollDetails.voteDetails, {
|
|
10046
|
-
votes: deleteVotesFromPollDetails(((_updatedMessage$pollD = updatedMessage.pollDetails.voteDetails) === null || _updatedMessage$pollD === void 0 ? void 0 : _updatedMessage$pollD.votes) || [], voteDetails.deletedVotes),
|
|
10047
|
-
votesPerOption: voteDetails.votesPerOption
|
|
10048
|
-
})
|
|
10049
|
-
})
|
|
10050
|
-
});
|
|
10051
|
-
}
|
|
10052
|
-
if (voteDetails && voteDetails.closed && updatedMessage.pollDetails) {
|
|
10070
|
+
var updatedMessage = _extends({}, message, updatedParams);
|
|
10071
|
+
if (voteDetails) {
|
|
10053
10072
|
updatedMessage = _extends({}, updatedMessage, {
|
|
10054
|
-
pollDetails:
|
|
10055
|
-
voteDetails: _extends({}, updatedMessage.pollDetails.voteDetails),
|
|
10056
|
-
closed: voteDetails.closed
|
|
10057
|
-
})
|
|
10073
|
+
pollDetails: handleVoteDetails(voteDetails, updatedMessage)
|
|
10058
10074
|
});
|
|
10059
10075
|
}
|
|
10060
10076
|
return updatedMessage;
|
|
@@ -10176,34 +10192,14 @@ function updateMessageOnMap(channelId, updatedMessage, voteDetails) {
|
|
|
10176
10192
|
messagesList.push(_extends({}, mes, updatedMessageData));
|
|
10177
10193
|
continue;
|
|
10178
10194
|
} else {
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
votes: [].concat(((_mes$pollDetails$vote = mes.pollDetails.voteDetails) === null || _mes$pollDetails$vote === void 0 ? void 0 : _mes$pollDetails$vote.votes) || [], voteDetails.votes),
|
|
10184
|
-
votesPerOption: voteDetails.votesPerOption
|
|
10185
|
-
})
|
|
10186
|
-
})
|
|
10187
|
-
} : {});
|
|
10188
|
-
if (voteDetails && voteDetails.deletedVotes && updatedMessageData.pollDetails) {
|
|
10189
|
-
var _updatedMessageData$p;
|
|
10190
|
-
updatedMessageData = _extends({}, updatedMessageData, {
|
|
10191
|
-
pollDetails: _extends({}, updatedMessageData.pollDetails, {
|
|
10192
|
-
voteDetails: _extends({}, updatedMessageData.pollDetails.voteDetails, {
|
|
10193
|
-
votes: deleteVotesFromPollDetails((_updatedMessageData$p = updatedMessageData.pollDetails.voteDetails) === null || _updatedMessageData$p === void 0 ? void 0 : _updatedMessageData$p.votes, voteDetails.deletedVotes),
|
|
10194
|
-
votesPerOption: voteDetails.votesPerOption
|
|
10195
|
-
})
|
|
10196
|
-
})
|
|
10197
|
-
});
|
|
10198
|
-
}
|
|
10199
|
-
if (voteDetails && voteDetails.closed && updatedMessageData.pollDetails) {
|
|
10200
|
-
updatedMessageData = _extends({}, updatedMessageData, {
|
|
10201
|
-
pollDetails: _extends({}, updatedMessageData.pollDetails, {
|
|
10202
|
-
voteDetails: _extends({}, updatedMessageData.pollDetails.voteDetails),
|
|
10203
|
-
closed: voteDetails.closed
|
|
10204
|
-
})
|
|
10205
|
-
});
|
|
10195
|
+
updatedMessageData = _extends({}, mes, updatedMessage.params);
|
|
10196
|
+
var voteDetailsData = void 0;
|
|
10197
|
+
if (voteDetails) {
|
|
10198
|
+
voteDetailsData = handleVoteDetails(voteDetails, updatedMessageData);
|
|
10206
10199
|
}
|
|
10200
|
+
updatedMessageData = _extends({}, updatedMessageData, {
|
|
10201
|
+
pollDetails: voteDetailsData
|
|
10202
|
+
});
|
|
10207
10203
|
messagesList.push(_extends({}, mes, updatedMessageData));
|
|
10208
10204
|
continue;
|
|
10209
10205
|
}
|
|
@@ -11240,38 +11236,10 @@ var messageSlice = createSlice({
|
|
|
11240
11236
|
if (params.state === MESSAGE_STATUS.DELETE) {
|
|
11241
11237
|
return _extends({}, params);
|
|
11242
11238
|
} else {
|
|
11243
|
-
var
|
|
11244
|
-
|
|
11245
|
-
pollDetails: _extends({}, message.pollDetails, {
|
|
11246
|
-
voteDetails: _extends({}, message.pollDetails.voteDetails, {
|
|
11247
|
-
votes: [].concat(((_message$pollDetails$ = message.pollDetails.voteDetails) === null || _message$pollDetails$ === void 0 ? void 0 : _message$pollDetails$.votes) || [], voteDetails.votes),
|
|
11248
|
-
votesPerOption: voteDetails.votesPerOption
|
|
11249
|
-
})
|
|
11250
|
-
})
|
|
11251
|
-
} : {});
|
|
11252
|
-
if (voteDetails && voteDetails.deletedVotes && messageData.pollDetails && messageData.pollDetails.voteDetails) {
|
|
11253
|
-
var _messageData$pollDeta;
|
|
11254
|
-
messageData = _extends({}, messageData, {
|
|
11255
|
-
pollDetails: _extends({}, messageData.pollDetails, {
|
|
11256
|
-
voteDetails: _extends({}, messageData.pollDetails.voteDetails, {
|
|
11257
|
-
votes: deleteVotesFromPollDetails(((_messageData$pollDeta = messageData.pollDetails.voteDetails) === null || _messageData$pollDeta === void 0 ? void 0 : _messageData$pollDeta.votes) || [], voteDetails.deletedVotes),
|
|
11258
|
-
votesPerOption: voteDetails.votesPerOption || {}
|
|
11259
|
-
})
|
|
11260
|
-
})
|
|
11261
|
-
});
|
|
11262
|
-
}
|
|
11263
|
-
if (voteDetails && voteDetails.closed && messageData.pollDetails) {
|
|
11264
|
-
var existingVoteDetails = messageData.pollDetails.voteDetails;
|
|
11265
|
-
var newVoteDetails = {
|
|
11266
|
-
votesPerOption: (existingVoteDetails === null || existingVoteDetails === void 0 ? void 0 : existingVoteDetails.votesPerOption) || {},
|
|
11267
|
-
votes: (existingVoteDetails === null || existingVoteDetails === void 0 ? void 0 : existingVoteDetails.votes) || [],
|
|
11268
|
-
ownVotes: (existingVoteDetails === null || existingVoteDetails === void 0 ? void 0 : existingVoteDetails.ownVotes) || []
|
|
11269
|
-
};
|
|
11239
|
+
var messageData = _extends({}, message, params);
|
|
11240
|
+
if (voteDetails) {
|
|
11270
11241
|
messageData = _extends({}, messageData, {
|
|
11271
|
-
pollDetails:
|
|
11272
|
-
voteDetails: newVoteDetails,
|
|
11273
|
-
closed: voteDetails.closed
|
|
11274
|
-
})
|
|
11242
|
+
pollDetails: handleVoteDetails(voteDetails, messageData)
|
|
11275
11243
|
});
|
|
11276
11244
|
}
|
|
11277
11245
|
if (messageData.deliveryStatus !== MESSAGE_DELIVERY_STATUS.PENDING) {
|
|
@@ -14353,7 +14321,7 @@ function watchForEvents() {
|
|
|
14353
14321
|
};
|
|
14354
14322
|
});
|
|
14355
14323
|
_loop = /*#__PURE__*/_regenerator().m(function _callee() {
|
|
14356
|
-
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, activeChannelMessages, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _pollDetailsData$chan, _pollDetailsData$chan2,
|
|
14324
|
+
var _yield$take, type, args, createdChannel, channelFilterTypes, getFromContacts, channelExists, _chan, channel, _chan2, _channel, member, _channelExists, _activeChannelId, groupName, updateChannelData, _channel2, _channelExists2, _channel3, removedMembers, _activeChannelId2, _channelExists3, activeChannel, _updateChannelData, _groupName, _channel4, addedMembers, _activeChannelId3, _channelExists4, _updateChannelData2, _groupName2, updatedChannel, _channelExists5, subject, avatarUrl, muted, mutedTill, metadata, _activeChannelId4, _groupName3, _channel5, message, messageToHandle, _channelFilterTypes, _activeChannelId5, _channelExists6, channelForAdd, hasNextMessage, _groupName4, showNotifications, tabIsActive, _state$ThemeReducer$n, _state$ThemeReducer$n2, _state$ThemeReducer$n3, _state$ThemeReducer$n4, _state$ThemeReducer$n5, _state$ThemeReducer$n6, contactsMap, _getFromContacts, state, theme, accentColor, textSecondary, messageBody, channelId, markerList, _channel6, _activeChannelId6, updateLastMessage, markersMap, activeChannelMessages, lastMessage, _channelId, _channel7, _channel8, deletedMessage, _activeChannelId7, _channelExists7, _channel9, _message, _activeChannelId8, _channelExists8, _channel0, user, _message2, reaction, isSelf, _activeChannelId9, _state$ThemeReducer$n7, _state$ThemeReducer$n8, _state$ThemeReducer$n9, _state$ThemeReducer$n0, _state$ThemeReducer$n1, _state$ThemeReducer$n10, _contactsMap, _getFromContacts2, _state, _theme, _accentColor, _textSecondary, _messageBody, channelUpdateParams, _pollDetailsData$chan, _pollDetailsData$chan2, _channel1, pollDetails, messageId, pollDetailsData, _activeChannelId0, addedVotes, deletedVotes, objs, _iterator, _step, vote, _iterator2, _step2, _vote, _i, _objs, obj, _store$getState$Messa, key, hasNext, _i2, _objs2, _obj, _pollDetailsData$chan3, _channel10, _pollDetails, _messageId, _pollDetailsData, _activeChannelId1, _deletedVotes, _objs3, _iterator3, _step3, _vote2, _i3, _objs4, _obj2, _i4, _objs5, _obj3, _pollDetailsData2$cha, _channel11, _pollDetails2, _messageId2, _activeChannelId10, _pollDetailsData2, retractedVotes, _objs6, _iterator4, _step4, _vote4, _i5, _objs7, _obj4, _iterator5, _step5, _vote3, _channel12, _messageId3, _activeChannelId11, _obj5, _channel13, _user, _message3, _reaction, channelFromMap, _isSelf, _activeChannelId12, _channelUpdateParams, _channel14, _updatedChannel, _channel15, _activeChannelId13, channelExist, _channel16, _channel17, _channel18, _channel19, _channel20, _channel21, _channel22, _groupName5, _channel23, _groupName6, _channel24, members, _activeChannelId14, i, _channel25, _channel26, _channelId2, from, name, status, _t, _t2;
|
|
14357
14325
|
return _regenerator().w(function (_context) {
|
|
14358
14326
|
while (1) switch (_context.p = _context.n) {
|
|
14359
14327
|
case 0:
|
|
@@ -14365,7 +14333,7 @@ function watchForEvents() {
|
|
|
14365
14333
|
type = _yield$take.type;
|
|
14366
14334
|
args = _yield$take.args;
|
|
14367
14335
|
_t = type;
|
|
14368
|
-
_context.n = _t === CHANNEL_EVENT_TYPES.CREATE ? 2 : _t === CHANNEL_EVENT_TYPES.JOIN ? 7 : _t === CHANNEL_EVENT_TYPES.LEAVE ? 9 : _t === CHANNEL_EVENT_TYPES.BLOCK ? 22 : _t === CHANNEL_EVENT_TYPES.UNBLOCK ? 24 : _t === CHANNEL_EVENT_TYPES.KICK_MEMBERS ? 25 : _t === CHANNEL_EVENT_TYPES.ADD_MEMBERS ? 36 : _t === CHANNEL_EVENT_TYPES.UPDATE_CHANNEL ? 46 : _t === CHANNEL_EVENT_TYPES.MESSAGE ? 51 : _t === CHANNEL_EVENT_TYPES.MESSAGE_MARKERS_RECEIVED ? 68 : _t === CHANNEL_EVENT_TYPES.DELETE ? 75 : _t === CHANNEL_EVENT_TYPES.DELETE_MESSAGE ? 77 : _t === CHANNEL_EVENT_TYPES.EDIT_MESSAGE ? 82 : _t === CHANNEL_EVENT_TYPES.REACTION_ADDED ? 87 : _t === CHANNEL_EVENT_TYPES.POLL_ADDED ? 95 : _t === CHANNEL_EVENT_TYPES.POLL_DELETED ?
|
|
14336
|
+
_context.n = _t === CHANNEL_EVENT_TYPES.CREATE ? 2 : _t === CHANNEL_EVENT_TYPES.JOIN ? 7 : _t === CHANNEL_EVENT_TYPES.LEAVE ? 9 : _t === CHANNEL_EVENT_TYPES.BLOCK ? 22 : _t === CHANNEL_EVENT_TYPES.UNBLOCK ? 24 : _t === CHANNEL_EVENT_TYPES.KICK_MEMBERS ? 25 : _t === CHANNEL_EVENT_TYPES.ADD_MEMBERS ? 36 : _t === CHANNEL_EVENT_TYPES.UPDATE_CHANNEL ? 46 : _t === CHANNEL_EVENT_TYPES.MESSAGE ? 51 : _t === CHANNEL_EVENT_TYPES.MESSAGE_MARKERS_RECEIVED ? 68 : _t === CHANNEL_EVENT_TYPES.DELETE ? 75 : _t === CHANNEL_EVENT_TYPES.DELETE_MESSAGE ? 77 : _t === CHANNEL_EVENT_TYPES.EDIT_MESSAGE ? 82 : _t === CHANNEL_EVENT_TYPES.REACTION_ADDED ? 87 : _t === CHANNEL_EVENT_TYPES.POLL_ADDED ? 95 : _t === CHANNEL_EVENT_TYPES.POLL_DELETED ? 105 : _t === CHANNEL_EVENT_TYPES.POLL_RETRACTED ? 113 : _t === CHANNEL_EVENT_TYPES.POLL_CLOSED ? 121 : _t === CHANNEL_EVENT_TYPES.REACTION_DELETED ? 125 : _t === CHANNEL_EVENT_TYPES.UNREAD_MESSAGES_INFO ? 130 : _t === CHANNEL_EVENT_TYPES.CLEAR_HISTORY ? 133 : _t === CHANNEL_EVENT_TYPES.MUTE ? 139 : _t === CHANNEL_EVENT_TYPES.UNMUTE ? 141 : _t === CHANNEL_EVENT_TYPES.PINED ? 143 : _t === CHANNEL_EVENT_TYPES.UNPINED ? 145 : _t === CHANNEL_EVENT_TYPES.HIDE ? 147 : _t === CHANNEL_EVENT_TYPES.UNHIDE ? 149 : _t === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_UNREAD ? 151 : _t === CHANNEL_EVENT_TYPES.CHANNEL_MARKED_AS_READ ? 154 : _t === CHANNEL_EVENT_TYPES.CHANGE_ROLE ? 157 : _t === CHANNEL_EVENT_TYPES.FROZEN ? 164 : _t === CHANNEL_EVENT_TYPES.UNFROZEN ? 165 : _t === CHANNEL_EVENT_TYPES.CHANNEL_EVENT ? 166 : _t === CONNECTION_EVENT_TYPES.CONNECTION_STATUS_CHANGED ? 175 : 178;
|
|
14369
14337
|
break;
|
|
14370
14338
|
case 2:
|
|
14371
14339
|
createdChannel = args.createdChannel;
|
|
@@ -14399,7 +14367,7 @@ function watchForEvents() {
|
|
|
14399
14367
|
addChannelToAllChannels(createdChannel);
|
|
14400
14368
|
}
|
|
14401
14369
|
case 6:
|
|
14402
|
-
return _context.a(3,
|
|
14370
|
+
return _context.a(3, 179);
|
|
14403
14371
|
case 7:
|
|
14404
14372
|
channel = args.channel;
|
|
14405
14373
|
log.info('channel JOIN ... . ', channel);
|
|
@@ -14410,7 +14378,7 @@ function watchForEvents() {
|
|
|
14410
14378
|
if (!_chan2) {
|
|
14411
14379
|
addChannelToAllChannels(channel);
|
|
14412
14380
|
}
|
|
14413
|
-
return _context.a(3,
|
|
14381
|
+
return _context.a(3, 179);
|
|
14414
14382
|
case 9:
|
|
14415
14383
|
_channel = args.channel, member = args.member;
|
|
14416
14384
|
log.info('channel LEAVE ... ', _channel, member);
|
|
@@ -14478,7 +14446,7 @@ function watchForEvents() {
|
|
|
14478
14446
|
mutedTill: _channel.mutedTill
|
|
14479
14447
|
});
|
|
14480
14448
|
case 21:
|
|
14481
|
-
return _context.a(3,
|
|
14449
|
+
return _context.a(3, 179);
|
|
14482
14450
|
case 22:
|
|
14483
14451
|
log.info('channel BLOCK ... ');
|
|
14484
14452
|
_channel2 = args.channel;
|
|
@@ -14490,10 +14458,10 @@ function watchForEvents() {
|
|
|
14490
14458
|
_context.n = 23;
|
|
14491
14459
|
return put(removeChannelAC(_channel2.id));
|
|
14492
14460
|
case 23:
|
|
14493
|
-
return _context.a(3,
|
|
14461
|
+
return _context.a(3, 179);
|
|
14494
14462
|
case 24:
|
|
14495
14463
|
log.info('channel UNBLOCK ... ');
|
|
14496
|
-
return _context.a(3,
|
|
14464
|
+
return _context.a(3, 179);
|
|
14497
14465
|
case 25:
|
|
14498
14466
|
_channel3 = args.channel, removedMembers = args.removedMembers;
|
|
14499
14467
|
log.info('channel KICK_MEMBERS ... ', removedMembers);
|
|
@@ -14563,7 +14531,7 @@ function watchForEvents() {
|
|
|
14563
14531
|
muted: _channel3.muted,
|
|
14564
14532
|
mutedTill: _channel3.mutedTill
|
|
14565
14533
|
});
|
|
14566
|
-
return _context.a(3,
|
|
14534
|
+
return _context.a(3, 179);
|
|
14567
14535
|
case 36:
|
|
14568
14536
|
_channel4 = args.channel, addedMembers = args.addedMembers;
|
|
14569
14537
|
log.info('channel ADD_MEMBERS ... ', addedMembers);
|
|
@@ -14618,7 +14586,7 @@ function watchForEvents() {
|
|
|
14618
14586
|
muted: _channel4.muted,
|
|
14619
14587
|
mutedTill: _channel4.mutedTill
|
|
14620
14588
|
});
|
|
14621
|
-
return _context.a(3,
|
|
14589
|
+
return _context.a(3, 179);
|
|
14622
14590
|
case 46:
|
|
14623
14591
|
log.info('channel UPDATE_CHANNEL ... ');
|
|
14624
14592
|
updatedChannel = args.updatedChannel;
|
|
@@ -14665,7 +14633,7 @@ function watchForEvents() {
|
|
|
14665
14633
|
mutedTill: mutedTill,
|
|
14666
14634
|
metadata: isJSON(metadata) ? JSON.parse(metadata) : metadata
|
|
14667
14635
|
});
|
|
14668
|
-
return _context.a(3,
|
|
14636
|
+
return _context.a(3, 179);
|
|
14669
14637
|
case 51:
|
|
14670
14638
|
_channel5 = args.channel, message = args.message;
|
|
14671
14639
|
log.info('channel MESSAGE ... id : ', message.id, ', channel.id: ', _channel5.id);
|
|
@@ -14830,7 +14798,7 @@ function watchForEvents() {
|
|
|
14830
14798
|
});
|
|
14831
14799
|
updateChannelLastMessageOnAllChannels(_channel5.id, _channel5.lastMessage);
|
|
14832
14800
|
case 67:
|
|
14833
|
-
return _context.a(3,
|
|
14801
|
+
return _context.a(3, 179);
|
|
14834
14802
|
case 68:
|
|
14835
14803
|
channelId = args.channelId, markerList = args.markerList;
|
|
14836
14804
|
_context.n = 69;
|
|
@@ -14900,7 +14868,7 @@ function watchForEvents() {
|
|
|
14900
14868
|
_context.n = 74;
|
|
14901
14869
|
return put(updateMessagesMarkersAC(channelId, markerList.name, markerList));
|
|
14902
14870
|
case 74:
|
|
14903
|
-
return _context.a(3,
|
|
14871
|
+
return _context.a(3, 179);
|
|
14904
14872
|
case 75:
|
|
14905
14873
|
_channelId = args.channelId;
|
|
14906
14874
|
log.info('channel DELETE ... ');
|
|
@@ -14909,7 +14877,7 @@ function watchForEvents() {
|
|
|
14909
14877
|
return put(setChannelToRemoveAC(_channel7));
|
|
14910
14878
|
case 76:
|
|
14911
14879
|
deleteChannelFromAllChannels(_channelId);
|
|
14912
|
-
return _context.a(3,
|
|
14880
|
+
return _context.a(3, 179);
|
|
14913
14881
|
case 77:
|
|
14914
14882
|
_channel8 = args.channel, deletedMessage = args.deletedMessage;
|
|
14915
14883
|
_context.n = 78;
|
|
@@ -14953,7 +14921,7 @@ function watchForEvents() {
|
|
|
14953
14921
|
muted: _channel8.muted,
|
|
14954
14922
|
mutedTill: _channel8.mutedTill
|
|
14955
14923
|
}, deletedMessage);
|
|
14956
|
-
return _context.a(3,
|
|
14924
|
+
return _context.a(3, 179);
|
|
14957
14925
|
case 82:
|
|
14958
14926
|
_channel9 = args.channel, _message = args.message;
|
|
14959
14927
|
_context.n = 83;
|
|
@@ -15002,7 +14970,7 @@ function watchForEvents() {
|
|
|
15002
14970
|
});
|
|
15003
14971
|
}
|
|
15004
14972
|
updateChannelOnAllChannels(_channel9.id, {}, _message);
|
|
15005
|
-
return _context.a(3,
|
|
14973
|
+
return _context.a(3, 179);
|
|
15006
14974
|
case 87:
|
|
15007
14975
|
_channel0 = args.channel, user = args.user, _message2 = args.message, reaction = args.reaction;
|
|
15008
14976
|
isSelf = user.id === SceytChatClient.user.id;
|
|
@@ -15079,7 +15047,7 @@ function watchForEvents() {
|
|
|
15079
15047
|
if (checkChannelExistsOnMessagesMap(_channel0.id)) {
|
|
15080
15048
|
addReactionToMessageOnMap(_channel0.id, _message2, reaction, true);
|
|
15081
15049
|
}
|
|
15082
|
-
return _context.a(3,
|
|
15050
|
+
return _context.a(3, 179);
|
|
15083
15051
|
case 95:
|
|
15084
15052
|
_channel1 = args.channel, pollDetails = args.pollDetails, messageId = args.messageId;
|
|
15085
15053
|
pollDetailsData = pollDetails;
|
|
@@ -15089,202 +15057,261 @@ function watchForEvents() {
|
|
|
15089
15057
|
_activeChannelId0 = _context.v;
|
|
15090
15058
|
addedVotes = (pollDetailsData === null || pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan = pollDetailsData.changedVotes) === null || _pollDetailsData$chan === void 0 ? void 0 : _pollDetailsData$chan.addedVotes) || [];
|
|
15091
15059
|
deletedVotes = (pollDetailsData === null || pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan2 = pollDetailsData.changedVotes) === null || _pollDetailsData$chan2 === void 0 ? void 0 : _pollDetailsData$chan2.removedVotes) || [];
|
|
15092
|
-
|
|
15093
|
-
|
|
15094
|
-
|
|
15095
|
-
|
|
15096
|
-
|
|
15097
|
-
|
|
15098
|
-
|
|
15060
|
+
objs = [];
|
|
15061
|
+
for (_iterator = _createForOfIteratorHelperLoose(deletedVotes); !(_step = _iterator()).done;) {
|
|
15062
|
+
vote = _step.value;
|
|
15063
|
+
objs.push({
|
|
15064
|
+
type: vote.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15065
|
+
vote: vote,
|
|
15066
|
+
incrementVotesPerOptionCount: -((deletedVotes === null || deletedVotes === void 0 ? void 0 : deletedVotes.length) || 0)
|
|
15067
|
+
});
|
|
15068
|
+
}
|
|
15069
|
+
for (_iterator2 = _createForOfIteratorHelperLoose(addedVotes); !(_step2 = _iterator2()).done;) {
|
|
15070
|
+
_vote = _step2.value;
|
|
15071
|
+
objs.push({
|
|
15072
|
+
type: _vote.user.id === SceytChatClient.user.id ? 'addOwn' : 'add',
|
|
15073
|
+
vote: _vote,
|
|
15074
|
+
incrementVotesPerOptionCount: (addedVotes === null || addedVotes === void 0 ? void 0 : addedVotes.length) || 0
|
|
15075
|
+
});
|
|
15076
|
+
}
|
|
15077
|
+
_i = 0, _objs = objs;
|
|
15078
|
+
case 97:
|
|
15079
|
+
if (!(_i < _objs.length)) {
|
|
15080
|
+
_context.n = 101;
|
|
15081
|
+
break;
|
|
15082
|
+
}
|
|
15083
|
+
obj = _objs[_i];
|
|
15084
|
+
if (!(pollDetailsData !== null && pollDetailsData !== void 0 && pollDetailsData.id && obj.vote)) {
|
|
15085
|
+
_context.n = 100;
|
|
15099
15086
|
break;
|
|
15100
15087
|
}
|
|
15101
|
-
key = pollDetailsData.id + "_" +
|
|
15088
|
+
key = pollDetailsData.id + "_" + obj.vote.optionId;
|
|
15102
15089
|
hasNext = ((_store$getState$Messa = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa === void 0 ? void 0 : _store$getState$Messa[key]) || false;
|
|
15103
|
-
|
|
15104
|
-
case 97:
|
|
15105
|
-
if ((_step = _iterator()).done) {
|
|
15090
|
+
if (!(obj.type === 'addOwn')) {
|
|
15106
15091
|
_context.n = 99;
|
|
15107
15092
|
break;
|
|
15108
15093
|
}
|
|
15109
|
-
vote = _step.value;
|
|
15110
15094
|
_context.n = 98;
|
|
15111
|
-
return put(addPollVotesToListAC(pollDetailsData.id, vote.optionId, [vote], hasNext, undefined));
|
|
15095
|
+
return put(addPollVotesToListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote], hasNext, undefined));
|
|
15112
15096
|
case 98:
|
|
15113
|
-
_context.n =
|
|
15097
|
+
_context.n = 100;
|
|
15114
15098
|
break;
|
|
15115
15099
|
case 99:
|
|
15100
|
+
_context.n = 100;
|
|
15101
|
+
return put(deletePollVotesFromListAC(pollDetailsData.id, obj.vote.optionId, [obj.vote], messageId));
|
|
15102
|
+
case 100:
|
|
15103
|
+
_i++;
|
|
15104
|
+
_context.n = 97;
|
|
15105
|
+
break;
|
|
15106
|
+
case 101:
|
|
15107
|
+
_i2 = 0, _objs2 = objs;
|
|
15108
|
+
case 102:
|
|
15109
|
+
if (!(_i2 < _objs2.length)) {
|
|
15110
|
+
_context.n = 104;
|
|
15111
|
+
break;
|
|
15112
|
+
}
|
|
15113
|
+
_obj = _objs2[_i2];
|
|
15116
15114
|
updateMessageOnMap(_channel1.id, {
|
|
15117
15115
|
messageId: messageId,
|
|
15118
15116
|
params: {}
|
|
15119
|
-
},
|
|
15117
|
+
}, {
|
|
15118
|
+
type: _obj.type,
|
|
15119
|
+
vote: _obj.vote,
|
|
15120
|
+
incrementVotesPerOptionCount: _obj.incrementVotesPerOptionCount
|
|
15121
|
+
});
|
|
15120
15122
|
if (!(_channel1.id === _activeChannelId0)) {
|
|
15121
|
-
_context.n =
|
|
15123
|
+
_context.n = 103;
|
|
15122
15124
|
break;
|
|
15123
15125
|
}
|
|
15124
|
-
updateMessageOnAllMessages(messageId, {},
|
|
15125
|
-
_context.n =
|
|
15126
|
-
return put(updateMessageAC(messageId, {}, undefined,
|
|
15127
|
-
case
|
|
15128
|
-
|
|
15129
|
-
|
|
15126
|
+
updateMessageOnAllMessages(messageId, {}, _obj);
|
|
15127
|
+
_context.n = 103;
|
|
15128
|
+
return put(updateMessageAC(messageId, {}, undefined, _obj));
|
|
15129
|
+
case 103:
|
|
15130
|
+
_i2++;
|
|
15131
|
+
_context.n = 102;
|
|
15132
|
+
break;
|
|
15133
|
+
case 104:
|
|
15134
|
+
return _context.a(3, 179);
|
|
15135
|
+
case 105:
|
|
15130
15136
|
_channel10 = args.channel, _pollDetails = args.pollDetails, _messageId = args.messageId;
|
|
15131
15137
|
_pollDetailsData = _pollDetails;
|
|
15132
|
-
_context.n =
|
|
15138
|
+
_context.n = 106;
|
|
15133
15139
|
return call(getActiveChannelId);
|
|
15134
|
-
case
|
|
15140
|
+
case 106:
|
|
15135
15141
|
_activeChannelId1 = _context.v;
|
|
15136
15142
|
_deletedVotes = (_pollDetailsData === null || _pollDetailsData === void 0 ? void 0 : (_pollDetailsData$chan3 = _pollDetailsData.changedVotes) === null || _pollDetailsData$chan3 === void 0 ? void 0 : _pollDetailsData$chan3.removedVotes) || [];
|
|
15137
|
-
|
|
15138
|
-
|
|
15143
|
+
_objs3 = [];
|
|
15144
|
+
for (_iterator3 = _createForOfIteratorHelperLoose(_deletedVotes); !(_step3 = _iterator3()).done;) {
|
|
15145
|
+
_vote2 = _step3.value;
|
|
15146
|
+
_objs3.push({
|
|
15147
|
+
type: _vote2.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15148
|
+
vote: _vote2,
|
|
15149
|
+
incrementVotesPerOptionCount: -((_deletedVotes === null || _deletedVotes === void 0 ? void 0 : _deletedVotes.length) || 0)
|
|
15150
|
+
});
|
|
15151
|
+
}
|
|
15152
|
+
_i3 = 0, _objs4 = _objs3;
|
|
15153
|
+
case 107:
|
|
15154
|
+
if (!(_i3 < _objs4.length)) {
|
|
15155
|
+
_context.n = 109;
|
|
15139
15156
|
break;
|
|
15140
15157
|
}
|
|
15141
|
-
|
|
15142
|
-
|
|
15143
|
-
|
|
15144
|
-
_context.n = 105;
|
|
15158
|
+
_obj2 = _objs4[_i3];
|
|
15159
|
+
if (!(_pollDetailsData !== null && _pollDetailsData !== void 0 && _pollDetailsData.id && _obj2.vote)) {
|
|
15160
|
+
_context.n = 108;
|
|
15145
15161
|
break;
|
|
15146
15162
|
}
|
|
15147
|
-
|
|
15148
|
-
|
|
15149
|
-
|
|
15150
|
-
|
|
15151
|
-
_context.n =
|
|
15163
|
+
_context.n = 108;
|
|
15164
|
+
return put(deletePollVotesFromListAC(_pollDetailsData.id, _obj2.vote.optionId, [_obj2.vote], _messageId));
|
|
15165
|
+
case 108:
|
|
15166
|
+
_i3++;
|
|
15167
|
+
_context.n = 107;
|
|
15152
15168
|
break;
|
|
15153
|
-
case
|
|
15169
|
+
case 109:
|
|
15170
|
+
_i4 = 0, _objs5 = _objs3;
|
|
15171
|
+
case 110:
|
|
15172
|
+
if (!(_i4 < _objs5.length)) {
|
|
15173
|
+
_context.n = 112;
|
|
15174
|
+
break;
|
|
15175
|
+
}
|
|
15176
|
+
_obj3 = _objs5[_i4];
|
|
15154
15177
|
updateMessageOnMap(_channel10.id, {
|
|
15155
15178
|
messageId: _messageId,
|
|
15156
15179
|
params: {}
|
|
15157
|
-
},
|
|
15158
|
-
deletedVotes: _deletedVotes,
|
|
15159
|
-
votesPerOption: (_pollDetailsData === null || _pollDetailsData === void 0 ? void 0 : (_pollDetailsData$vote2 = _pollDetailsData.voteDetails) === null || _pollDetailsData$vote2 === void 0 ? void 0 : _pollDetailsData$vote2.votesPerOption) || {}
|
|
15160
|
-
});
|
|
15180
|
+
}, _obj3);
|
|
15161
15181
|
if (!(_channel10.id === _activeChannelId1)) {
|
|
15162
|
-
_context.n =
|
|
15182
|
+
_context.n = 111;
|
|
15163
15183
|
break;
|
|
15164
15184
|
}
|
|
15165
|
-
updateMessageOnAllMessages(_messageId, {},
|
|
15166
|
-
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15171
|
-
|
|
15172
|
-
|
|
15173
|
-
|
|
15174
|
-
case
|
|
15175
|
-
return _context.a(3, 171);
|
|
15176
|
-
case 107:
|
|
15185
|
+
updateMessageOnAllMessages(_messageId, {}, _obj3);
|
|
15186
|
+
_context.n = 111;
|
|
15187
|
+
return put(updateMessageAC(_messageId, {}, undefined, _obj3));
|
|
15188
|
+
case 111:
|
|
15189
|
+
_i4++;
|
|
15190
|
+
_context.n = 110;
|
|
15191
|
+
break;
|
|
15192
|
+
case 112:
|
|
15193
|
+
return _context.a(3, 179);
|
|
15194
|
+
case 113:
|
|
15177
15195
|
_channel11 = args.channel, _pollDetails2 = args.pollDetails, _messageId2 = args.messageId;
|
|
15178
|
-
_context.n =
|
|
15196
|
+
_context.n = 114;
|
|
15179
15197
|
return call(getActiveChannelId);
|
|
15180
|
-
case
|
|
15198
|
+
case 114:
|
|
15181
15199
|
_activeChannelId10 = _context.v;
|
|
15182
15200
|
_pollDetailsData2 = _pollDetails2;
|
|
15183
15201
|
retractedVotes = (_pollDetailsData2 === null || _pollDetailsData2 === void 0 ? void 0 : (_pollDetailsData2$cha = _pollDetailsData2.changedVotes) === null || _pollDetailsData2$cha === void 0 ? void 0 : _pollDetailsData2$cha.removedVotes) || [];
|
|
15202
|
+
_objs6 = [];
|
|
15203
|
+
for (_iterator4 = _createForOfIteratorHelperLoose(retractedVotes); !(_step4 = _iterator4()).done;) {
|
|
15204
|
+
_vote4 = _step4.value;
|
|
15205
|
+
_objs6.push({
|
|
15206
|
+
type: _vote4.user.id === SceytChatClient.user.id ? 'deleteOwn' : 'delete',
|
|
15207
|
+
vote: _vote4,
|
|
15208
|
+
incrementVotesPerOptionCount: -((retractedVotes === null || retractedVotes === void 0 ? void 0 : retractedVotes.length) || 0)
|
|
15209
|
+
});
|
|
15210
|
+
}
|
|
15211
|
+
_i5 = 0, _objs7 = _objs6;
|
|
15212
|
+
case 115:
|
|
15213
|
+
if (!(_i5 < _objs7.length)) {
|
|
15214
|
+
_context.n = 120;
|
|
15215
|
+
break;
|
|
15216
|
+
}
|
|
15217
|
+
_obj4 = _objs7[_i5];
|
|
15184
15218
|
updateMessageOnMap(_channel11.id, {
|
|
15185
15219
|
messageId: _messageId2,
|
|
15186
15220
|
params: {}
|
|
15187
|
-
},
|
|
15188
|
-
deletedVotes: retractedVotes,
|
|
15189
|
-
votesPerOption: (_pollDetailsData2 === null || _pollDetailsData2 === void 0 ? void 0 : (_pollDetailsData2$vot = _pollDetailsData2.voteDetails) === null || _pollDetailsData2$vot === void 0 ? void 0 : _pollDetailsData2$vot.votesPerOption) || {}
|
|
15190
|
-
});
|
|
15221
|
+
}, _obj4);
|
|
15191
15222
|
if (!(_pollDetailsData2 !== null && _pollDetailsData2 !== void 0 && _pollDetailsData2.id && retractedVotes.length > 0)) {
|
|
15192
|
-
_context.n =
|
|
15223
|
+
_context.n = 118;
|
|
15193
15224
|
break;
|
|
15194
15225
|
}
|
|
15195
|
-
|
|
15196
|
-
case
|
|
15197
|
-
if ((
|
|
15198
|
-
_context.n =
|
|
15226
|
+
_iterator5 = _createForOfIteratorHelperLoose(retractedVotes);
|
|
15227
|
+
case 116:
|
|
15228
|
+
if ((_step5 = _iterator5()).done) {
|
|
15229
|
+
_context.n = 118;
|
|
15199
15230
|
break;
|
|
15200
15231
|
}
|
|
15201
|
-
|
|
15202
|
-
_context.n =
|
|
15203
|
-
return put(deletePollVotesFromListAC(_pollDetailsData2.id,
|
|
15204
|
-
case
|
|
15205
|
-
_context.n =
|
|
15232
|
+
_vote3 = _step5.value;
|
|
15233
|
+
_context.n = 117;
|
|
15234
|
+
return put(deletePollVotesFromListAC(_pollDetailsData2.id, _vote3.optionId, [_vote3], _messageId2));
|
|
15235
|
+
case 117:
|
|
15236
|
+
_context.n = 116;
|
|
15206
15237
|
break;
|
|
15207
|
-
case
|
|
15238
|
+
case 118:
|
|
15208
15239
|
if (!(_channel11.id === _activeChannelId10)) {
|
|
15209
|
-
_context.n =
|
|
15240
|
+
_context.n = 119;
|
|
15210
15241
|
break;
|
|
15211
15242
|
}
|
|
15212
|
-
updateMessageOnAllMessages(_messageId2, {},
|
|
15213
|
-
|
|
15214
|
-
|
|
15215
|
-
|
|
15216
|
-
|
|
15217
|
-
|
|
15218
|
-
|
|
15219
|
-
|
|
15220
|
-
|
|
15221
|
-
case
|
|
15222
|
-
return _context.a(3, 171);
|
|
15223
|
-
case 113:
|
|
15243
|
+
updateMessageOnAllMessages(_messageId2, {}, _obj4);
|
|
15244
|
+
_context.n = 119;
|
|
15245
|
+
return put(updateMessageAC(_messageId2, {}, undefined, _obj4));
|
|
15246
|
+
case 119:
|
|
15247
|
+
_i5++;
|
|
15248
|
+
_context.n = 115;
|
|
15249
|
+
break;
|
|
15250
|
+
case 120:
|
|
15251
|
+
return _context.a(3, 179);
|
|
15252
|
+
case 121:
|
|
15224
15253
|
_channel12 = args.channel, _messageId3 = args.messageId;
|
|
15225
|
-
_context.n =
|
|
15254
|
+
_context.n = 122;
|
|
15226
15255
|
return call(getActiveChannelId);
|
|
15227
|
-
case
|
|
15256
|
+
case 122:
|
|
15228
15257
|
_activeChannelId11 = _context.v;
|
|
15258
|
+
_obj5 = {
|
|
15259
|
+
type: 'close',
|
|
15260
|
+
incrementVotesPerOptionCount: 0
|
|
15261
|
+
};
|
|
15229
15262
|
updateMessageOnMap(_channel12.id, {
|
|
15230
15263
|
messageId: _messageId3,
|
|
15231
15264
|
params: {}
|
|
15232
|
-
},
|
|
15233
|
-
closed: true
|
|
15234
|
-
});
|
|
15265
|
+
}, _obj5);
|
|
15235
15266
|
if (!(_channel12.id === _activeChannelId11)) {
|
|
15236
|
-
_context.n =
|
|
15267
|
+
_context.n = 124;
|
|
15237
15268
|
break;
|
|
15238
15269
|
}
|
|
15239
|
-
updateMessageOnAllMessages(_messageId3, {},
|
|
15240
|
-
|
|
15241
|
-
});
|
|
15242
|
-
|
|
15243
|
-
return
|
|
15244
|
-
|
|
15245
|
-
|
|
15246
|
-
case
|
|
15247
|
-
return _context.a(3, 171);
|
|
15248
|
-
case 116:
|
|
15249
|
-
return _context.a(3, 171);
|
|
15250
|
-
case 117:
|
|
15270
|
+
updateMessageOnAllMessages(_messageId3, {}, _obj5);
|
|
15271
|
+
_context.n = 123;
|
|
15272
|
+
return put(updateMessageAC(_messageId3, {}, undefined, _obj5));
|
|
15273
|
+
case 123:
|
|
15274
|
+
return _context.a(3, 179);
|
|
15275
|
+
case 124:
|
|
15276
|
+
return _context.a(3, 179);
|
|
15277
|
+
case 125:
|
|
15251
15278
|
_channel13 = args.channel, _user = args.user, _message3 = args.message, _reaction = args.reaction;
|
|
15252
15279
|
log.info('channel REACTION_DELETED ... ', _channel13);
|
|
15253
15280
|
channelFromMap = getChannelFromMap(_channel13.id);
|
|
15254
15281
|
_isSelf = _user.id === SceytChatClient.user.id;
|
|
15255
|
-
_context.n =
|
|
15282
|
+
_context.n = 126;
|
|
15256
15283
|
return call(getActiveChannelId);
|
|
15257
|
-
case
|
|
15284
|
+
case 126:
|
|
15258
15285
|
_activeChannelId12 = _context.v;
|
|
15259
15286
|
if (!(_channel13.id === _activeChannelId12)) {
|
|
15260
|
-
_context.n =
|
|
15287
|
+
_context.n = 128;
|
|
15261
15288
|
break;
|
|
15262
15289
|
}
|
|
15263
|
-
_context.n =
|
|
15290
|
+
_context.n = 127;
|
|
15264
15291
|
return put(deleteReactionFromMessageAC(_message3, _reaction, _isSelf));
|
|
15265
|
-
case
|
|
15292
|
+
case 127:
|
|
15266
15293
|
removeReactionOnAllMessages(_message3, _reaction, true);
|
|
15267
|
-
case
|
|
15294
|
+
case 128:
|
|
15268
15295
|
_channelUpdateParams = JSON.parse(JSON.stringify(_channel13));
|
|
15269
15296
|
if (channelFromMap && channelFromMap.lastReactedMessage && channelFromMap.lastReactedMessage.id === _message3.id) {
|
|
15270
15297
|
_channelUpdateParams.lastReactedMessage = null;
|
|
15271
15298
|
}
|
|
15272
|
-
_context.n =
|
|
15299
|
+
_context.n = 129;
|
|
15273
15300
|
return put(updateChannelDataAC(_channel13.id, _channelUpdateParams));
|
|
15274
|
-
case
|
|
15301
|
+
case 129:
|
|
15275
15302
|
updateChannelOnAllChannels(_channel13.id, _channelUpdateParams);
|
|
15276
15303
|
if (checkChannelExistsOnMessagesMap(_channel13.id)) {
|
|
15277
15304
|
removeReactionToMessageOnMap(_channel13.id, _message3, _reaction, true);
|
|
15278
15305
|
}
|
|
15279
|
-
return _context.a(3,
|
|
15280
|
-
case
|
|
15306
|
+
return _context.a(3, 179);
|
|
15307
|
+
case 130:
|
|
15281
15308
|
_channel14 = args.channel;
|
|
15282
15309
|
if (!_channel14) {
|
|
15283
|
-
_context.n =
|
|
15310
|
+
_context.n = 132;
|
|
15284
15311
|
break;
|
|
15285
15312
|
}
|
|
15286
15313
|
_updatedChannel = JSON.parse(JSON.stringify(_channel14));
|
|
15287
|
-
_context.n =
|
|
15314
|
+
_context.n = 131;
|
|
15288
15315
|
return put(updateChannelDataAC(_channel14.id, {
|
|
15289
15316
|
lastMessage: _channel14.lastMessage,
|
|
15290
15317
|
newMessageCount: _channel14.newMessageCount,
|
|
@@ -15297,36 +15324,36 @@ function watchForEvents() {
|
|
|
15297
15324
|
lastDisplayedMessageId: _channel14.lastDisplayedMessageId,
|
|
15298
15325
|
messageRetentionPeriod: _channel14.messageRetentionPeriod
|
|
15299
15326
|
}));
|
|
15300
|
-
case
|
|
15327
|
+
case 131:
|
|
15301
15328
|
updateChannelOnAllChannels(_channel14.id, _updatedChannel);
|
|
15302
|
-
case
|
|
15303
|
-
return _context.a(3,
|
|
15304
|
-
case
|
|
15329
|
+
case 132:
|
|
15330
|
+
return _context.a(3, 179);
|
|
15331
|
+
case 133:
|
|
15305
15332
|
_channel15 = args.channel;
|
|
15306
15333
|
log.info('CLEAR_HISTORY: ', _channel15);
|
|
15307
|
-
_context.n =
|
|
15334
|
+
_context.n = 134;
|
|
15308
15335
|
return call(getActiveChannelId);
|
|
15309
|
-
case
|
|
15336
|
+
case 134:
|
|
15310
15337
|
_activeChannelId13 = _context.v;
|
|
15311
|
-
_context.n =
|
|
15338
|
+
_context.n = 135;
|
|
15312
15339
|
return call(checkChannelExists, _channel15.id);
|
|
15313
|
-
case
|
|
15340
|
+
case 135:
|
|
15314
15341
|
channelExist = _context.v;
|
|
15315
15342
|
if (!(_channel15.id === _activeChannelId13)) {
|
|
15316
|
-
_context.n =
|
|
15343
|
+
_context.n = 137;
|
|
15317
15344
|
break;
|
|
15318
15345
|
}
|
|
15319
|
-
_context.n =
|
|
15346
|
+
_context.n = 136;
|
|
15320
15347
|
return put(clearMessagesAC());
|
|
15321
|
-
case
|
|
15348
|
+
case 136:
|
|
15322
15349
|
removeAllMessages();
|
|
15323
|
-
case
|
|
15350
|
+
case 137:
|
|
15324
15351
|
removeMessagesFromMap(_channel15.id);
|
|
15325
15352
|
if (!channelExist) {
|
|
15326
|
-
_context.n =
|
|
15353
|
+
_context.n = 138;
|
|
15327
15354
|
break;
|
|
15328
15355
|
}
|
|
15329
|
-
_context.n =
|
|
15356
|
+
_context.n = 138;
|
|
15330
15357
|
return put(updateChannelDataAC(_channel15.id, {
|
|
15331
15358
|
lastMessage: null,
|
|
15332
15359
|
newMessageCount: 0,
|
|
@@ -15334,7 +15361,7 @@ function watchForEvents() {
|
|
|
15334
15361
|
muted: _channel15.muted,
|
|
15335
15362
|
mutedTill: _channel15.mutedTill
|
|
15336
15363
|
}));
|
|
15337
|
-
case
|
|
15364
|
+
case 138:
|
|
15338
15365
|
updateChannelOnAllChannels(_channel15.id, {
|
|
15339
15366
|
lastMessage: null,
|
|
15340
15367
|
newMessageCount: 0,
|
|
@@ -15342,173 +15369,173 @@ function watchForEvents() {
|
|
|
15342
15369
|
muted: _channel15.muted,
|
|
15343
15370
|
mutedTill: _channel15.mutedTill
|
|
15344
15371
|
});
|
|
15345
|
-
return _context.a(3,
|
|
15346
|
-
case
|
|
15372
|
+
return _context.a(3, 179);
|
|
15373
|
+
case 139:
|
|
15347
15374
|
_channel16 = args.channel;
|
|
15348
15375
|
log.info('channel MUTE ... ');
|
|
15349
|
-
_context.n =
|
|
15376
|
+
_context.n = 140;
|
|
15350
15377
|
return put(updateChannelDataAC(_channel16.id, {
|
|
15351
15378
|
muted: _channel16.muted,
|
|
15352
15379
|
mutedTill: _channel16.mutedTill
|
|
15353
15380
|
}));
|
|
15354
|
-
case
|
|
15381
|
+
case 140:
|
|
15355
15382
|
updateChannelOnAllChannels(_channel16.id, {
|
|
15356
15383
|
muted: _channel16.muted,
|
|
15357
15384
|
mutedTill: _channel16.mutedTill
|
|
15358
15385
|
});
|
|
15359
|
-
return _context.a(3,
|
|
15360
|
-
case
|
|
15386
|
+
return _context.a(3, 179);
|
|
15387
|
+
case 141:
|
|
15361
15388
|
_channel17 = args.channel;
|
|
15362
15389
|
log.info('channel UNMUTE ... ');
|
|
15363
|
-
_context.n =
|
|
15390
|
+
_context.n = 142;
|
|
15364
15391
|
return put(updateChannelDataAC(_channel17.id, {
|
|
15365
15392
|
muted: _channel17.muted,
|
|
15366
15393
|
mutedTill: _channel17.mutedTill
|
|
15367
15394
|
}));
|
|
15368
|
-
case
|
|
15395
|
+
case 142:
|
|
15369
15396
|
updateChannelOnAllChannels(_channel17.id, {
|
|
15370
15397
|
muted: _channel17.muted,
|
|
15371
15398
|
mutedTill: _channel17.mutedTill
|
|
15372
15399
|
});
|
|
15373
|
-
return _context.a(3,
|
|
15374
|
-
case
|
|
15400
|
+
return _context.a(3, 179);
|
|
15401
|
+
case 143:
|
|
15375
15402
|
_channel18 = args.channel;
|
|
15376
15403
|
log.info('channel PINED ... ');
|
|
15377
|
-
_context.n =
|
|
15404
|
+
_context.n = 144;
|
|
15378
15405
|
return put(updateChannelDataAC(_channel18.id, {
|
|
15379
15406
|
pinnedAt: _channel18.pinnedAt
|
|
15380
15407
|
}, true));
|
|
15381
|
-
case
|
|
15408
|
+
case 144:
|
|
15382
15409
|
updateChannelOnAllChannels(_channel18.id, {
|
|
15383
15410
|
pinnedAt: _channel18.pinnedAt
|
|
15384
15411
|
});
|
|
15385
|
-
return _context.a(3,
|
|
15386
|
-
case
|
|
15412
|
+
return _context.a(3, 179);
|
|
15413
|
+
case 145:
|
|
15387
15414
|
_channel19 = args.channel;
|
|
15388
15415
|
log.info('channel UNPINED ... ');
|
|
15389
|
-
_context.n =
|
|
15416
|
+
_context.n = 146;
|
|
15390
15417
|
return put(updateChannelDataAC(_channel19.id, {
|
|
15391
15418
|
pinnedAt: _channel19.pinnedAt
|
|
15392
15419
|
}, false, true));
|
|
15393
|
-
case
|
|
15420
|
+
case 146:
|
|
15394
15421
|
updateChannelOnAllChannels(_channel19.id, {
|
|
15395
15422
|
pinnedAt: _channel19.pinnedAt
|
|
15396
15423
|
});
|
|
15397
|
-
return _context.a(3,
|
|
15398
|
-
case
|
|
15424
|
+
return _context.a(3, 179);
|
|
15425
|
+
case 147:
|
|
15399
15426
|
_channel20 = args.channel;
|
|
15400
15427
|
log.info('channel HIDE ... ');
|
|
15401
|
-
_context.n =
|
|
15428
|
+
_context.n = 148;
|
|
15402
15429
|
return put(setChannelToHideAC(_channel20));
|
|
15403
|
-
case
|
|
15404
|
-
return _context.a(3,
|
|
15405
|
-
case
|
|
15430
|
+
case 148:
|
|
15431
|
+
return _context.a(3, 179);
|
|
15432
|
+
case 149:
|
|
15406
15433
|
_channel21 = args.channel;
|
|
15407
15434
|
log.info('channel UNHIDE ... ');
|
|
15408
|
-
_context.n =
|
|
15435
|
+
_context.n = 150;
|
|
15409
15436
|
return put(setChannelToUnHideAC(_channel21));
|
|
15410
|
-
case
|
|
15411
|
-
return _context.a(3,
|
|
15412
|
-
case
|
|
15437
|
+
case 150:
|
|
15438
|
+
return _context.a(3, 179);
|
|
15439
|
+
case 151:
|
|
15413
15440
|
_channel22 = args.channel;
|
|
15414
|
-
_context.n =
|
|
15441
|
+
_context.n = 152;
|
|
15415
15442
|
return put(updateChannelDataAC(_channel22.id, {
|
|
15416
15443
|
unread: _channel22.unread,
|
|
15417
15444
|
muted: _channel22.muted,
|
|
15418
15445
|
mutedTill: _channel22.mutedTill
|
|
15419
15446
|
}));
|
|
15420
|
-
case
|
|
15447
|
+
case 152:
|
|
15421
15448
|
_groupName5 = getChannelGroupName(_channel22);
|
|
15422
|
-
_context.n =
|
|
15449
|
+
_context.n = 153;
|
|
15423
15450
|
return put(updateSearchedChannelDataAC(_channel22.id, {
|
|
15424
15451
|
unread: _channel22.unread
|
|
15425
15452
|
}, _groupName5));
|
|
15426
|
-
case
|
|
15453
|
+
case 153:
|
|
15427
15454
|
updateChannelOnAllChannels(_channel22.id, {
|
|
15428
15455
|
unread: _channel22.unread
|
|
15429
15456
|
});
|
|
15430
|
-
return _context.a(3,
|
|
15431
|
-
case
|
|
15457
|
+
return _context.a(3, 179);
|
|
15458
|
+
case 154:
|
|
15432
15459
|
_channel23 = args.channel;
|
|
15433
|
-
_context.n =
|
|
15460
|
+
_context.n = 155;
|
|
15434
15461
|
return put(updateChannelDataAC(_channel23.id, {
|
|
15435
15462
|
unread: _channel23.unread,
|
|
15436
15463
|
muted: _channel23.muted,
|
|
15437
15464
|
mutedTill: _channel23.mutedTill
|
|
15438
15465
|
}));
|
|
15439
|
-
case
|
|
15466
|
+
case 155:
|
|
15440
15467
|
_groupName6 = getChannelGroupName(_channel23);
|
|
15441
|
-
_context.n =
|
|
15468
|
+
_context.n = 156;
|
|
15442
15469
|
return put(updateSearchedChannelDataAC(_channel23.id, {
|
|
15443
15470
|
unread: _channel23.unread
|
|
15444
15471
|
}, _groupName6));
|
|
15445
|
-
case
|
|
15472
|
+
case 156:
|
|
15446
15473
|
updateChannelOnAllChannels(_channel23.id, {
|
|
15447
15474
|
unread: _channel23.unread
|
|
15448
15475
|
});
|
|
15449
|
-
return _context.a(3,
|
|
15450
|
-
case
|
|
15476
|
+
return _context.a(3, 179);
|
|
15477
|
+
case 157:
|
|
15451
15478
|
_channel24 = args.channel, members = args.members;
|
|
15452
15479
|
log.info('channel CHANGE_ROLE channel ... ', _channel24);
|
|
15453
15480
|
log.info('channel CHANGE_ROLE member ... ', members);
|
|
15454
|
-
_context.n =
|
|
15481
|
+
_context.n = 158;
|
|
15455
15482
|
return call(getActiveChannelId);
|
|
15456
|
-
case
|
|
15483
|
+
case 158:
|
|
15457
15484
|
_activeChannelId14 = _context.v;
|
|
15458
15485
|
if (!(_channel24.id === _activeChannelId14)) {
|
|
15459
|
-
_context.n =
|
|
15486
|
+
_context.n = 159;
|
|
15460
15487
|
break;
|
|
15461
15488
|
}
|
|
15462
|
-
_context.n =
|
|
15489
|
+
_context.n = 159;
|
|
15463
15490
|
return put(updateMembersAC(members));
|
|
15464
|
-
case
|
|
15491
|
+
case 159:
|
|
15465
15492
|
i = 0;
|
|
15466
|
-
case
|
|
15493
|
+
case 160:
|
|
15467
15494
|
if (!(i < members.length)) {
|
|
15468
|
-
_context.n =
|
|
15495
|
+
_context.n = 163;
|
|
15469
15496
|
break;
|
|
15470
15497
|
}
|
|
15471
15498
|
if (!(members[i].id === SceytChatClient.user.id)) {
|
|
15472
|
-
_context.n =
|
|
15499
|
+
_context.n = 162;
|
|
15473
15500
|
break;
|
|
15474
15501
|
}
|
|
15475
|
-
_context.n =
|
|
15502
|
+
_context.n = 161;
|
|
15476
15503
|
return put(updateChannelDataAC(_channel24.id, {
|
|
15477
15504
|
userRole: members[i].role,
|
|
15478
15505
|
muted: _channel24.muted,
|
|
15479
15506
|
mutedTill: _channel24.mutedTill
|
|
15480
15507
|
}));
|
|
15481
|
-
case
|
|
15508
|
+
case 161:
|
|
15482
15509
|
updateChannelOnAllChannels(_channel24.id, {
|
|
15483
15510
|
userRole: members[i].role,
|
|
15484
15511
|
muted: _channel24.muted,
|
|
15485
15512
|
mutedTill: _channel24.mutedTill
|
|
15486
15513
|
});
|
|
15487
|
-
case
|
|
15514
|
+
case 162:
|
|
15488
15515
|
i++;
|
|
15489
|
-
_context.n =
|
|
15516
|
+
_context.n = 160;
|
|
15490
15517
|
break;
|
|
15491
|
-
case
|
|
15492
|
-
return _context.a(3,
|
|
15493
|
-
case
|
|
15518
|
+
case 163:
|
|
15519
|
+
return _context.a(3, 179);
|
|
15520
|
+
case 164:
|
|
15494
15521
|
_channel25 = args.channel;
|
|
15495
15522
|
log.info('channel frozen channel ... ', _channel25);
|
|
15496
|
-
return _context.a(3,
|
|
15497
|
-
case
|
|
15523
|
+
return _context.a(3, 179);
|
|
15524
|
+
case 165:
|
|
15498
15525
|
_channel26 = args.channel;
|
|
15499
15526
|
log.info('channel unfrozen channel ... ', _channel26);
|
|
15500
|
-
return _context.a(3,
|
|
15501
|
-
case
|
|
15527
|
+
return _context.a(3, 179);
|
|
15528
|
+
case 166:
|
|
15502
15529
|
_channelId2 = args.channelId, from = args.from, name = args.name;
|
|
15503
15530
|
log.info('channel event received >>>... . . . . . ', args);
|
|
15504
15531
|
if (!(from.id === SceytChatClient.user.id)) {
|
|
15505
|
-
_context.n =
|
|
15532
|
+
_context.n = 167;
|
|
15506
15533
|
break;
|
|
15507
15534
|
}
|
|
15508
|
-
return _context.a(3,
|
|
15509
|
-
case
|
|
15535
|
+
return _context.a(3, 179);
|
|
15536
|
+
case 167:
|
|
15510
15537
|
if (!(name === 'start_typing')) {
|
|
15511
|
-
_context.n =
|
|
15538
|
+
_context.n = 169;
|
|
15512
15539
|
break;
|
|
15513
15540
|
}
|
|
15514
15541
|
if (!usersTimeout[_channelId2]) {
|
|
@@ -15520,27 +15547,27 @@ function watchForEvents() {
|
|
|
15520
15547
|
usersTimeout[_channelId2][from.id] = setTimeout(function () {
|
|
15521
15548
|
channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_typing');
|
|
15522
15549
|
}, 5000);
|
|
15523
|
-
_context.n =
|
|
15550
|
+
_context.n = 168;
|
|
15524
15551
|
return put(switchTypingIndicatorAC(true, _channelId2, from));
|
|
15525
|
-
case
|
|
15526
|
-
_context.n =
|
|
15552
|
+
case 168:
|
|
15553
|
+
_context.n = 174;
|
|
15527
15554
|
break;
|
|
15528
|
-
case
|
|
15555
|
+
case 169:
|
|
15529
15556
|
if (!(name === 'stop_typing')) {
|
|
15530
|
-
_context.n =
|
|
15557
|
+
_context.n = 171;
|
|
15531
15558
|
break;
|
|
15532
15559
|
}
|
|
15533
15560
|
if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
|
|
15534
15561
|
clearTimeout(usersTimeout[_channelId2][from.id]);
|
|
15535
15562
|
}
|
|
15536
|
-
_context.n =
|
|
15563
|
+
_context.n = 170;
|
|
15537
15564
|
return put(switchTypingIndicatorAC(false, _channelId2, from));
|
|
15538
|
-
case
|
|
15539
|
-
_context.n =
|
|
15565
|
+
case 170:
|
|
15566
|
+
_context.n = 174;
|
|
15540
15567
|
break;
|
|
15541
|
-
case
|
|
15568
|
+
case 171:
|
|
15542
15569
|
if (!(name === 'start_recording')) {
|
|
15543
|
-
_context.n =
|
|
15570
|
+
_context.n = 173;
|
|
15544
15571
|
break;
|
|
15545
15572
|
}
|
|
15546
15573
|
if (!usersTimeout[_channelId2]) {
|
|
@@ -15552,50 +15579,50 @@ function watchForEvents() {
|
|
|
15552
15579
|
usersTimeout[_channelId2][from.id] = setTimeout(function () {
|
|
15553
15580
|
channelListener.onReceivedChannelEvent(_channelId2, from, 'stop_recording');
|
|
15554
15581
|
}, 5000);
|
|
15555
|
-
_context.n =
|
|
15582
|
+
_context.n = 172;
|
|
15556
15583
|
return put(switchRecordingIndicatorAC(true, _channelId2, from));
|
|
15557
|
-
case
|
|
15558
|
-
_context.n =
|
|
15584
|
+
case 172:
|
|
15585
|
+
_context.n = 174;
|
|
15559
15586
|
break;
|
|
15560
|
-
case
|
|
15587
|
+
case 173:
|
|
15561
15588
|
if (!(name === 'stop_recording')) {
|
|
15562
|
-
_context.n =
|
|
15589
|
+
_context.n = 174;
|
|
15563
15590
|
break;
|
|
15564
15591
|
}
|
|
15565
15592
|
if (usersTimeout[_channelId2] && usersTimeout[_channelId2][from.id]) {
|
|
15566
15593
|
clearTimeout(usersTimeout[_channelId2][from.id]);
|
|
15567
15594
|
}
|
|
15568
|
-
_context.n =
|
|
15595
|
+
_context.n = 174;
|
|
15569
15596
|
return put(switchRecordingIndicatorAC(false, _channelId2, from));
|
|
15570
|
-
case
|
|
15571
|
-
return _context.a(3,
|
|
15572
|
-
case
|
|
15597
|
+
case 174:
|
|
15598
|
+
return _context.a(3, 179);
|
|
15599
|
+
case 175:
|
|
15573
15600
|
status = args.status;
|
|
15574
15601
|
log.info('connection status changed . . . . . ', status);
|
|
15575
|
-
_context.n =
|
|
15602
|
+
_context.n = 176;
|
|
15576
15603
|
return put(setConnectionStatusAC(status));
|
|
15577
|
-
case
|
|
15604
|
+
case 176:
|
|
15578
15605
|
if (!(status === CONNECTION_STATUS.CONNECTED)) {
|
|
15579
|
-
_context.n =
|
|
15606
|
+
_context.n = 177;
|
|
15580
15607
|
break;
|
|
15581
15608
|
}
|
|
15582
|
-
_context.n =
|
|
15609
|
+
_context.n = 177;
|
|
15583
15610
|
return put(getRolesAC());
|
|
15584
|
-
case
|
|
15585
|
-
return _context.a(3,
|
|
15586
|
-
case
|
|
15611
|
+
case 177:
|
|
15612
|
+
return _context.a(3, 179);
|
|
15613
|
+
case 178:
|
|
15587
15614
|
log.warn('UNHANDLED EVENT FROM REDUX-SAGA EVENT-CHANNEL');
|
|
15588
|
-
case
|
|
15589
|
-
_context.n =
|
|
15615
|
+
case 179:
|
|
15616
|
+
_context.n = 181;
|
|
15590
15617
|
break;
|
|
15591
|
-
case
|
|
15592
|
-
_context.p =
|
|
15618
|
+
case 180:
|
|
15619
|
+
_context.p = 180;
|
|
15593
15620
|
_t2 = _context.v;
|
|
15594
15621
|
log.error('Error in watchForEvents:', _t2);
|
|
15595
|
-
case
|
|
15622
|
+
case 181:
|
|
15596
15623
|
return _context.a(2);
|
|
15597
15624
|
}
|
|
15598
|
-
}, _callee, null, [[0,
|
|
15625
|
+
}, _callee, null, [[0, 180]]);
|
|
15599
15626
|
});
|
|
15600
15627
|
case 1:
|
|
15601
15628
|
return _context2.d(_regeneratorValues(_loop()), 2);
|
|
@@ -20688,68 +20715,9 @@ function getMessageMarkers(action) {
|
|
|
20688
20715
|
}
|
|
20689
20716
|
}, _marked16$1, null, [[0, 5, 6, 8]]);
|
|
20690
20717
|
}
|
|
20691
|
-
var updatePollDetails = function updatePollDetails(pollDetails, optionId, addVote, allowMultipleVotes) {
|
|
20692
|
-
if (addVote === void 0) {
|
|
20693
|
-
addVote = true;
|
|
20694
|
-
}
|
|
20695
|
-
if (allowMultipleVotes === void 0) {
|
|
20696
|
-
allowMultipleVotes = false;
|
|
20697
|
-
}
|
|
20698
|
-
var user = getClient().user;
|
|
20699
|
-
if (addVote) {
|
|
20700
|
-
var _user$presence, _pollDetails$voteDeta5, _pollDetails$voteDeta6, _pollDetails$voteDeta7, _pollDetails$voteDeta8, _pollDetails$voteDeta9, _pollDetails$voteDeta0, _pollDetails$voteDeta1, _pollDetails$voteDeta10, _pollDetails$voteDeta11, _pollDetails$voteDeta12, _pollDetails$voteDeta13, _ref3, _pollDetails$voteDeta14, _pollDetails$voteDeta15, _extends3;
|
|
20701
|
-
var vote = {
|
|
20702
|
-
optionId: optionId,
|
|
20703
|
-
createdAt: new Date().getTime(),
|
|
20704
|
-
user: {
|
|
20705
|
-
id: user.id,
|
|
20706
|
-
presence: {
|
|
20707
|
-
status: ((_user$presence = user.presence) === null || _user$presence === void 0 ? void 0 : _user$presence.status) || 'online'
|
|
20708
|
-
},
|
|
20709
|
-
profile: {
|
|
20710
|
-
avatar: user.avatarUrl || '',
|
|
20711
|
-
firstName: user.firstName,
|
|
20712
|
-
lastName: user.lastName,
|
|
20713
|
-
metadata: user.metadata || '',
|
|
20714
|
-
metadataMap: user.metadataMap || {},
|
|
20715
|
-
updatedAt: new Date().getTime(),
|
|
20716
|
-
username: user.username || '',
|
|
20717
|
-
createdAt: new Date().getTime()
|
|
20718
|
-
},
|
|
20719
|
-
createdAt: new Date().getTime()
|
|
20720
|
-
}
|
|
20721
|
-
};
|
|
20722
|
-
if (allowMultipleVotes) {
|
|
20723
|
-
var _pollDetails$voteDeta, _pollDetails$voteDeta2, _pollDetails$voteDeta3, _extends2, _pollDetails$voteDeta4;
|
|
20724
|
-
return _extends({}, pollDetails, {
|
|
20725
|
-
voteDetails: _extends({}, pollDetails === null || pollDetails === void 0 ? void 0 : pollDetails.voteDetails, {
|
|
20726
|
-
votesPerOption: _extends({}, pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta = pollDetails.voteDetails) === null || _pollDetails$voteDeta === void 0 ? void 0 : _pollDetails$voteDeta.votesPerOption, (_extends2 = {}, _extends2[optionId] = ((pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta2 = pollDetails.voteDetails) === null || _pollDetails$voteDeta2 === void 0 ? void 0 : (_pollDetails$voteDeta3 = _pollDetails$voteDeta2.votesPerOption) === null || _pollDetails$voteDeta3 === void 0 ? void 0 : _pollDetails$voteDeta3[optionId]) || 0) + 1, _extends2)),
|
|
20727
|
-
ownVotes: [].concat((pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta4 = pollDetails.voteDetails) === null || _pollDetails$voteDeta4 === void 0 ? void 0 : _pollDetails$voteDeta4.ownVotes) || [], [vote])
|
|
20728
|
-
})
|
|
20729
|
-
});
|
|
20730
|
-
}
|
|
20731
|
-
var isVotedAlready = ((pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta5 = pollDetails.voteDetails) === null || _pollDetails$voteDeta5 === void 0 ? void 0 : (_pollDetails$voteDeta6 = _pollDetails$voteDeta5.ownVotes) === null || _pollDetails$voteDeta6 === void 0 ? void 0 : _pollDetails$voteDeta6.length) || 0) > 0;
|
|
20732
|
-
return _extends({}, pollDetails, {
|
|
20733
|
-
voteDetails: _extends({}, pollDetails === null || pollDetails === void 0 ? void 0 : pollDetails.voteDetails, {
|
|
20734
|
-
votesPerOption: _extends({}, pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta7 = pollDetails.voteDetails) === null || _pollDetails$voteDeta7 === void 0 ? void 0 : _pollDetails$voteDeta7.votesPerOption, isVotedAlready ? (_ref3 = {}, _ref3[String(pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta8 = pollDetails.voteDetails) === null || _pollDetails$voteDeta8 === void 0 ? void 0 : (_pollDetails$voteDeta9 = _pollDetails$voteDeta8.ownVotes) === null || _pollDetails$voteDeta9 === void 0 ? void 0 : (_pollDetails$voteDeta0 = _pollDetails$voteDeta9[0]) === null || _pollDetails$voteDeta0 === void 0 ? void 0 : _pollDetails$voteDeta0.optionId)] = ((pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta1 = pollDetails.voteDetails) === null || _pollDetails$voteDeta1 === void 0 ? void 0 : (_pollDetails$voteDeta10 = _pollDetails$voteDeta1.votesPerOption) === null || _pollDetails$voteDeta10 === void 0 ? void 0 : _pollDetails$voteDeta10[String(pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta11 = pollDetails.voteDetails) === null || _pollDetails$voteDeta11 === void 0 ? void 0 : (_pollDetails$voteDeta12 = _pollDetails$voteDeta11.ownVotes) === null || _pollDetails$voteDeta12 === void 0 ? void 0 : (_pollDetails$voteDeta13 = _pollDetails$voteDeta12[0]) === null || _pollDetails$voteDeta13 === void 0 ? void 0 : _pollDetails$voteDeta13.optionId)]) || 0) - 1, _ref3) : {}, (_extends3 = {}, _extends3[optionId] = ((pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta14 = pollDetails.voteDetails) === null || _pollDetails$voteDeta14 === void 0 ? void 0 : (_pollDetails$voteDeta15 = _pollDetails$voteDeta14.votesPerOption) === null || _pollDetails$voteDeta15 === void 0 ? void 0 : _pollDetails$voteDeta15[optionId]) || 0) + 1, _extends3)),
|
|
20735
|
-
ownVotes: [vote]
|
|
20736
|
-
})
|
|
20737
|
-
});
|
|
20738
|
-
} else {
|
|
20739
|
-
var _pollDetails$voteDeta16, _pollDetails$voteDeta17, _pollDetails$voteDeta18, _extends4, _pollDetails$voteDeta19;
|
|
20740
|
-
return _extends({}, pollDetails, {
|
|
20741
|
-
voteDetails: _extends({}, pollDetails === null || pollDetails === void 0 ? void 0 : pollDetails.voteDetails, {
|
|
20742
|
-
votesPerOption: _extends({}, pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta16 = pollDetails.voteDetails) === null || _pollDetails$voteDeta16 === void 0 ? void 0 : _pollDetails$voteDeta16.votesPerOption, (_extends4 = {}, _extends4[optionId] = ((pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta17 = pollDetails.voteDetails) === null || _pollDetails$voteDeta17 === void 0 ? void 0 : (_pollDetails$voteDeta18 = _pollDetails$voteDeta17.votesPerOption) === null || _pollDetails$voteDeta18 === void 0 ? void 0 : _pollDetails$voteDeta18[optionId]) || 0) - 1, _extends4)),
|
|
20743
|
-
ownVotes: [].concat(((pollDetails === null || pollDetails === void 0 ? void 0 : (_pollDetails$voteDeta19 = pollDetails.voteDetails) === null || _pollDetails$voteDeta19 === void 0 ? void 0 : _pollDetails$voteDeta19.ownVotes) || []).filter(function (vote) {
|
|
20744
|
-
return vote.optionId !== optionId;
|
|
20745
|
-
}))
|
|
20746
|
-
})
|
|
20747
|
-
});
|
|
20748
|
-
}
|
|
20749
|
-
};
|
|
20750
20718
|
function executeAddPollVote(channelId, pollId, optionId, message) {
|
|
20751
|
-
var _message$pollDetails;
|
|
20752
|
-
var channel,
|
|
20719
|
+
var _user$presence, _message$pollDetails;
|
|
20720
|
+
var channel, user, vote, objs, _message$pollDetails2, _message$pollDetails3, _message$pollDetails4, _i2, _objs, obj;
|
|
20753
20721
|
return _regenerator().w(function (_context19) {
|
|
20754
20722
|
while (1) switch (_context19.n) {
|
|
20755
20723
|
case 0:
|
|
@@ -20763,38 +20731,72 @@ function executeAddPollVote(channelId, pollId, optionId, message) {
|
|
|
20763
20731
|
}
|
|
20764
20732
|
return _context19.a(2);
|
|
20765
20733
|
case 2:
|
|
20766
|
-
|
|
20767
|
-
|
|
20768
|
-
|
|
20769
|
-
|
|
20770
|
-
|
|
20734
|
+
user = getClient().user;
|
|
20735
|
+
vote = {
|
|
20736
|
+
optionId: optionId,
|
|
20737
|
+
createdAt: new Date().getTime(),
|
|
20738
|
+
user: {
|
|
20739
|
+
id: user.id,
|
|
20740
|
+
presence: {
|
|
20741
|
+
status: ((_user$presence = user.presence) === null || _user$presence === void 0 ? void 0 : _user$presence.status) || 'online'
|
|
20742
|
+
},
|
|
20743
|
+
profile: {
|
|
20744
|
+
avatar: user.avatarUrl || '',
|
|
20745
|
+
firstName: user.firstName,
|
|
20746
|
+
lastName: user.lastName,
|
|
20747
|
+
metadata: user.metadata || '',
|
|
20748
|
+
metadataMap: user.metadataMap || {},
|
|
20749
|
+
updatedAt: new Date().getTime(),
|
|
20750
|
+
username: user.username || '',
|
|
20751
|
+
createdAt: new Date().getTime()
|
|
20752
|
+
},
|
|
20753
|
+
createdAt: new Date().getTime()
|
|
20771
20754
|
}
|
|
20772
|
-
}
|
|
20773
|
-
|
|
20774
|
-
|
|
20775
|
-
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
|
|
20779
|
-
|
|
20755
|
+
};
|
|
20756
|
+
objs = [{
|
|
20757
|
+
type: 'addOwn',
|
|
20758
|
+
vote: vote,
|
|
20759
|
+
incrementVotesPerOptionCount: 1
|
|
20760
|
+
}];
|
|
20761
|
+
if (!((_message$pollDetails = message.pollDetails) !== null && _message$pollDetails !== void 0 && _message$pollDetails.allowMultipleVotes)) {
|
|
20762
|
+
objs.push({
|
|
20763
|
+
type: 'deleteOwn',
|
|
20764
|
+
vote: (_message$pollDetails2 = message.pollDetails) === null || _message$pollDetails2 === void 0 ? void 0 : (_message$pollDetails3 = _message$pollDetails2.voteDetails) === null || _message$pollDetails3 === void 0 ? void 0 : (_message$pollDetails4 = _message$pollDetails3.ownVotes) === null || _message$pollDetails4 === void 0 ? void 0 : _message$pollDetails4[0],
|
|
20765
|
+
incrementVotesPerOptionCount: -1
|
|
20766
|
+
});
|
|
20767
|
+
}
|
|
20768
|
+
_i2 = 0, _objs = objs;
|
|
20780
20769
|
case 3:
|
|
20770
|
+
if (!(_i2 < _objs.length)) {
|
|
20771
|
+
_context19.n = 6;
|
|
20772
|
+
break;
|
|
20773
|
+
}
|
|
20774
|
+
obj = _objs[_i2];
|
|
20775
|
+
updateMessageOnMap(channel.id, {
|
|
20776
|
+
messageId: message.id,
|
|
20777
|
+
params: {}
|
|
20778
|
+
}, obj);
|
|
20779
|
+
updateMessageOnAllMessages(message.id, {}, obj);
|
|
20780
|
+
_context19.n = 4;
|
|
20781
|
+
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
20782
|
+
case 4:
|
|
20781
20783
|
if (!channel) {
|
|
20782
20784
|
_context19.n = 5;
|
|
20783
20785
|
break;
|
|
20784
20786
|
}
|
|
20785
|
-
_context19.n =
|
|
20787
|
+
_context19.n = 5;
|
|
20786
20788
|
return call(channel.addVote, message.id, pollId, [optionId]);
|
|
20787
|
-
case 4:
|
|
20788
|
-
result = _context19.v;
|
|
20789
|
-
console.log('result', result);
|
|
20790
20789
|
case 5:
|
|
20790
|
+
_i2++;
|
|
20791
|
+
_context19.n = 3;
|
|
20792
|
+
break;
|
|
20793
|
+
case 6:
|
|
20791
20794
|
return _context19.a(2);
|
|
20792
20795
|
}
|
|
20793
20796
|
}, _marked17$1);
|
|
20794
20797
|
}
|
|
20795
|
-
function updateMessageOptimisticallyForAddPollVote(channelId,
|
|
20796
|
-
var
|
|
20797
|
-
var channel, pollDetails;
|
|
20798
|
+
function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
20799
|
+
var channel, obj;
|
|
20798
20800
|
return _regenerator().w(function (_context20) {
|
|
20799
20801
|
while (1) switch (_context20.n) {
|
|
20800
20802
|
case 0:
|
|
@@ -20814,27 +20816,25 @@ function updateMessageOptimisticallyForAddPollVote(channelId, optionId, message)
|
|
|
20814
20816
|
}
|
|
20815
20817
|
return _context20.a(2);
|
|
20816
20818
|
case 3:
|
|
20817
|
-
|
|
20819
|
+
obj = {
|
|
20820
|
+
type: 'addOwn',
|
|
20821
|
+
vote: vote,
|
|
20822
|
+
incrementVotesPerOptionCount: 1
|
|
20823
|
+
};
|
|
20818
20824
|
updateMessageOnMap(channel.id, {
|
|
20819
20825
|
messageId: message.id,
|
|
20820
|
-
params: {
|
|
20821
|
-
|
|
20822
|
-
|
|
20823
|
-
});
|
|
20824
|
-
updateMessageOnAllMessages(message.id, JSON.parse(JSON.stringify({
|
|
20825
|
-
pollDetails: pollDetails
|
|
20826
|
-
})));
|
|
20826
|
+
params: {}
|
|
20827
|
+
}, obj);
|
|
20828
|
+
updateMessageOnAllMessages(message.id, {}, obj);
|
|
20827
20829
|
_context20.n = 4;
|
|
20828
|
-
return put(updateMessageAC(message.id, {
|
|
20829
|
-
pollDetails: pollDetails
|
|
20830
|
-
}));
|
|
20830
|
+
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
20831
20831
|
case 4:
|
|
20832
20832
|
return _context20.a(2);
|
|
20833
20833
|
}
|
|
20834
20834
|
}, _marked18$1);
|
|
20835
20835
|
}
|
|
20836
20836
|
function addPollVote(action) {
|
|
20837
|
-
var payload, channelId, pollId, optionId, _message4, sceytChatClient,
|
|
20837
|
+
var payload, channelId, pollId, optionId, _message4, sceytChatClient, _user$presence2, connectionState, user, vote, pendingAction, conflictCheck, channel, _getMessagesFromMap2, _store$getState$Messa, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj, _t19;
|
|
20838
20838
|
return _regenerator().w(function (_context21) {
|
|
20839
20839
|
while (1) switch (_context21.p = _context21.n) {
|
|
20840
20840
|
case 0:
|
|
@@ -20847,6 +20847,28 @@ function addPollVote(action) {
|
|
|
20847
20847
|
break;
|
|
20848
20848
|
}
|
|
20849
20849
|
connectionState = sceytChatClient.connectionState;
|
|
20850
|
+
user = sceytChatClient.user;
|
|
20851
|
+
vote = {
|
|
20852
|
+
optionId: optionId,
|
|
20853
|
+
createdAt: new Date().getTime(),
|
|
20854
|
+
user: {
|
|
20855
|
+
id: user.id,
|
|
20856
|
+
presence: {
|
|
20857
|
+
status: ((_user$presence2 = user.presence) === null || _user$presence2 === void 0 ? void 0 : _user$presence2.status) || 'online'
|
|
20858
|
+
},
|
|
20859
|
+
profile: {
|
|
20860
|
+
avatar: user.avatarUrl || '',
|
|
20861
|
+
firstName: user.firstName,
|
|
20862
|
+
lastName: user.lastName,
|
|
20863
|
+
metadata: user.metadata || '',
|
|
20864
|
+
metadataMap: user.metadataMap || {},
|
|
20865
|
+
updatedAt: new Date().getTime(),
|
|
20866
|
+
username: user.username || '',
|
|
20867
|
+
createdAt: new Date().getTime()
|
|
20868
|
+
},
|
|
20869
|
+
createdAt: new Date().getTime()
|
|
20870
|
+
}
|
|
20871
|
+
};
|
|
20850
20872
|
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
20851
20873
|
_context21.n = 6;
|
|
20852
20874
|
break;
|
|
@@ -20874,31 +20896,22 @@ function addPollVote(action) {
|
|
|
20874
20896
|
currentMessage = ((_getMessagesFromMap2 = getMessagesFromMap(channelId)) === null || _getMessagesFromMap2 === void 0 ? void 0 : _getMessagesFromMap2.find(function (msg) {
|
|
20875
20897
|
return msg.id === _message4.id || msg.tid === _message4.id;
|
|
20876
20898
|
})) || _message4;
|
|
20877
|
-
hasVotedAnotherOption = (((_currentMessage$pollD = currentMessage.pollDetails) === null || _currentMessage$pollD === void 0 ? void 0 : (_currentMessage$pollD2 = _currentMessage$pollD.voteDetails) === null || _currentMessage$pollD2 === void 0 ? void 0 : _currentMessage$pollD2.ownVotes) || []).some(function (vote) {
|
|
20878
|
-
return vote.optionId !== optionId;
|
|
20879
|
-
});
|
|
20880
|
-
pollDetails = currentMessage.pollDetails;
|
|
20881
|
-
if (hasVotedAnotherOption && !((_pollDetails = pollDetails) !== null && _pollDetails !== void 0 && _pollDetails.allowMultipleVotes)) {
|
|
20882
|
-
pollDetails = updatePollDetails(pollDetails, optionId, false, false);
|
|
20883
|
-
}
|
|
20884
|
-
pollDetails = JSON.parse(JSON.stringify(updatePollDetails(pollDetails, optionId, true, ((_pollDetails2 = pollDetails) === null || _pollDetails2 === void 0 ? void 0 : _pollDetails2.allowMultipleVotes) || false)));
|
|
20885
20899
|
hasNext = ((_store$getState$Messa = store.getState().MessageReducer.pollVotesHasMore) === null || _store$getState$Messa === void 0 ? void 0 : _store$getState$Messa[pollId]) || false;
|
|
20886
20900
|
_context21.n = 2;
|
|
20887
|
-
return put(addPollVotesToListAC(pollId, optionId, [(_currentMessage$
|
|
20901
|
+
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, _message4.id));
|
|
20888
20902
|
case 2:
|
|
20903
|
+
obj = {
|
|
20904
|
+
type: 'addOwn',
|
|
20905
|
+
vote: vote,
|
|
20906
|
+
incrementVotesPerOptionCount: 1
|
|
20907
|
+
};
|
|
20889
20908
|
updateMessageOnMap(channel.id, {
|
|
20890
20909
|
messageId: _message4.id,
|
|
20891
|
-
params: {
|
|
20892
|
-
|
|
20893
|
-
|
|
20894
|
-
});
|
|
20895
|
-
updateMessageOnAllMessages(_message4.id, JSON.parse(JSON.stringify({
|
|
20896
|
-
pollDetails: pollDetails
|
|
20897
|
-
})));
|
|
20910
|
+
params: {}
|
|
20911
|
+
}, obj);
|
|
20912
|
+
updateMessageOnAllMessages(_message4.id, {}, obj);
|
|
20898
20913
|
_context21.n = 3;
|
|
20899
|
-
return put(updateMessageAC(_message4.id, {
|
|
20900
|
-
pollDetails: pollDetails
|
|
20901
|
-
}));
|
|
20914
|
+
return put(updateMessageAC(_message4.id, {}, undefined, obj));
|
|
20902
20915
|
case 3:
|
|
20903
20916
|
_context21.n = 5;
|
|
20904
20917
|
break;
|
|
@@ -20907,7 +20920,7 @@ function addPollVote(action) {
|
|
|
20907
20920
|
_context21.n = 5;
|
|
20908
20921
|
break;
|
|
20909
20922
|
}
|
|
20910
|
-
return _context21.d(_regeneratorValues(updateMessageOptimisticallyForAddPollVote(channelId,
|
|
20923
|
+
return _context21.d(_regeneratorValues(updateMessageOptimisticallyForAddPollVote(channelId, _message4, vote)), 5);
|
|
20911
20924
|
case 5:
|
|
20912
20925
|
if (!conflictCheck.shouldSkip) {
|
|
20913
20926
|
setPendingPollAction(pendingAction);
|
|
@@ -20928,8 +20941,8 @@ function addPollVote(action) {
|
|
|
20928
20941
|
}, _marked19$1, null, [[0, 8]]);
|
|
20929
20942
|
}
|
|
20930
20943
|
function executeDeletePollVote(channelId, pollId, optionId, message) {
|
|
20931
|
-
var _message$
|
|
20932
|
-
var channel,
|
|
20944
|
+
var _message$pollDetails5, _message$pollDetails6, _message$pollDetails7;
|
|
20945
|
+
var channel, vote, obj;
|
|
20933
20946
|
return _regenerator().w(function (_context22) {
|
|
20934
20947
|
while (1) switch (_context22.n) {
|
|
20935
20948
|
case 0:
|
|
@@ -20943,35 +20956,41 @@ function executeDeletePollVote(channelId, pollId, optionId, message) {
|
|
|
20943
20956
|
}
|
|
20944
20957
|
return _context22.a(2);
|
|
20945
20958
|
case 2:
|
|
20946
|
-
|
|
20947
|
-
|
|
20948
|
-
messageId: message.id,
|
|
20949
|
-
params: {
|
|
20950
|
-
pollDetails: pollDetails
|
|
20951
|
-
}
|
|
20952
|
-
});
|
|
20953
|
-
updateMessageOnAllMessages(message.id, {
|
|
20954
|
-
pollDetails: pollDetails
|
|
20959
|
+
vote = (_message$pollDetails5 = message.pollDetails) === null || _message$pollDetails5 === void 0 ? void 0 : (_message$pollDetails6 = _message$pollDetails5.voteDetails) === null || _message$pollDetails6 === void 0 ? void 0 : (_message$pollDetails7 = _message$pollDetails6.ownVotes) === null || _message$pollDetails7 === void 0 ? void 0 : _message$pollDetails7.find(function (vote) {
|
|
20960
|
+
return vote.optionId === optionId;
|
|
20955
20961
|
});
|
|
20956
|
-
|
|
20957
|
-
|
|
20958
|
-
|
|
20959
|
-
}
|
|
20962
|
+
if (vote) {
|
|
20963
|
+
_context22.n = 3;
|
|
20964
|
+
break;
|
|
20965
|
+
}
|
|
20966
|
+
return _context22.a(2);
|
|
20960
20967
|
case 3:
|
|
20968
|
+
obj = {
|
|
20969
|
+
type: 'deleteOwn',
|
|
20970
|
+
vote: vote,
|
|
20971
|
+
incrementVotesPerOptionCount: -1
|
|
20972
|
+
};
|
|
20973
|
+
updateMessageOnMap(channel.id, {
|
|
20974
|
+
messageId: message.id,
|
|
20975
|
+
params: {}
|
|
20976
|
+
}, obj);
|
|
20977
|
+
updateMessageOnAllMessages(message.id, {}, obj);
|
|
20978
|
+
_context22.n = 4;
|
|
20979
|
+
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
20980
|
+
case 4:
|
|
20961
20981
|
if (!channel) {
|
|
20962
|
-
_context22.n =
|
|
20982
|
+
_context22.n = 5;
|
|
20963
20983
|
break;
|
|
20964
20984
|
}
|
|
20965
|
-
_context22.n =
|
|
20985
|
+
_context22.n = 5;
|
|
20966
20986
|
return call(channel.deleteVote, message.id, pollId, [optionId]);
|
|
20967
|
-
case
|
|
20987
|
+
case 5:
|
|
20968
20988
|
return _context22.a(2);
|
|
20969
20989
|
}
|
|
20970
20990
|
}, _marked20$1);
|
|
20971
20991
|
}
|
|
20972
|
-
function updateMessageOptimisticallyForDeletePollVote(channelId,
|
|
20973
|
-
var
|
|
20974
|
-
var channel, pollDetails;
|
|
20992
|
+
function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote) {
|
|
20993
|
+
var channel, obj;
|
|
20975
20994
|
return _regenerator().w(function (_context23) {
|
|
20976
20995
|
while (1) switch (_context23.n) {
|
|
20977
20996
|
case 0:
|
|
@@ -20991,27 +21010,25 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, optionId, messa
|
|
|
20991
21010
|
}
|
|
20992
21011
|
return _context23.a(2);
|
|
20993
21012
|
case 3:
|
|
20994
|
-
|
|
21013
|
+
obj = {
|
|
21014
|
+
type: 'deleteOwn',
|
|
21015
|
+
vote: vote,
|
|
21016
|
+
incrementVotesPerOptionCount: -1
|
|
21017
|
+
};
|
|
20995
21018
|
updateMessageOnMap(channel.id, {
|
|
20996
21019
|
messageId: message.id,
|
|
20997
|
-
params: {
|
|
20998
|
-
|
|
20999
|
-
|
|
21000
|
-
});
|
|
21001
|
-
updateMessageOnAllMessages(message.id, {
|
|
21002
|
-
pollDetails: pollDetails
|
|
21003
|
-
});
|
|
21020
|
+
params: {}
|
|
21021
|
+
}, obj);
|
|
21022
|
+
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21004
21023
|
_context23.n = 4;
|
|
21005
|
-
return put(updateMessageAC(message.id, {
|
|
21006
|
-
pollDetails: pollDetails
|
|
21007
|
-
}));
|
|
21024
|
+
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21008
21025
|
case 4:
|
|
21009
21026
|
return _context23.a(2);
|
|
21010
21027
|
}
|
|
21011
21028
|
}, _marked21$1);
|
|
21012
21029
|
}
|
|
21013
21030
|
function deletePollVote(action) {
|
|
21014
|
-
var payload, channelId, pollId, optionId, _message5, sceytChatClient, connectionState, pendingAction, conflictCheck, channel, _getMessagesFromMap3,
|
|
21031
|
+
var payload, channelId, pollId, optionId, _message5, sceytChatClient, _message5$pollDetails, _message5$pollDetails2, _message5$pollDetails3, connectionState, vote, pendingAction, conflictCheck, channel, _getMessagesFromMap3, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj, _t20;
|
|
21015
21032
|
return _regenerator().w(function (_context24) {
|
|
21016
21033
|
while (1) switch (_context24.p = _context24.n) {
|
|
21017
21034
|
case 0:
|
|
@@ -21020,12 +21037,21 @@ function deletePollVote(action) {
|
|
|
21020
21037
|
channelId = payload.channelId, pollId = payload.pollId, optionId = payload.optionId, _message5 = payload.message;
|
|
21021
21038
|
sceytChatClient = getClient();
|
|
21022
21039
|
if (!sceytChatClient) {
|
|
21023
|
-
_context24.n =
|
|
21040
|
+
_context24.n = 8;
|
|
21024
21041
|
break;
|
|
21025
21042
|
}
|
|
21026
21043
|
connectionState = sceytChatClient.connectionState;
|
|
21044
|
+
vote = (_message5$pollDetails = _message5.pollDetails) === null || _message5$pollDetails === void 0 ? void 0 : (_message5$pollDetails2 = _message5$pollDetails.voteDetails) === null || _message5$pollDetails2 === void 0 ? void 0 : (_message5$pollDetails3 = _message5$pollDetails2.ownVotes) === null || _message5$pollDetails3 === void 0 ? void 0 : _message5$pollDetails3.find(function (vote) {
|
|
21045
|
+
return vote.optionId === optionId;
|
|
21046
|
+
});
|
|
21047
|
+
if (vote) {
|
|
21048
|
+
_context24.n = 1;
|
|
21049
|
+
break;
|
|
21050
|
+
}
|
|
21051
|
+
return _context24.a(2);
|
|
21052
|
+
case 1:
|
|
21027
21053
|
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21028
|
-
_context24.n =
|
|
21054
|
+
_context24.n = 7;
|
|
21029
21055
|
break;
|
|
21030
21056
|
}
|
|
21031
21057
|
pendingAction = {
|
|
@@ -21037,67 +21063,65 @@ function deletePollVote(action) {
|
|
|
21037
21063
|
};
|
|
21038
21064
|
conflictCheck = checkPendingPollActionConflict(pendingAction);
|
|
21039
21065
|
if (!(conflictCheck.hasConflict && conflictCheck.shouldSkip)) {
|
|
21040
|
-
_context24.n =
|
|
21066
|
+
_context24.n = 5;
|
|
21041
21067
|
break;
|
|
21042
21068
|
}
|
|
21043
|
-
_context24.n =
|
|
21069
|
+
_context24.n = 2;
|
|
21044
21070
|
return call(getChannelFromMap, channelId);
|
|
21045
|
-
case
|
|
21071
|
+
case 2:
|
|
21046
21072
|
channel = _context24.v;
|
|
21047
21073
|
if (!channel) {
|
|
21048
|
-
_context24.n =
|
|
21074
|
+
_context24.n = 4;
|
|
21049
21075
|
break;
|
|
21050
21076
|
}
|
|
21051
21077
|
currentMessage = ((_getMessagesFromMap3 = getMessagesFromMap(channelId)) === null || _getMessagesFromMap3 === void 0 ? void 0 : _getMessagesFromMap3.find(function (msg) {
|
|
21052
21078
|
return msg.id === _message5.id || msg.tid === _message5.id;
|
|
21053
21079
|
})) || _message5;
|
|
21054
|
-
pollDetails = JSON.parse(JSON.stringify(updatePollDetails(currentMessage.pollDetails, optionId, false, ((_message5$pollDetails = _message5.pollDetails) === null || _message5$pollDetails === void 0 ? void 0 : _message5$pollDetails.allowMultipleVotes) || false)));
|
|
21055
|
-
_context24.n = 2;
|
|
21056
|
-
return put(deletePollVotesFromListAC(pollId, optionId, [(_currentMessage$pollD6 = currentMessage.pollDetails) === null || _currentMessage$pollD6 === void 0 ? void 0 : (_currentMessage$pollD7 = _currentMessage$pollD6.voteDetails) === null || _currentMessage$pollD7 === void 0 ? void 0 : (_currentMessage$pollD8 = _currentMessage$pollD7.ownVotes) === null || _currentMessage$pollD8 === void 0 ? void 0 : _currentMessage$pollD8[0]], _message5.id));
|
|
21057
|
-
case 2:
|
|
21058
|
-
updateMessageOnMap(channel.id, {
|
|
21059
|
-
messageId: _message5.id,
|
|
21060
|
-
params: {
|
|
21061
|
-
pollDetails: pollDetails
|
|
21062
|
-
}
|
|
21063
|
-
});
|
|
21064
|
-
updateMessageOnAllMessages(_message5.id, JSON.parse(JSON.stringify({
|
|
21065
|
-
pollDetails: pollDetails
|
|
21066
|
-
})));
|
|
21067
21080
|
_context24.n = 3;
|
|
21068
|
-
return put(
|
|
21069
|
-
pollDetails: pollDetails
|
|
21070
|
-
}));
|
|
21081
|
+
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]], _message5.id));
|
|
21071
21082
|
case 3:
|
|
21072
|
-
|
|
21073
|
-
|
|
21083
|
+
obj = {
|
|
21084
|
+
type: 'deleteOwn',
|
|
21085
|
+
vote: vote,
|
|
21086
|
+
incrementVotesPerOptionCount: -1
|
|
21087
|
+
};
|
|
21088
|
+
updateMessageOnMap(channel.id, {
|
|
21089
|
+
messageId: _message5.id,
|
|
21090
|
+
params: {}
|
|
21091
|
+
}, obj);
|
|
21092
|
+
updateMessageOnAllMessages(_message5.id, {}, obj);
|
|
21093
|
+
_context24.n = 4;
|
|
21094
|
+
return put(updateMessageAC(_message5.id, {}, undefined, obj));
|
|
21074
21095
|
case 4:
|
|
21096
|
+
_context24.n = 6;
|
|
21097
|
+
break;
|
|
21098
|
+
case 5:
|
|
21075
21099
|
if (conflictCheck.shouldSkip) {
|
|
21076
|
-
_context24.n =
|
|
21100
|
+
_context24.n = 6;
|
|
21077
21101
|
break;
|
|
21078
21102
|
}
|
|
21079
|
-
return _context24.d(_regeneratorValues(updateMessageOptimisticallyForDeletePollVote(channelId,
|
|
21080
|
-
case
|
|
21103
|
+
return _context24.d(_regeneratorValues(updateMessageOptimisticallyForDeletePollVote(channelId, _message5, vote)), 6);
|
|
21104
|
+
case 6:
|
|
21081
21105
|
if (!conflictCheck.shouldSkip) {
|
|
21082
21106
|
setPendingPollAction(pendingAction);
|
|
21083
21107
|
}
|
|
21084
21108
|
return _context24.a(2);
|
|
21085
|
-
case 6:
|
|
21086
|
-
return _context24.d(_regeneratorValues(executeDeletePollVote(channelId, pollId, optionId, _message5)), 7);
|
|
21087
21109
|
case 7:
|
|
21088
|
-
_context24.
|
|
21089
|
-
break;
|
|
21110
|
+
return _context24.d(_regeneratorValues(executeDeletePollVote(channelId, pollId, optionId, _message5)), 8);
|
|
21090
21111
|
case 8:
|
|
21091
|
-
_context24.
|
|
21112
|
+
_context24.n = 10;
|
|
21113
|
+
break;
|
|
21114
|
+
case 9:
|
|
21115
|
+
_context24.p = 9;
|
|
21092
21116
|
_t20 = _context24.v;
|
|
21093
21117
|
log.error('error in delete poll vote', _t20);
|
|
21094
|
-
case
|
|
21118
|
+
case 10:
|
|
21095
21119
|
return _context24.a(2);
|
|
21096
21120
|
}
|
|
21097
|
-
}, _marked22$1, null, [[0,
|
|
21121
|
+
}, _marked22$1, null, [[0, 9]]);
|
|
21098
21122
|
}
|
|
21099
21123
|
function executeClosePoll(channelId, pollId, message) {
|
|
21100
|
-
var channel,
|
|
21124
|
+
var channel, obj;
|
|
21101
21125
|
return _regenerator().w(function (_context25) {
|
|
21102
21126
|
while (1) switch (_context25.n) {
|
|
21103
21127
|
case 0:
|
|
@@ -21105,22 +21129,17 @@ function executeClosePoll(channelId, pollId, message) {
|
|
|
21105
21129
|
return call(getChannelFromMap, channelId);
|
|
21106
21130
|
case 1:
|
|
21107
21131
|
channel = _context25.v;
|
|
21108
|
-
|
|
21109
|
-
|
|
21110
|
-
|
|
21111
|
-
|
|
21132
|
+
obj = {
|
|
21133
|
+
type: 'close',
|
|
21134
|
+
incrementVotesPerOptionCount: 0
|
|
21135
|
+
};
|
|
21136
|
+
updateMessageOnMap(channel.id, {
|
|
21112
21137
|
messageId: message.id,
|
|
21113
|
-
params: {
|
|
21114
|
-
|
|
21115
|
-
|
|
21116
|
-
});
|
|
21117
|
-
updateMessageOnAllMessages(message.id, {
|
|
21118
|
-
pollDetails: pollDetails
|
|
21119
|
-
});
|
|
21138
|
+
params: {}
|
|
21139
|
+
}, obj);
|
|
21140
|
+
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21120
21141
|
_context25.n = 2;
|
|
21121
|
-
return put(updateMessageAC(message.id, {
|
|
21122
|
-
pollDetails: pollDetails
|
|
21123
|
-
}));
|
|
21142
|
+
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21124
21143
|
case 2:
|
|
21125
21144
|
if (!channel) {
|
|
21126
21145
|
_context25.n = 3;
|
|
@@ -21210,8 +21229,8 @@ function closePoll(action) {
|
|
|
21210
21229
|
}
|
|
21211
21230
|
}, _marked25$1, null, [[0, 4]]);
|
|
21212
21231
|
}
|
|
21213
|
-
function executeRetractPollVote(channelId, pollId, message) {
|
|
21214
|
-
var channel,
|
|
21232
|
+
function executeRetractPollVote(channelId, pollId, message, objs) {
|
|
21233
|
+
var channel, _iterator, _step, obj;
|
|
21215
21234
|
return _regenerator().w(function (_context28) {
|
|
21216
21235
|
while (1) switch (_context28.n) {
|
|
21217
21236
|
case 0:
|
|
@@ -21219,41 +21238,37 @@ function executeRetractPollVote(channelId, pollId, message) {
|
|
|
21219
21238
|
return call(getChannelFromMap, channelId);
|
|
21220
21239
|
case 1:
|
|
21221
21240
|
channel = _context28.v;
|
|
21222
|
-
|
|
21223
|
-
|
|
21224
|
-
|
|
21225
|
-
|
|
21241
|
+
_iterator = _createForOfIteratorHelperLoose(objs);
|
|
21242
|
+
case 2:
|
|
21243
|
+
if ((_step = _iterator()).done) {
|
|
21244
|
+
_context28.n = 4;
|
|
21245
|
+
break;
|
|
21226
21246
|
}
|
|
21247
|
+
obj = _step.value;
|
|
21227
21248
|
updateMessageOnMap(channelId, {
|
|
21228
21249
|
messageId: message.id,
|
|
21229
|
-
params: {
|
|
21230
|
-
|
|
21231
|
-
|
|
21232
|
-
|
|
21233
|
-
|
|
21234
|
-
|
|
21235
|
-
});
|
|
21250
|
+
params: {}
|
|
21251
|
+
}, obj);
|
|
21252
|
+
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21253
|
+
_context28.n = 3;
|
|
21254
|
+
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21255
|
+
case 3:
|
|
21236
21256
|
_context28.n = 2;
|
|
21237
|
-
|
|
21238
|
-
|
|
21239
|
-
}));
|
|
21240
|
-
case 2:
|
|
21257
|
+
break;
|
|
21258
|
+
case 4:
|
|
21241
21259
|
if (!channel) {
|
|
21242
|
-
_context28.n =
|
|
21260
|
+
_context28.n = 5;
|
|
21243
21261
|
break;
|
|
21244
21262
|
}
|
|
21245
|
-
_context28.n =
|
|
21263
|
+
_context28.n = 5;
|
|
21246
21264
|
return call(channel.retractVote, message.id, pollId);
|
|
21247
|
-
case
|
|
21248
|
-
result = _context28.v;
|
|
21249
|
-
console.log('result', result);
|
|
21250
|
-
case 4:
|
|
21265
|
+
case 5:
|
|
21251
21266
|
return _context28.a(2);
|
|
21252
21267
|
}
|
|
21253
21268
|
}, _marked26$1);
|
|
21254
21269
|
}
|
|
21255
|
-
function updateMessageOptimisticallyForRetractPollVote(channelId, message) {
|
|
21256
|
-
var channel,
|
|
21270
|
+
function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs) {
|
|
21271
|
+
var channel, _iterator2, _step2, obj;
|
|
21257
21272
|
return _regenerator().w(function (_context29) {
|
|
21258
21273
|
while (1) switch (_context29.n) {
|
|
21259
21274
|
case 0:
|
|
@@ -21267,31 +21282,30 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message) {
|
|
|
21267
21282
|
}
|
|
21268
21283
|
return _context29.a(2);
|
|
21269
21284
|
case 2:
|
|
21270
|
-
|
|
21271
|
-
|
|
21272
|
-
|
|
21273
|
-
|
|
21285
|
+
_iterator2 = _createForOfIteratorHelperLoose(objs);
|
|
21286
|
+
case 3:
|
|
21287
|
+
if ((_step2 = _iterator2()).done) {
|
|
21288
|
+
_context29.n = 5;
|
|
21289
|
+
break;
|
|
21274
21290
|
}
|
|
21291
|
+
obj = _step2.value;
|
|
21275
21292
|
updateMessageOnMap(channelId, {
|
|
21276
21293
|
messageId: message.id,
|
|
21277
|
-
params: {
|
|
21278
|
-
pollDetails: pollDetails
|
|
21279
|
-
}
|
|
21280
|
-
});
|
|
21281
|
-
updateMessageOnAllMessages(message.id, {
|
|
21282
|
-
pollDetails: pollDetails
|
|
21294
|
+
params: {}
|
|
21283
21295
|
});
|
|
21296
|
+
updateMessageOnAllMessages(message.id, {}, obj);
|
|
21297
|
+
_context29.n = 4;
|
|
21298
|
+
return put(updateMessageAC(message.id, {}, undefined, obj));
|
|
21299
|
+
case 4:
|
|
21284
21300
|
_context29.n = 3;
|
|
21285
|
-
|
|
21286
|
-
|
|
21287
|
-
}));
|
|
21288
|
-
case 3:
|
|
21301
|
+
break;
|
|
21302
|
+
case 5:
|
|
21289
21303
|
return _context29.a(2);
|
|
21290
21304
|
}
|
|
21291
21305
|
}, _marked27$1);
|
|
21292
21306
|
}
|
|
21293
21307
|
function retractPollVote(action) {
|
|
21294
|
-
var payload, channelId, pollId, _message7, sceytChatClient, connectionState, _t22;
|
|
21308
|
+
var payload, channelId, pollId, _message7, sceytChatClient, connectionState, objs, _iterator3, _step3, _message7$pollDetails, _message7$pollDetails2, vote, _t22;
|
|
21295
21309
|
return _regenerator().w(function (_context30) {
|
|
21296
21310
|
while (1) switch (_context30.p = _context30.n) {
|
|
21297
21311
|
case 0:
|
|
@@ -21304,11 +21318,20 @@ function retractPollVote(action) {
|
|
|
21304
21318
|
break;
|
|
21305
21319
|
}
|
|
21306
21320
|
connectionState = sceytChatClient.connectionState;
|
|
21321
|
+
objs = [];
|
|
21322
|
+
for (_iterator3 = _createForOfIteratorHelperLoose(((_message7$pollDetails = _message7.pollDetails) === null || _message7$pollDetails === void 0 ? void 0 : (_message7$pollDetails2 = _message7$pollDetails.voteDetails) === null || _message7$pollDetails2 === void 0 ? void 0 : _message7$pollDetails2.ownVotes) || []); !(_step3 = _iterator3()).done;) {
|
|
21323
|
+
vote = _step3.value;
|
|
21324
|
+
objs.push({
|
|
21325
|
+
type: 'deleteOwn',
|
|
21326
|
+
vote: vote,
|
|
21327
|
+
incrementVotesPerOptionCount: -1
|
|
21328
|
+
});
|
|
21329
|
+
}
|
|
21307
21330
|
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
21308
21331
|
_context30.n = 2;
|
|
21309
21332
|
break;
|
|
21310
21333
|
}
|
|
21311
|
-
return _context30.d(_regeneratorValues(updateMessageOptimisticallyForRetractPollVote(channelId, _message7)), 1);
|
|
21334
|
+
return _context30.d(_regeneratorValues(updateMessageOptimisticallyForRetractPollVote(channelId, _message7, objs)), 1);
|
|
21312
21335
|
case 1:
|
|
21313
21336
|
setPendingPollAction({
|
|
21314
21337
|
type: 'RETRACT_POLL_VOTE',
|
|
@@ -21318,7 +21341,7 @@ function retractPollVote(action) {
|
|
|
21318
21341
|
});
|
|
21319
21342
|
return _context30.a(2);
|
|
21320
21343
|
case 2:
|
|
21321
|
-
return _context30.d(_regeneratorValues(executeRetractPollVote(channelId, pollId, _message7)), 3);
|
|
21344
|
+
return _context30.d(_regeneratorValues(executeRetractPollVote(channelId, pollId, _message7, objs)), 3);
|
|
21322
21345
|
case 3:
|
|
21323
21346
|
_context30.n = 5;
|
|
21324
21347
|
break;
|
|
@@ -34188,20 +34211,14 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
|
|
|
34188
34211
|
var optionIdToVotes = useMemo(function () {
|
|
34189
34212
|
var votes = {};
|
|
34190
34213
|
poll.options.forEach(function (opt) {
|
|
34191
|
-
var _poll$voteDetails;
|
|
34214
|
+
var _poll$voteDetails, _poll$voteDetails2;
|
|
34192
34215
|
var allOptionVotes = (((_poll$voteDetails = poll.voteDetails) === null || _poll$voteDetails === void 0 ? void 0 : _poll$voteDetails.votes) || []).filter(function (vote) {
|
|
34193
34216
|
return vote.optionId === opt.id;
|
|
34194
34217
|
});
|
|
34195
|
-
|
|
34196
|
-
|
|
34197
|
-
|
|
34198
|
-
|
|
34199
|
-
});
|
|
34200
|
-
if (ownVote) {
|
|
34201
|
-
allOptionVotes.push(ownVote);
|
|
34202
|
-
}
|
|
34203
|
-
}
|
|
34204
|
-
votes[opt.id] = allOptionVotes;
|
|
34218
|
+
var ownVote = (_poll$voteDetails2 = poll.voteDetails) === null || _poll$voteDetails2 === void 0 ? void 0 : _poll$voteDetails2.ownVotes.find(function (vote) {
|
|
34219
|
+
return vote.optionId === opt.id;
|
|
34220
|
+
});
|
|
34221
|
+
votes[opt.id] = [].concat(ownVote ? [ownVote] : [], (allOptionVotes === null || allOptionVotes === void 0 ? void 0 : allOptionVotes.slice(0, ownVote ? 4 : 5)) || []);
|
|
34205
34222
|
});
|
|
34206
34223
|
return votes;
|
|
34207
34224
|
}, [(_poll$voteDetails3 = poll.voteDetails) === null || _poll$voteDetails3 === void 0 ? void 0 : _poll$voteDetails3.votes, poll.options, (_poll$voteDetails4 = poll.voteDetails) === null || _poll$voteDetails4 === void 0 ? void 0 : _poll$voteDetails4.ownVotes]);
|