sceyt-chat-react-uikit 1.8.8-beta.15 → 1.8.8-beta.17
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 +65 -13
- package/index.modern.js +65 -13
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -15663,7 +15663,7 @@ var getFrame = function getFrame(videoSrc, _time) {
|
|
|
15663
15663
|
};
|
|
15664
15664
|
var getVideoFirstFrame = function getVideoFirstFrame(videoSrc, maxWidth, maxHeight, quality) {
|
|
15665
15665
|
if (quality === void 0) {
|
|
15666
|
-
quality =
|
|
15666
|
+
quality = 1;
|
|
15667
15667
|
}
|
|
15668
15668
|
try {
|
|
15669
15669
|
var _exit3 = false;
|
|
@@ -15751,7 +15751,7 @@ var normalizeVideoBlob = function normalizeVideoBlob(blob) {
|
|
|
15751
15751
|
var FRAME_LOAD_TIMEOUT_MS = 8000;
|
|
15752
15752
|
var extractFrameFromUrl = function extractFrameFromUrl(srcUrl, maxWidth, maxHeight, quality) {
|
|
15753
15753
|
if (quality === void 0) {
|
|
15754
|
-
quality =
|
|
15754
|
+
quality = 1;
|
|
15755
15755
|
}
|
|
15756
15756
|
return new Promise(function (resolve) {
|
|
15757
15757
|
try {
|
|
@@ -15878,7 +15878,7 @@ var blobToDataUrl = function blobToDataUrl(blob) {
|
|
|
15878
15878
|
};
|
|
15879
15879
|
var _extractFrameFromBlob2 = function extractFrameFromBlob(blob, maxWidth, maxHeight, quality, allowRemux) {
|
|
15880
15880
|
if (quality === void 0) {
|
|
15881
|
-
quality =
|
|
15881
|
+
quality = 1;
|
|
15882
15882
|
}
|
|
15883
15883
|
if (allowRemux === void 0) {
|
|
15884
15884
|
allowRemux = true;
|
|
@@ -16388,7 +16388,7 @@ var handleUploadAttachments = function handleUploadAttachments(attachments, mess
|
|
|
16388
16388
|
var _calculateRenderedIma2 = calculateRenderedImageWidth((attachment === null || attachment === void 0 ? void 0 : attachment.metadata.szw) || 1280, (attachment === null || attachment === void 0 ? void 0 : attachment.metadata.szh) || 1080),
|
|
16389
16389
|
newWidth = _calculateRenderedIma2[0],
|
|
16390
16390
|
newHeight = _calculateRenderedIma2[1];
|
|
16391
|
-
return Promise.resolve(getVideoFirstFrame(blobLocal, newWidth, newHeight
|
|
16391
|
+
return Promise.resolve(getVideoFirstFrame(blobLocal, newWidth, newHeight)).then(function (result) {
|
|
16392
16392
|
var _temp6 = function () {
|
|
16393
16393
|
if (result) {
|
|
16394
16394
|
var frameBlobUrl = result.frameBlobUrl,
|
|
@@ -17020,7 +17020,7 @@ function sendMessage(action) {
|
|
|
17020
17020
|
var _calculateRenderedIma4 = calculateRenderedImageWidth((parsedMetadata === null || parsedMetadata === void 0 ? void 0 : parsedMetadata.szw) || 1280, (parsedMetadata === null || parsedMetadata === void 0 ? void 0 : parsedMetadata.szh) || 1080),
|
|
17021
17021
|
newWidth = _calculateRenderedIma4[0],
|
|
17022
17022
|
newHeight = _calculateRenderedIma4[1];
|
|
17023
|
-
return Promise.resolve(getVideoFirstFrame(attachment.data, newWidth, newHeight
|
|
17023
|
+
return Promise.resolve(getVideoFirstFrame(attachment.data, newWidth, newHeight)).then(function (result) {
|
|
17024
17024
|
var _temp15 = function () {
|
|
17025
17025
|
if (result) {
|
|
17026
17026
|
var frameBlobUrl = result.frameBlobUrl,
|
|
@@ -20614,7 +20614,7 @@ function loadMoreReactions(action) {
|
|
|
20614
20614
|
}
|
|
20615
20615
|
function getMessageAttachments(action) {
|
|
20616
20616
|
var _store$getState$Messa2;
|
|
20617
|
-
var _action$payload7, channelId, attachmentType, limit, direction, attachmentId, forPopup, cacheKey, cachedAttachments, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, attachments, attachmentIndex, hasPrev, hasNext, freshAttachments, _t39;
|
|
20617
|
+
var _action$payload7, channelId, attachmentType, limit, direction, attachmentId, forPopup, cacheKey, cachedAttachments, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, attachments, _attachments$2, _attachments, attachmentIndex, hasPrev, hasNext, freshAttachments, _t39;
|
|
20618
20618
|
return _regenerator().w(function (_context42) {
|
|
20619
20619
|
while (1) switch (_context42.p = _context42.n) {
|
|
20620
20620
|
case 0:
|
|
@@ -20693,6 +20693,16 @@ function getMessageAttachments(action) {
|
|
|
20693
20693
|
break;
|
|
20694
20694
|
}
|
|
20695
20695
|
query.AttachmentByTypeQueryForPopup = AttachmentByTypeQuery;
|
|
20696
|
+
console.log('[MEDIA_OPEN] 8.saga-forPopup ' + JSON.stringify({
|
|
20697
|
+
requestedAttId: attachmentId,
|
|
20698
|
+
direction: direction,
|
|
20699
|
+
returned: attachments.length,
|
|
20700
|
+
containsRequested: attachments.some(function (a) {
|
|
20701
|
+
return a.id === attachmentId;
|
|
20702
|
+
}),
|
|
20703
|
+
firstId: (_attachments$2 = attachments[0]) === null || _attachments$2 === void 0 ? void 0 : _attachments$2.id,
|
|
20704
|
+
lastId: (_attachments = attachments[attachments.length - 1]) === null || _attachments === void 0 ? void 0 : _attachments.id
|
|
20705
|
+
}));
|
|
20696
20706
|
_context42.n = 12;
|
|
20697
20707
|
return effects.put(setAttachmentsForPopupAC(JSON.parse(JSON.stringify(attachments))));
|
|
20698
20708
|
case 12:
|
|
@@ -37007,18 +37017,36 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
37007
37017
|
log.error('Error getting initial attachment from cache:', error);
|
|
37008
37018
|
});
|
|
37009
37019
|
}
|
|
37010
|
-
|
|
37020
|
+
var foundInStaleList = !!attachmentsList.find(function (item) {
|
|
37011
37021
|
return item.id === currentMediaFile.id;
|
|
37012
|
-
})
|
|
37022
|
+
});
|
|
37023
|
+
console.log('[MEDIA_OPEN] 4.slider-mount ' + JSON.stringify({
|
|
37024
|
+
attId: currentMediaFile.id,
|
|
37025
|
+
name: currentMediaFile.name,
|
|
37026
|
+
msgId: currentMediaFile.messageId,
|
|
37027
|
+
staleListLen: attachmentsList.length,
|
|
37028
|
+
foundInStaleList: foundInStaleList,
|
|
37029
|
+
staleListIds: attachmentsList.slice(0, 5).map(function (item) {
|
|
37030
|
+
return item.id;
|
|
37031
|
+
})
|
|
37032
|
+
}));
|
|
37033
|
+
if (!foundInStaleList) {
|
|
37013
37034
|
dispatch(setAttachmentsForPopupAC([currentMediaFile]));
|
|
37014
37035
|
}
|
|
37015
37036
|
dispatch(getAttachmentsAC(channel.id, channelDetailsTabs.media, 34, queryDirection.NEAR, currentMediaFile.id, true));
|
|
37016
37037
|
}, []);
|
|
37017
37038
|
var activeFileIndex = React.useMemo(function () {
|
|
37018
37039
|
if (!(currentFile !== null && currentFile !== void 0 && currentFile.id)) return -1;
|
|
37019
|
-
|
|
37040
|
+
var index = attachmentsList.findIndex(function (item) {
|
|
37020
37041
|
return item.id === currentFile.id;
|
|
37021
37042
|
});
|
|
37043
|
+
console.log('[MEDIA_OPEN] 5.activeIndex ' + JSON.stringify({
|
|
37044
|
+
index: index,
|
|
37045
|
+
attId: currentFile.id,
|
|
37046
|
+
name: currentFile.name,
|
|
37047
|
+
listLen: attachmentsList.length
|
|
37048
|
+
}));
|
|
37049
|
+
return index;
|
|
37022
37050
|
}, [attachmentsList, currentFile]);
|
|
37023
37051
|
React.useEffect(function () {
|
|
37024
37052
|
var currentFileId = currentFile === null || currentFile === void 0 ? void 0 : currentFile.id;
|
|
@@ -37030,6 +37058,13 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
37030
37058
|
var newIndex = attachmentsList.findIndex(function (item) {
|
|
37031
37059
|
return item.id === currentFileId;
|
|
37032
37060
|
});
|
|
37061
|
+
console.log('[MEDIA_OPEN] 6.list-grew ' + JSON.stringify({
|
|
37062
|
+
prevLen: previousLength,
|
|
37063
|
+
newLen: newLength,
|
|
37064
|
+
attId: currentFileId,
|
|
37065
|
+
newIndex: newIndex,
|
|
37066
|
+
activeFileIndex: activeFileIndex
|
|
37067
|
+
}));
|
|
37033
37068
|
if (newIndex >= 0) {
|
|
37034
37069
|
if (newIndex !== activeFileIndex) {
|
|
37035
37070
|
var newFile = attachmentsList[newIndex];
|
|
@@ -37171,6 +37206,12 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
37171
37206
|
clearTimeout(timeout);
|
|
37172
37207
|
}, 400);
|
|
37173
37208
|
if (pageIndex >= 0 && pageIndex < attachmentsList.length) {
|
|
37209
|
+
var _attachmentsList$page, _attachmentsList$page2;
|
|
37210
|
+
console.log('[MEDIA_OPEN] 7.carousel-change ' + JSON.stringify({
|
|
37211
|
+
pageIndex: pageIndex,
|
|
37212
|
+
attId: (_attachmentsList$page = attachmentsList[pageIndex]) === null || _attachmentsList$page === void 0 ? void 0 : _attachmentsList$page.id,
|
|
37213
|
+
name: (_attachmentsList$page2 = attachmentsList[pageIndex]) === null || _attachmentsList$page2 === void 0 ? void 0 : _attachmentsList$page2.name
|
|
37214
|
+
}));
|
|
37174
37215
|
setCurrentFile(attachmentsList[pageIndex]);
|
|
37175
37216
|
setNextButtonDisabled(!attachmentsList[pageIndex + 1]);
|
|
37176
37217
|
setPrevButtonDisabled(!attachmentsList[pageIndex - 1]);
|
|
@@ -39134,7 +39175,7 @@ var VideoPreview = /*#__PURE__*/React.memo(function VideoPreview(_ref) {
|
|
|
39134
39175
|
var _calculateRenderedIma = calculateRenderedImageWidth((parsedMetadata === null || parsedMetadata === void 0 ? void 0 : parsedMetadata.szw) || 1280, (parsedMetadata === null || parsedMetadata === void 0 ? void 0 : parsedMetadata.szh) || 1080),
|
|
39135
39176
|
newWidth = _calculateRenderedIma[0],
|
|
39136
39177
|
newHeight = _calculateRenderedIma[1];
|
|
39137
|
-
return Promise.resolve(getVideoFirstFrame(videoSource, newWidth, newHeight
|
|
39178
|
+
return Promise.resolve(getVideoFirstFrame(videoSource, newWidth, newHeight)).then(function (result) {
|
|
39138
39179
|
if (!result) {
|
|
39139
39180
|
isExtractingRef.current = false;
|
|
39140
39181
|
return;
|
|
@@ -39567,7 +39608,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
39567
39608
|
} else {
|
|
39568
39609
|
var _temp4 = function () {
|
|
39569
39610
|
if (attachment.type === attachmentTypes.video) {
|
|
39570
|
-
return Promise.resolve(getVideoFirstFrame(body, renderWidth, renderHeight
|
|
39611
|
+
return Promise.resolve(getVideoFirstFrame(body, renderWidth, renderHeight)).then(function (frameResult) {
|
|
39571
39612
|
function _temp3() {
|
|
39572
39613
|
setAttachmentToCache(attachment.url + "_original_video_url", new Response(body, {
|
|
39573
39614
|
headers: {
|
|
@@ -39638,7 +39679,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
39638
39679
|
var blobUrl = URL.createObjectURL(blob);
|
|
39639
39680
|
var _temp11 = function () {
|
|
39640
39681
|
if (attachment.type === attachmentTypes.video) {
|
|
39641
|
-
return Promise.resolve(getVideoFirstFrame(blob, renderWidth, renderHeight
|
|
39682
|
+
return Promise.resolve(getVideoFirstFrame(blob, renderWidth, renderHeight)).then(function (frameResult) {
|
|
39642
39683
|
function _temp10() {
|
|
39643
39684
|
setAttachmentToCache(attachment.url + '_original_video_url', new Response(blob, {
|
|
39644
39685
|
headers: {
|
|
@@ -44741,6 +44782,12 @@ var Message$1 = function Message(_ref) {
|
|
|
44741
44782
|
clearTimeout(messageActionsTimeout.current);
|
|
44742
44783
|
}
|
|
44743
44784
|
lastMediaItemClickTime = Date.now();
|
|
44785
|
+
console.log('[MEDIA_OPEN] 2.wrapper ' + JSON.stringify({
|
|
44786
|
+
msgId: message.id,
|
|
44787
|
+
attId: attachment === null || attachment === void 0 ? void 0 : attachment.id,
|
|
44788
|
+
name: attachment === null || attachment === void 0 ? void 0 : attachment.name,
|
|
44789
|
+
url: attachment === null || attachment === void 0 ? void 0 : attachment.url
|
|
44790
|
+
}));
|
|
44744
44791
|
setMessageActionsShow(false);
|
|
44745
44792
|
dispatch(setMessageMenuOpenedAC(message.id || message.tid));
|
|
44746
44793
|
if (handleMediaItemClick) {
|
|
@@ -48045,6 +48092,11 @@ var MessageList = function MessageList(_ref) {
|
|
|
48045
48092
|
setMediaFile(null);
|
|
48046
48093
|
}, [channel.id]);
|
|
48047
48094
|
var handleMediaItemClickStable = React.useCallback(function (attachment) {
|
|
48095
|
+
console.log('[MEDIA_OPEN] 3.setMediaFile ' + JSON.stringify({
|
|
48096
|
+
attId: attachment === null || attachment === void 0 ? void 0 : attachment.id,
|
|
48097
|
+
name: attachment === null || attachment === void 0 ? void 0 : attachment.name,
|
|
48098
|
+
skipped: !(attachment !== null && attachment !== void 0 && attachment.id)
|
|
48099
|
+
}));
|
|
48048
48100
|
if (attachment !== null && attachment !== void 0 && attachment.id) setMediaFile(attachment);
|
|
48049
48101
|
}, []);
|
|
48050
48102
|
var renderTimelineMessage = function renderTimelineMessage(_ref2) {
|
|
@@ -52813,7 +52865,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
52813
52865
|
var _calculateRenderedIma = calculateRenderedImageWidth(attachment.metadata.szh || 400, attachment.metadata.szh || 400),
|
|
52814
52866
|
newWidth = _calculateRenderedIma[0],
|
|
52815
52867
|
newHeight = _calculateRenderedIma[1];
|
|
52816
|
-
return Promise.resolve(getVideoFirstFrame(attachment.data, newWidth, newHeight
|
|
52868
|
+
return Promise.resolve(getVideoFirstFrame(attachment.data, newWidth, newHeight)).then(function (result) {
|
|
52817
52869
|
if (result) {
|
|
52818
52870
|
var _attachment$metadata2;
|
|
52819
52871
|
var frameBlobUrl = result.frameBlobUrl;
|
package/index.modern.js
CHANGED
|
@@ -15643,7 +15643,7 @@ var getFrame = function getFrame(videoSrc, _time) {
|
|
|
15643
15643
|
};
|
|
15644
15644
|
var getVideoFirstFrame = function getVideoFirstFrame(videoSrc, maxWidth, maxHeight, quality) {
|
|
15645
15645
|
if (quality === void 0) {
|
|
15646
|
-
quality =
|
|
15646
|
+
quality = 1;
|
|
15647
15647
|
}
|
|
15648
15648
|
try {
|
|
15649
15649
|
var _exit3 = false;
|
|
@@ -15731,7 +15731,7 @@ var normalizeVideoBlob = function normalizeVideoBlob(blob) {
|
|
|
15731
15731
|
var FRAME_LOAD_TIMEOUT_MS = 8000;
|
|
15732
15732
|
var extractFrameFromUrl = function extractFrameFromUrl(srcUrl, maxWidth, maxHeight, quality) {
|
|
15733
15733
|
if (quality === void 0) {
|
|
15734
|
-
quality =
|
|
15734
|
+
quality = 1;
|
|
15735
15735
|
}
|
|
15736
15736
|
return new Promise(function (resolve) {
|
|
15737
15737
|
try {
|
|
@@ -15858,7 +15858,7 @@ var blobToDataUrl = function blobToDataUrl(blob) {
|
|
|
15858
15858
|
};
|
|
15859
15859
|
var _extractFrameFromBlob2 = function extractFrameFromBlob(blob, maxWidth, maxHeight, quality, allowRemux) {
|
|
15860
15860
|
if (quality === void 0) {
|
|
15861
|
-
quality =
|
|
15861
|
+
quality = 1;
|
|
15862
15862
|
}
|
|
15863
15863
|
if (allowRemux === void 0) {
|
|
15864
15864
|
allowRemux = true;
|
|
@@ -16368,7 +16368,7 @@ var handleUploadAttachments = function handleUploadAttachments(attachments, mess
|
|
|
16368
16368
|
var _calculateRenderedIma2 = calculateRenderedImageWidth((attachment === null || attachment === void 0 ? void 0 : attachment.metadata.szw) || 1280, (attachment === null || attachment === void 0 ? void 0 : attachment.metadata.szh) || 1080),
|
|
16369
16369
|
newWidth = _calculateRenderedIma2[0],
|
|
16370
16370
|
newHeight = _calculateRenderedIma2[1];
|
|
16371
|
-
return Promise.resolve(getVideoFirstFrame(blobLocal, newWidth, newHeight
|
|
16371
|
+
return Promise.resolve(getVideoFirstFrame(blobLocal, newWidth, newHeight)).then(function (result) {
|
|
16372
16372
|
var _temp6 = function () {
|
|
16373
16373
|
if (result) {
|
|
16374
16374
|
var frameBlobUrl = result.frameBlobUrl,
|
|
@@ -17000,7 +17000,7 @@ function sendMessage(action) {
|
|
|
17000
17000
|
var _calculateRenderedIma4 = calculateRenderedImageWidth((parsedMetadata === null || parsedMetadata === void 0 ? void 0 : parsedMetadata.szw) || 1280, (parsedMetadata === null || parsedMetadata === void 0 ? void 0 : parsedMetadata.szh) || 1080),
|
|
17001
17001
|
newWidth = _calculateRenderedIma4[0],
|
|
17002
17002
|
newHeight = _calculateRenderedIma4[1];
|
|
17003
|
-
return Promise.resolve(getVideoFirstFrame(attachment.data, newWidth, newHeight
|
|
17003
|
+
return Promise.resolve(getVideoFirstFrame(attachment.data, newWidth, newHeight)).then(function (result) {
|
|
17004
17004
|
var _temp15 = function () {
|
|
17005
17005
|
if (result) {
|
|
17006
17006
|
var frameBlobUrl = result.frameBlobUrl,
|
|
@@ -20594,7 +20594,7 @@ function loadMoreReactions(action) {
|
|
|
20594
20594
|
}
|
|
20595
20595
|
function getMessageAttachments(action) {
|
|
20596
20596
|
var _store$getState$Messa2;
|
|
20597
|
-
var _action$payload7, channelId, attachmentType, limit, direction, attachmentId, forPopup, cacheKey, cachedAttachments, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, attachments, attachmentIndex, hasPrev, hasNext, freshAttachments, _t39;
|
|
20597
|
+
var _action$payload7, channelId, attachmentType, limit, direction, attachmentId, forPopup, cacheKey, cachedAttachments, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, attachments, _attachments$2, _attachments, attachmentIndex, hasPrev, hasNext, freshAttachments, _t39;
|
|
20598
20598
|
return _regenerator().w(function (_context42) {
|
|
20599
20599
|
while (1) switch (_context42.p = _context42.n) {
|
|
20600
20600
|
case 0:
|
|
@@ -20673,6 +20673,16 @@ function getMessageAttachments(action) {
|
|
|
20673
20673
|
break;
|
|
20674
20674
|
}
|
|
20675
20675
|
query.AttachmentByTypeQueryForPopup = AttachmentByTypeQuery;
|
|
20676
|
+
console.log('[MEDIA_OPEN] 8.saga-forPopup ' + JSON.stringify({
|
|
20677
|
+
requestedAttId: attachmentId,
|
|
20678
|
+
direction: direction,
|
|
20679
|
+
returned: attachments.length,
|
|
20680
|
+
containsRequested: attachments.some(function (a) {
|
|
20681
|
+
return a.id === attachmentId;
|
|
20682
|
+
}),
|
|
20683
|
+
firstId: (_attachments$2 = attachments[0]) === null || _attachments$2 === void 0 ? void 0 : _attachments$2.id,
|
|
20684
|
+
lastId: (_attachments = attachments[attachments.length - 1]) === null || _attachments === void 0 ? void 0 : _attachments.id
|
|
20685
|
+
}));
|
|
20676
20686
|
_context42.n = 12;
|
|
20677
20687
|
return put(setAttachmentsForPopupAC(JSON.parse(JSON.stringify(attachments))));
|
|
20678
20688
|
case 12:
|
|
@@ -36987,18 +36997,36 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
36987
36997
|
log.error('Error getting initial attachment from cache:', error);
|
|
36988
36998
|
});
|
|
36989
36999
|
}
|
|
36990
|
-
|
|
37000
|
+
var foundInStaleList = !!attachmentsList.find(function (item) {
|
|
36991
37001
|
return item.id === currentMediaFile.id;
|
|
36992
|
-
})
|
|
37002
|
+
});
|
|
37003
|
+
console.log('[MEDIA_OPEN] 4.slider-mount ' + JSON.stringify({
|
|
37004
|
+
attId: currentMediaFile.id,
|
|
37005
|
+
name: currentMediaFile.name,
|
|
37006
|
+
msgId: currentMediaFile.messageId,
|
|
37007
|
+
staleListLen: attachmentsList.length,
|
|
37008
|
+
foundInStaleList: foundInStaleList,
|
|
37009
|
+
staleListIds: attachmentsList.slice(0, 5).map(function (item) {
|
|
37010
|
+
return item.id;
|
|
37011
|
+
})
|
|
37012
|
+
}));
|
|
37013
|
+
if (!foundInStaleList) {
|
|
36993
37014
|
dispatch(setAttachmentsForPopupAC([currentMediaFile]));
|
|
36994
37015
|
}
|
|
36995
37016
|
dispatch(getAttachmentsAC(channel.id, channelDetailsTabs.media, 34, queryDirection.NEAR, currentMediaFile.id, true));
|
|
36996
37017
|
}, []);
|
|
36997
37018
|
var activeFileIndex = useMemo(function () {
|
|
36998
37019
|
if (!(currentFile !== null && currentFile !== void 0 && currentFile.id)) return -1;
|
|
36999
|
-
|
|
37020
|
+
var index = attachmentsList.findIndex(function (item) {
|
|
37000
37021
|
return item.id === currentFile.id;
|
|
37001
37022
|
});
|
|
37023
|
+
console.log('[MEDIA_OPEN] 5.activeIndex ' + JSON.stringify({
|
|
37024
|
+
index: index,
|
|
37025
|
+
attId: currentFile.id,
|
|
37026
|
+
name: currentFile.name,
|
|
37027
|
+
listLen: attachmentsList.length
|
|
37028
|
+
}));
|
|
37029
|
+
return index;
|
|
37002
37030
|
}, [attachmentsList, currentFile]);
|
|
37003
37031
|
useEffect(function () {
|
|
37004
37032
|
var currentFileId = currentFile === null || currentFile === void 0 ? void 0 : currentFile.id;
|
|
@@ -37010,6 +37038,13 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
37010
37038
|
var newIndex = attachmentsList.findIndex(function (item) {
|
|
37011
37039
|
return item.id === currentFileId;
|
|
37012
37040
|
});
|
|
37041
|
+
console.log('[MEDIA_OPEN] 6.list-grew ' + JSON.stringify({
|
|
37042
|
+
prevLen: previousLength,
|
|
37043
|
+
newLen: newLength,
|
|
37044
|
+
attId: currentFileId,
|
|
37045
|
+
newIndex: newIndex,
|
|
37046
|
+
activeFileIndex: activeFileIndex
|
|
37047
|
+
}));
|
|
37013
37048
|
if (newIndex >= 0) {
|
|
37014
37049
|
if (newIndex !== activeFileIndex) {
|
|
37015
37050
|
var newFile = attachmentsList[newIndex];
|
|
@@ -37151,6 +37186,12 @@ var SliderPopup = function SliderPopup(_ref) {
|
|
|
37151
37186
|
clearTimeout(timeout);
|
|
37152
37187
|
}, 400);
|
|
37153
37188
|
if (pageIndex >= 0 && pageIndex < attachmentsList.length) {
|
|
37189
|
+
var _attachmentsList$page, _attachmentsList$page2;
|
|
37190
|
+
console.log('[MEDIA_OPEN] 7.carousel-change ' + JSON.stringify({
|
|
37191
|
+
pageIndex: pageIndex,
|
|
37192
|
+
attId: (_attachmentsList$page = attachmentsList[pageIndex]) === null || _attachmentsList$page === void 0 ? void 0 : _attachmentsList$page.id,
|
|
37193
|
+
name: (_attachmentsList$page2 = attachmentsList[pageIndex]) === null || _attachmentsList$page2 === void 0 ? void 0 : _attachmentsList$page2.name
|
|
37194
|
+
}));
|
|
37154
37195
|
setCurrentFile(attachmentsList[pageIndex]);
|
|
37155
37196
|
setNextButtonDisabled(!attachmentsList[pageIndex + 1]);
|
|
37156
37197
|
setPrevButtonDisabled(!attachmentsList[pageIndex - 1]);
|
|
@@ -39114,7 +39155,7 @@ var VideoPreview = /*#__PURE__*/memo(function VideoPreview(_ref) {
|
|
|
39114
39155
|
var _calculateRenderedIma = calculateRenderedImageWidth((parsedMetadata === null || parsedMetadata === void 0 ? void 0 : parsedMetadata.szw) || 1280, (parsedMetadata === null || parsedMetadata === void 0 ? void 0 : parsedMetadata.szh) || 1080),
|
|
39115
39156
|
newWidth = _calculateRenderedIma[0],
|
|
39116
39157
|
newHeight = _calculateRenderedIma[1];
|
|
39117
|
-
return Promise.resolve(getVideoFirstFrame(videoSource, newWidth, newHeight
|
|
39158
|
+
return Promise.resolve(getVideoFirstFrame(videoSource, newWidth, newHeight)).then(function (result) {
|
|
39118
39159
|
if (!result) {
|
|
39119
39160
|
isExtractingRef.current = false;
|
|
39120
39161
|
return;
|
|
@@ -39547,7 +39588,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
39547
39588
|
} else {
|
|
39548
39589
|
var _temp4 = function () {
|
|
39549
39590
|
if (attachment.type === attachmentTypes.video) {
|
|
39550
|
-
return Promise.resolve(getVideoFirstFrame(body, renderWidth, renderHeight
|
|
39591
|
+
return Promise.resolve(getVideoFirstFrame(body, renderWidth, renderHeight)).then(function (frameResult) {
|
|
39551
39592
|
function _temp3() {
|
|
39552
39593
|
setAttachmentToCache(attachment.url + "_original_video_url", new Response(body, {
|
|
39553
39594
|
headers: {
|
|
@@ -39618,7 +39659,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
39618
39659
|
var blobUrl = URL.createObjectURL(blob);
|
|
39619
39660
|
var _temp11 = function () {
|
|
39620
39661
|
if (attachment.type === attachmentTypes.video) {
|
|
39621
|
-
return Promise.resolve(getVideoFirstFrame(blob, renderWidth, renderHeight
|
|
39662
|
+
return Promise.resolve(getVideoFirstFrame(blob, renderWidth, renderHeight)).then(function (frameResult) {
|
|
39622
39663
|
function _temp10() {
|
|
39623
39664
|
setAttachmentToCache(attachment.url + '_original_video_url', new Response(blob, {
|
|
39624
39665
|
headers: {
|
|
@@ -44721,6 +44762,12 @@ var Message$1 = function Message(_ref) {
|
|
|
44721
44762
|
clearTimeout(messageActionsTimeout.current);
|
|
44722
44763
|
}
|
|
44723
44764
|
lastMediaItemClickTime = Date.now();
|
|
44765
|
+
console.log('[MEDIA_OPEN] 2.wrapper ' + JSON.stringify({
|
|
44766
|
+
msgId: message.id,
|
|
44767
|
+
attId: attachment === null || attachment === void 0 ? void 0 : attachment.id,
|
|
44768
|
+
name: attachment === null || attachment === void 0 ? void 0 : attachment.name,
|
|
44769
|
+
url: attachment === null || attachment === void 0 ? void 0 : attachment.url
|
|
44770
|
+
}));
|
|
44724
44771
|
setMessageActionsShow(false);
|
|
44725
44772
|
dispatch(setMessageMenuOpenedAC(message.id || message.tid));
|
|
44726
44773
|
if (handleMediaItemClick) {
|
|
@@ -48025,6 +48072,11 @@ var MessageList = function MessageList(_ref) {
|
|
|
48025
48072
|
setMediaFile(null);
|
|
48026
48073
|
}, [channel.id]);
|
|
48027
48074
|
var handleMediaItemClickStable = useCallback(function (attachment) {
|
|
48075
|
+
console.log('[MEDIA_OPEN] 3.setMediaFile ' + JSON.stringify({
|
|
48076
|
+
attId: attachment === null || attachment === void 0 ? void 0 : attachment.id,
|
|
48077
|
+
name: attachment === null || attachment === void 0 ? void 0 : attachment.name,
|
|
48078
|
+
skipped: !(attachment !== null && attachment !== void 0 && attachment.id)
|
|
48079
|
+
}));
|
|
48028
48080
|
if (attachment !== null && attachment !== void 0 && attachment.id) setMediaFile(attachment);
|
|
48029
48081
|
}, []);
|
|
48030
48082
|
var renderTimelineMessage = function renderTimelineMessage(_ref2) {
|
|
@@ -52793,7 +52845,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
52793
52845
|
var _calculateRenderedIma = calculateRenderedImageWidth(attachment.metadata.szh || 400, attachment.metadata.szh || 400),
|
|
52794
52846
|
newWidth = _calculateRenderedIma[0],
|
|
52795
52847
|
newHeight = _calculateRenderedIma[1];
|
|
52796
|
-
return Promise.resolve(getVideoFirstFrame(attachment.data, newWidth, newHeight
|
|
52848
|
+
return Promise.resolve(getVideoFirstFrame(attachment.data, newWidth, newHeight)).then(function (result) {
|
|
52797
52849
|
if (result) {
|
|
52798
52850
|
var _attachment$metadata2;
|
|
52799
52851
|
var frameBlobUrl = result.frameBlobUrl;
|