sceyt-chat-react-uikit 1.6.9-beta.4 → 1.6.9-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 +68 -67
- package/index.modern.js +68 -67
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -16303,7 +16303,7 @@ function sendMessage(action) {
|
|
|
16303
16303
|
}, _marked$3, null, [[2, 80]]);
|
|
16304
16304
|
}
|
|
16305
16305
|
function sendTextMessage(action) {
|
|
16306
|
-
var payload, message, connectionState, channelId, channel, sendMessageTid, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage,
|
|
16306
|
+
var payload, message, connectionState, channelId, channel, sendMessageTid, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, messagesToAdd, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam;
|
|
16307
16307
|
return _regeneratorRuntime().wrap(function sendTextMessage$(_context4) {
|
|
16308
16308
|
while (1) switch (_context4.prev = _context4.next) {
|
|
16309
16309
|
case 0:
|
|
@@ -16375,51 +16375,32 @@ function sendTextMessage(action) {
|
|
|
16375
16375
|
pendingMessage.metadata = JSON.parse(pendingMessage.metadata);
|
|
16376
16376
|
}
|
|
16377
16377
|
_context4.next = 35;
|
|
16378
|
-
return effects.
|
|
16378
|
+
return effects.call(addPendingMessage, message, pendingMessage, channel);
|
|
16379
16379
|
case 35:
|
|
16380
|
-
hasNextMessages = _context4.sent;
|
|
16381
|
-
if (getHasNextCached()) {
|
|
16382
|
-
_context4.next = 44;
|
|
16383
|
-
break;
|
|
16384
|
-
}
|
|
16385
|
-
if (!hasNextMessages) {
|
|
16386
|
-
_context4.next = 42;
|
|
16387
|
-
break;
|
|
16388
|
-
}
|
|
16389
|
-
_context4.next = 40;
|
|
16390
|
-
return effects.put(getMessagesAC(channel));
|
|
16391
|
-
case 40:
|
|
16392
|
-
_context4.next = 44;
|
|
16393
|
-
break;
|
|
16394
|
-
case 42:
|
|
16395
|
-
_context4.next = 44;
|
|
16396
|
-
return effects.put(addMessageAC(JSON.parse(JSON.stringify(pendingMessage))));
|
|
16397
|
-
case 44:
|
|
16398
|
-
addAllMessages([pendingMessage], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
16399
16380
|
messagesToAdd = getFromAllMessagesByMessageId('', '', true);
|
|
16400
|
-
_context4.next =
|
|
16381
|
+
_context4.next = 38;
|
|
16401
16382
|
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(messagesToAdd))));
|
|
16402
|
-
case
|
|
16383
|
+
case 38:
|
|
16403
16384
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
16404
|
-
_context4.next =
|
|
16385
|
+
_context4.next = 64;
|
|
16405
16386
|
break;
|
|
16406
16387
|
}
|
|
16407
16388
|
if (!sendMessageHandler) {
|
|
16408
|
-
_context4.next =
|
|
16389
|
+
_context4.next = 45;
|
|
16409
16390
|
break;
|
|
16410
16391
|
}
|
|
16411
|
-
_context4.next =
|
|
16392
|
+
_context4.next = 42;
|
|
16412
16393
|
return effects.call(sendMessageHandler, messageToSend, channel.id);
|
|
16413
|
-
case
|
|
16394
|
+
case 42:
|
|
16414
16395
|
messageResponse = _context4.sent;
|
|
16415
|
-
_context4.next =
|
|
16396
|
+
_context4.next = 48;
|
|
16416
16397
|
break;
|
|
16417
|
-
case
|
|
16418
|
-
_context4.next =
|
|
16398
|
+
case 45:
|
|
16399
|
+
_context4.next = 47;
|
|
16419
16400
|
return effects.call(channel.sendMessage, messageToSend);
|
|
16420
|
-
case
|
|
16401
|
+
case 47:
|
|
16421
16402
|
messageResponse = _context4.sent;
|
|
16422
|
-
case
|
|
16403
|
+
case 48:
|
|
16423
16404
|
messageUpdateData = {
|
|
16424
16405
|
id: messageResponse.id,
|
|
16425
16406
|
body: messageResponse.body,
|
|
@@ -16435,9 +16416,9 @@ function sendTextMessage(action) {
|
|
|
16435
16416
|
repliedInThread: messageResponse.repliedInThread,
|
|
16436
16417
|
createdAt: messageResponse.createdAt
|
|
16437
16418
|
};
|
|
16438
|
-
_context4.next =
|
|
16419
|
+
_context4.next = 51;
|
|
16439
16420
|
return effects.put(updateMessageAC(messageToSend.tid, JSON.parse(JSON.stringify(messageUpdateData))));
|
|
16440
|
-
case
|
|
16421
|
+
case 51:
|
|
16441
16422
|
updateMessageOnMap(channel.id, {
|
|
16442
16423
|
messageId: messageToSend.tid,
|
|
16443
16424
|
params: messageUpdateData
|
|
@@ -16449,32 +16430,32 @@ function sendTextMessage(action) {
|
|
|
16449
16430
|
lastMessage: messageToUpdate,
|
|
16450
16431
|
lastReactedMessage: null
|
|
16451
16432
|
};
|
|
16452
|
-
_context4.next =
|
|
16433
|
+
_context4.next = 58;
|
|
16453
16434
|
return effects.put(updateChannelDataAC(channel.id, channelUpdateParam, true));
|
|
16454
|
-
case
|
|
16435
|
+
case 58:
|
|
16455
16436
|
updateChannelOnAllChannels(channel.id, channelUpdateParam);
|
|
16456
16437
|
if (!channel.unread) {
|
|
16457
|
-
_context4.next =
|
|
16438
|
+
_context4.next = 62;
|
|
16458
16439
|
break;
|
|
16459
16440
|
}
|
|
16460
|
-
_context4.next =
|
|
16441
|
+
_context4.next = 62;
|
|
16461
16442
|
return effects.put(markChannelAsReadAC(channel.id));
|
|
16462
|
-
case
|
|
16463
|
-
_context4.next =
|
|
16443
|
+
case 62:
|
|
16444
|
+
_context4.next = 65;
|
|
16464
16445
|
break;
|
|
16465
|
-
case
|
|
16446
|
+
case 64:
|
|
16466
16447
|
throw new Error('Connection required to send message');
|
|
16467
|
-
case
|
|
16468
|
-
_context4.next =
|
|
16448
|
+
case 65:
|
|
16449
|
+
_context4.next = 67;
|
|
16469
16450
|
return effects.put(scrollToNewMessageAC(true));
|
|
16470
|
-
case
|
|
16471
|
-
_context4.next =
|
|
16451
|
+
case 67:
|
|
16452
|
+
_context4.next = 69;
|
|
16472
16453
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
16473
|
-
case
|
|
16474
|
-
_context4.next =
|
|
16454
|
+
case 69:
|
|
16455
|
+
_context4.next = 80;
|
|
16475
16456
|
break;
|
|
16476
|
-
case
|
|
16477
|
-
_context4.prev =
|
|
16457
|
+
case 71:
|
|
16458
|
+
_context4.prev = 71;
|
|
16478
16459
|
_context4.t0 = _context4["catch"](8);
|
|
16479
16460
|
log.error('error on send text message ... ', _context4.t0);
|
|
16480
16461
|
updateMessageOnMap(channel.id, {
|
|
@@ -16486,18 +16467,18 @@ function sendTextMessage(action) {
|
|
|
16486
16467
|
updateMessageOnAllMessages(sendMessageTid, {
|
|
16487
16468
|
state: MESSAGE_STATUS.FAILED
|
|
16488
16469
|
});
|
|
16489
|
-
_context4.next =
|
|
16470
|
+
_context4.next = 78;
|
|
16490
16471
|
return effects.put(updateMessageAC(sendMessageTid, {
|
|
16491
16472
|
state: MESSAGE_STATUS.FAILED
|
|
16492
16473
|
}));
|
|
16493
|
-
case
|
|
16494
|
-
_context4.next =
|
|
16474
|
+
case 78:
|
|
16475
|
+
_context4.next = 80;
|
|
16495
16476
|
return effects.put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
16496
|
-
case
|
|
16477
|
+
case 80:
|
|
16497
16478
|
case "end":
|
|
16498
16479
|
return _context4.stop();
|
|
16499
16480
|
}
|
|
16500
|
-
}, _marked2$2, null, [[8,
|
|
16481
|
+
}, _marked2$2, null, [[8, 71]]);
|
|
16501
16482
|
}
|
|
16502
16483
|
function forwardMessage(action) {
|
|
16503
16484
|
var payload, message, channelId, connectionState, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam;
|
|
@@ -19966,7 +19947,7 @@ var LastMessageAuthor = styled__default.div(_templateObject9$1 || (_templateObje
|
|
|
19966
19947
|
var Points = styled__default.span(_templateObject0$1 || (_templateObject0$1 = _taggedTemplateLiteralLoose(["\n margin-right: 4px;\n color: ", ";\n font-style: normal;\n"])), function (props) {
|
|
19967
19948
|
return props.color;
|
|
19968
19949
|
});
|
|
19969
|
-
var LastMessageText = styled__default.span(_templateObject1$1 || (_templateObject1$1 = _taggedTemplateLiteralLoose(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n font-style: ", ";\n transform: ", ";\n //height: 20px;\n\n > svg {\n width: 16px;\n height: 16px;\n min-width: 16px;\n min-height: 16px;\n margin-right: 4px;\n color: ", ";\n transform: translate(0px, 3px);\n }\n & > span {\n display:
|
|
19950
|
+
var LastMessageText = styled__default.span(_templateObject1$1 || (_templateObject1$1 = _taggedTemplateLiteralLoose(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n font-style: ", ";\n transform: ", ";\n //height: 20px;\n\n > svg {\n width: 16px;\n height: 16px;\n min-width: 16px;\n min-height: 16px;\n margin-right: 4px;\n color: ", ";\n transform: translate(0px, 3px);\n }\n & > span {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n }\n & > div {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n & > svg {\n width: 18px;\n height: 18px;\n min-width: 18px;\n min-height: 18px;\n color: ", ";\n }\n }\n"])), function (props) {
|
|
19970
19951
|
return props.color;
|
|
19971
19952
|
}, function (props) {
|
|
19972
19953
|
return props.deletedMessage && 'italic';
|
|
@@ -31305,9 +31286,11 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31305
31286
|
setIsDragging(false);
|
|
31306
31287
|
if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {
|
|
31307
31288
|
var fileList = Object.values(e.dataTransfer.files);
|
|
31308
|
-
var attachmentsFiles = [];
|
|
31309
31289
|
new Promise(function (resolve) {
|
|
31310
|
-
|
|
31290
|
+
var attachmentsFiles = [];
|
|
31291
|
+
var readFiles = 0;
|
|
31292
|
+
var errorCount = 0;
|
|
31293
|
+
fileList.forEach(function (attachment) {
|
|
31311
31294
|
var fileReader = new FileReader();
|
|
31312
31295
|
fileReader.onload = function (event) {
|
|
31313
31296
|
var file = event.target.result;
|
|
@@ -31316,14 +31299,23 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31316
31299
|
data: file,
|
|
31317
31300
|
type: attachment.type
|
|
31318
31301
|
});
|
|
31319
|
-
|
|
31320
|
-
|
|
31302
|
+
readFiles++;
|
|
31303
|
+
if (readFiles + errorCount === fileList.length) {
|
|
31304
|
+
resolve(attachmentsFiles);
|
|
31305
|
+
}
|
|
31306
|
+
};
|
|
31307
|
+
fileReader.onerror = function () {
|
|
31308
|
+
errorCount++;
|
|
31309
|
+
if (readFiles + errorCount === fileList.length) {
|
|
31310
|
+
resolve(attachmentsFiles);
|
|
31321
31311
|
}
|
|
31322
31312
|
};
|
|
31323
31313
|
fileReader.readAsDataURL(attachment);
|
|
31324
31314
|
});
|
|
31325
|
-
}).then(function () {
|
|
31326
|
-
dispatch(setDraggedAttachmentsAC(
|
|
31315
|
+
}).then(function (result) {
|
|
31316
|
+
dispatch(setDraggedAttachmentsAC(result, 'file'));
|
|
31317
|
+
})["catch"](function (error) {
|
|
31318
|
+
console.error('Error in handleDropFile:', error);
|
|
31327
31319
|
});
|
|
31328
31320
|
e.dataTransfer.clearData();
|
|
31329
31321
|
}
|
|
@@ -31334,9 +31326,10 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31334
31326
|
setIsDragging(false);
|
|
31335
31327
|
if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {
|
|
31336
31328
|
var fileList = Object.values(e.dataTransfer.files);
|
|
31337
|
-
var attachmentsFiles = [];
|
|
31338
31329
|
new Promise(function (resolve) {
|
|
31330
|
+
var attachmentsFiles = [];
|
|
31339
31331
|
var readFiles = 0;
|
|
31332
|
+
var errorCount = 0;
|
|
31340
31333
|
fileList.forEach(function (attachment) {
|
|
31341
31334
|
var fileReader = new FileReader();
|
|
31342
31335
|
fileReader.onload = function (event) {
|
|
@@ -31347,14 +31340,22 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31347
31340
|
type: attachment.type
|
|
31348
31341
|
});
|
|
31349
31342
|
readFiles++;
|
|
31350
|
-
if (fileList.length
|
|
31351
|
-
resolve();
|
|
31343
|
+
if (readFiles + errorCount === fileList.length) {
|
|
31344
|
+
resolve(attachmentsFiles);
|
|
31345
|
+
}
|
|
31346
|
+
};
|
|
31347
|
+
fileReader.onerror = function () {
|
|
31348
|
+
errorCount++;
|
|
31349
|
+
if (readFiles + errorCount === fileList.length) {
|
|
31350
|
+
resolve(attachmentsFiles);
|
|
31352
31351
|
}
|
|
31353
31352
|
};
|
|
31354
31353
|
fileReader.readAsDataURL(attachment);
|
|
31355
31354
|
});
|
|
31356
|
-
}).then(function () {
|
|
31357
|
-
dispatch(setDraggedAttachmentsAC(
|
|
31355
|
+
}).then(function (result) {
|
|
31356
|
+
dispatch(setDraggedAttachmentsAC(result, 'media'));
|
|
31357
|
+
})["catch"](function (error) {
|
|
31358
|
+
console.error('Error in handleDropMedia:', error);
|
|
31358
31359
|
});
|
|
31359
31360
|
e.dataTransfer.clearData();
|
|
31360
31361
|
}
|
|
@@ -31848,7 +31849,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31848
31849
|
attachmentsPreview: attachmentsPreview
|
|
31849
31850
|
})))));
|
|
31850
31851
|
};
|
|
31851
|
-
var Container$h = styled__default.div(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column-reverse;\n flex-grow: 1;\n position: relative;\n overflow: auto;\n scroll-behavior: smooth;\n will-change: left, top;\n background-color: ", ";\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
|
|
31852
|
+
var Container$h = styled__default.div(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column-reverse;\n flex-grow: 1;\n position: relative;\n overflow: auto;\n scroll-behavior: smooth;\n will-change: left, top;\n background-color: ", ";\n overflow-x: hidden;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
|
|
31852
31853
|
return props.backgroundColor;
|
|
31853
31854
|
}, function (props) {
|
|
31854
31855
|
return props.thumbColor;
|
package/index.modern.js
CHANGED
|
@@ -16280,7 +16280,7 @@ function sendMessage(action) {
|
|
|
16280
16280
|
}, _marked$3, null, [[2, 80]]);
|
|
16281
16281
|
}
|
|
16282
16282
|
function sendTextMessage(action) {
|
|
16283
|
-
var payload, message, connectionState, channelId, channel, sendMessageTid, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage,
|
|
16283
|
+
var payload, message, connectionState, channelId, channel, sendMessageTid, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, messagesToAdd, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam;
|
|
16284
16284
|
return _regeneratorRuntime().wrap(function sendTextMessage$(_context4) {
|
|
16285
16285
|
while (1) switch (_context4.prev = _context4.next) {
|
|
16286
16286
|
case 0:
|
|
@@ -16352,51 +16352,32 @@ function sendTextMessage(action) {
|
|
|
16352
16352
|
pendingMessage.metadata = JSON.parse(pendingMessage.metadata);
|
|
16353
16353
|
}
|
|
16354
16354
|
_context4.next = 35;
|
|
16355
|
-
return
|
|
16355
|
+
return call(addPendingMessage, message, pendingMessage, channel);
|
|
16356
16356
|
case 35:
|
|
16357
|
-
hasNextMessages = _context4.sent;
|
|
16358
|
-
if (getHasNextCached()) {
|
|
16359
|
-
_context4.next = 44;
|
|
16360
|
-
break;
|
|
16361
|
-
}
|
|
16362
|
-
if (!hasNextMessages) {
|
|
16363
|
-
_context4.next = 42;
|
|
16364
|
-
break;
|
|
16365
|
-
}
|
|
16366
|
-
_context4.next = 40;
|
|
16367
|
-
return put(getMessagesAC(channel));
|
|
16368
|
-
case 40:
|
|
16369
|
-
_context4.next = 44;
|
|
16370
|
-
break;
|
|
16371
|
-
case 42:
|
|
16372
|
-
_context4.next = 44;
|
|
16373
|
-
return put(addMessageAC(JSON.parse(JSON.stringify(pendingMessage))));
|
|
16374
|
-
case 44:
|
|
16375
|
-
addAllMessages([pendingMessage], MESSAGE_LOAD_DIRECTION.NEXT);
|
|
16376
16357
|
messagesToAdd = getFromAllMessagesByMessageId('', '', true);
|
|
16377
|
-
_context4.next =
|
|
16358
|
+
_context4.next = 38;
|
|
16378
16359
|
return put(setMessagesAC(JSON.parse(JSON.stringify(messagesToAdd))));
|
|
16379
|
-
case
|
|
16360
|
+
case 38:
|
|
16380
16361
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
16381
|
-
_context4.next =
|
|
16362
|
+
_context4.next = 64;
|
|
16382
16363
|
break;
|
|
16383
16364
|
}
|
|
16384
16365
|
if (!sendMessageHandler) {
|
|
16385
|
-
_context4.next =
|
|
16366
|
+
_context4.next = 45;
|
|
16386
16367
|
break;
|
|
16387
16368
|
}
|
|
16388
|
-
_context4.next =
|
|
16369
|
+
_context4.next = 42;
|
|
16389
16370
|
return call(sendMessageHandler, messageToSend, channel.id);
|
|
16390
|
-
case
|
|
16371
|
+
case 42:
|
|
16391
16372
|
messageResponse = _context4.sent;
|
|
16392
|
-
_context4.next =
|
|
16373
|
+
_context4.next = 48;
|
|
16393
16374
|
break;
|
|
16394
|
-
case
|
|
16395
|
-
_context4.next =
|
|
16375
|
+
case 45:
|
|
16376
|
+
_context4.next = 47;
|
|
16396
16377
|
return call(channel.sendMessage, messageToSend);
|
|
16397
|
-
case
|
|
16378
|
+
case 47:
|
|
16398
16379
|
messageResponse = _context4.sent;
|
|
16399
|
-
case
|
|
16380
|
+
case 48:
|
|
16400
16381
|
messageUpdateData = {
|
|
16401
16382
|
id: messageResponse.id,
|
|
16402
16383
|
body: messageResponse.body,
|
|
@@ -16412,9 +16393,9 @@ function sendTextMessage(action) {
|
|
|
16412
16393
|
repliedInThread: messageResponse.repliedInThread,
|
|
16413
16394
|
createdAt: messageResponse.createdAt
|
|
16414
16395
|
};
|
|
16415
|
-
_context4.next =
|
|
16396
|
+
_context4.next = 51;
|
|
16416
16397
|
return put(updateMessageAC(messageToSend.tid, JSON.parse(JSON.stringify(messageUpdateData))));
|
|
16417
|
-
case
|
|
16398
|
+
case 51:
|
|
16418
16399
|
updateMessageOnMap(channel.id, {
|
|
16419
16400
|
messageId: messageToSend.tid,
|
|
16420
16401
|
params: messageUpdateData
|
|
@@ -16426,32 +16407,32 @@ function sendTextMessage(action) {
|
|
|
16426
16407
|
lastMessage: messageToUpdate,
|
|
16427
16408
|
lastReactedMessage: null
|
|
16428
16409
|
};
|
|
16429
|
-
_context4.next =
|
|
16410
|
+
_context4.next = 58;
|
|
16430
16411
|
return put(updateChannelDataAC(channel.id, channelUpdateParam, true));
|
|
16431
|
-
case
|
|
16412
|
+
case 58:
|
|
16432
16413
|
updateChannelOnAllChannels(channel.id, channelUpdateParam);
|
|
16433
16414
|
if (!channel.unread) {
|
|
16434
|
-
_context4.next =
|
|
16415
|
+
_context4.next = 62;
|
|
16435
16416
|
break;
|
|
16436
16417
|
}
|
|
16437
|
-
_context4.next =
|
|
16418
|
+
_context4.next = 62;
|
|
16438
16419
|
return put(markChannelAsReadAC(channel.id));
|
|
16439
|
-
case
|
|
16440
|
-
_context4.next =
|
|
16420
|
+
case 62:
|
|
16421
|
+
_context4.next = 65;
|
|
16441
16422
|
break;
|
|
16442
|
-
case
|
|
16423
|
+
case 64:
|
|
16443
16424
|
throw new Error('Connection required to send message');
|
|
16444
|
-
case
|
|
16445
|
-
_context4.next =
|
|
16425
|
+
case 65:
|
|
16426
|
+
_context4.next = 67;
|
|
16446
16427
|
return put(scrollToNewMessageAC(true));
|
|
16447
|
-
case
|
|
16448
|
-
_context4.next =
|
|
16428
|
+
case 67:
|
|
16429
|
+
_context4.next = 69;
|
|
16449
16430
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
16450
|
-
case
|
|
16451
|
-
_context4.next =
|
|
16431
|
+
case 69:
|
|
16432
|
+
_context4.next = 80;
|
|
16452
16433
|
break;
|
|
16453
|
-
case
|
|
16454
|
-
_context4.prev =
|
|
16434
|
+
case 71:
|
|
16435
|
+
_context4.prev = 71;
|
|
16455
16436
|
_context4.t0 = _context4["catch"](8);
|
|
16456
16437
|
log.error('error on send text message ... ', _context4.t0);
|
|
16457
16438
|
updateMessageOnMap(channel.id, {
|
|
@@ -16463,18 +16444,18 @@ function sendTextMessage(action) {
|
|
|
16463
16444
|
updateMessageOnAllMessages(sendMessageTid, {
|
|
16464
16445
|
state: MESSAGE_STATUS.FAILED
|
|
16465
16446
|
});
|
|
16466
|
-
_context4.next =
|
|
16447
|
+
_context4.next = 78;
|
|
16467
16448
|
return put(updateMessageAC(sendMessageTid, {
|
|
16468
16449
|
state: MESSAGE_STATUS.FAILED
|
|
16469
16450
|
}));
|
|
16470
|
-
case
|
|
16471
|
-
_context4.next =
|
|
16451
|
+
case 78:
|
|
16452
|
+
_context4.next = 80;
|
|
16472
16453
|
return put(setMessagesLoadingStateAC(LOADING_STATE.LOADED));
|
|
16473
|
-
case
|
|
16454
|
+
case 80:
|
|
16474
16455
|
case "end":
|
|
16475
16456
|
return _context4.stop();
|
|
16476
16457
|
}
|
|
16477
|
-
}, _marked2$2, null, [[8,
|
|
16458
|
+
}, _marked2$2, null, [[8, 71]]);
|
|
16478
16459
|
}
|
|
16479
16460
|
function forwardMessage(action) {
|
|
16480
16461
|
var payload, message, channelId, connectionState, channel, SceytChatClient, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, messageToSend, pendingMessage, activeChannelId, isCachedChannel, hasNextMessages, messageResponse, messageUpdateData, messageToUpdate, channelUpdateParam;
|
|
@@ -19943,7 +19924,7 @@ var LastMessageAuthor = styled.div(_templateObject9$1 || (_templateObject9$1 = _
|
|
|
19943
19924
|
var Points = styled.span(_templateObject0$1 || (_templateObject0$1 = _taggedTemplateLiteralLoose(["\n margin-right: 4px;\n color: ", ";\n font-style: normal;\n"])), function (props) {
|
|
19944
19925
|
return props.color;
|
|
19945
19926
|
});
|
|
19946
|
-
var LastMessageText = styled.span(_templateObject1$1 || (_templateObject1$1 = _taggedTemplateLiteralLoose(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n font-style: ", ";\n transform: ", ";\n //height: 20px;\n\n > svg {\n width: 16px;\n height: 16px;\n min-width: 16px;\n min-height: 16px;\n margin-right: 4px;\n color: ", ";\n transform: translate(0px, 3px);\n }\n & > span {\n display:
|
|
19927
|
+
var LastMessageText = styled.span(_templateObject1$1 || (_templateObject1$1 = _taggedTemplateLiteralLoose(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: ", ";\n font-style: ", ";\n transform: ", ";\n //height: 20px;\n\n > svg {\n width: 16px;\n height: 16px;\n min-width: 16px;\n min-height: 16px;\n margin-right: 4px;\n color: ", ";\n transform: translate(0px, 3px);\n }\n & > span {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n }\n & > div {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n & > svg {\n width: 18px;\n height: 18px;\n min-width: 18px;\n min-height: 18px;\n color: ", ";\n }\n }\n"])), function (props) {
|
|
19947
19928
|
return props.color;
|
|
19948
19929
|
}, function (props) {
|
|
19949
19930
|
return props.deletedMessage && 'italic';
|
|
@@ -31282,9 +31263,11 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31282
31263
|
setIsDragging(false);
|
|
31283
31264
|
if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {
|
|
31284
31265
|
var fileList = Object.values(e.dataTransfer.files);
|
|
31285
|
-
var attachmentsFiles = [];
|
|
31286
31266
|
new Promise(function (resolve) {
|
|
31287
|
-
|
|
31267
|
+
var attachmentsFiles = [];
|
|
31268
|
+
var readFiles = 0;
|
|
31269
|
+
var errorCount = 0;
|
|
31270
|
+
fileList.forEach(function (attachment) {
|
|
31288
31271
|
var fileReader = new FileReader();
|
|
31289
31272
|
fileReader.onload = function (event) {
|
|
31290
31273
|
var file = event.target.result;
|
|
@@ -31293,14 +31276,23 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31293
31276
|
data: file,
|
|
31294
31277
|
type: attachment.type
|
|
31295
31278
|
});
|
|
31296
|
-
|
|
31297
|
-
|
|
31279
|
+
readFiles++;
|
|
31280
|
+
if (readFiles + errorCount === fileList.length) {
|
|
31281
|
+
resolve(attachmentsFiles);
|
|
31282
|
+
}
|
|
31283
|
+
};
|
|
31284
|
+
fileReader.onerror = function () {
|
|
31285
|
+
errorCount++;
|
|
31286
|
+
if (readFiles + errorCount === fileList.length) {
|
|
31287
|
+
resolve(attachmentsFiles);
|
|
31298
31288
|
}
|
|
31299
31289
|
};
|
|
31300
31290
|
fileReader.readAsDataURL(attachment);
|
|
31301
31291
|
});
|
|
31302
|
-
}).then(function () {
|
|
31303
|
-
dispatch(setDraggedAttachmentsAC(
|
|
31292
|
+
}).then(function (result) {
|
|
31293
|
+
dispatch(setDraggedAttachmentsAC(result, 'file'));
|
|
31294
|
+
})["catch"](function (error) {
|
|
31295
|
+
console.error('Error in handleDropFile:', error);
|
|
31304
31296
|
});
|
|
31305
31297
|
e.dataTransfer.clearData();
|
|
31306
31298
|
}
|
|
@@ -31311,9 +31303,10 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31311
31303
|
setIsDragging(false);
|
|
31312
31304
|
if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {
|
|
31313
31305
|
var fileList = Object.values(e.dataTransfer.files);
|
|
31314
|
-
var attachmentsFiles = [];
|
|
31315
31306
|
new Promise(function (resolve) {
|
|
31307
|
+
var attachmentsFiles = [];
|
|
31316
31308
|
var readFiles = 0;
|
|
31309
|
+
var errorCount = 0;
|
|
31317
31310
|
fileList.forEach(function (attachment) {
|
|
31318
31311
|
var fileReader = new FileReader();
|
|
31319
31312
|
fileReader.onload = function (event) {
|
|
@@ -31324,14 +31317,22 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31324
31317
|
type: attachment.type
|
|
31325
31318
|
});
|
|
31326
31319
|
readFiles++;
|
|
31327
|
-
if (fileList.length
|
|
31328
|
-
resolve();
|
|
31320
|
+
if (readFiles + errorCount === fileList.length) {
|
|
31321
|
+
resolve(attachmentsFiles);
|
|
31322
|
+
}
|
|
31323
|
+
};
|
|
31324
|
+
fileReader.onerror = function () {
|
|
31325
|
+
errorCount++;
|
|
31326
|
+
if (readFiles + errorCount === fileList.length) {
|
|
31327
|
+
resolve(attachmentsFiles);
|
|
31329
31328
|
}
|
|
31330
31329
|
};
|
|
31331
31330
|
fileReader.readAsDataURL(attachment);
|
|
31332
31331
|
});
|
|
31333
|
-
}).then(function () {
|
|
31334
|
-
dispatch(setDraggedAttachmentsAC(
|
|
31332
|
+
}).then(function (result) {
|
|
31333
|
+
dispatch(setDraggedAttachmentsAC(result, 'media'));
|
|
31334
|
+
})["catch"](function (error) {
|
|
31335
|
+
console.error('Error in handleDropMedia:', error);
|
|
31335
31336
|
});
|
|
31336
31337
|
e.dataTransfer.clearData();
|
|
31337
31338
|
}
|
|
@@ -31825,7 +31826,7 @@ var MessageList = function MessageList(_ref2) {
|
|
|
31825
31826
|
attachmentsPreview: attachmentsPreview
|
|
31826
31827
|
})))));
|
|
31827
31828
|
};
|
|
31828
|
-
var Container$h = styled.div(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column-reverse;\n flex-grow: 1;\n position: relative;\n overflow: auto;\n scroll-behavior: smooth;\n will-change: left, top;\n background-color: ", ";\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
|
|
31829
|
+
var Container$h = styled.div(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column-reverse;\n flex-grow: 1;\n position: relative;\n overflow: auto;\n scroll-behavior: smooth;\n will-change: left, top;\n background-color: ", ";\n overflow-x: hidden;\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n"])), function (props) {
|
|
31829
31830
|
return props.backgroundColor;
|
|
31830
31831
|
}, function (props) {
|
|
31831
31832
|
return props.thumbColor;
|