|
|
@ -30,17 +30,20 @@ export default class ReplyContainer extends DivAndCaption<(title: string, subtit |
|
|
|
//console.log('wrap reply', media);
|
|
|
|
//console.log('wrap reply', media);
|
|
|
|
|
|
|
|
|
|
|
|
if(media.photo || (media.document && ['video'].indexOf(media.document.type) !== -1)) { |
|
|
|
if(media.photo || (media.document && ['video'].indexOf(media.document.type) !== -1)) { |
|
|
|
let replyMedia = document.createElement('div'); |
|
|
|
const replyMedia = document.createElement('div'); |
|
|
|
replyMedia.classList.add(this.className + '-media'); |
|
|
|
replyMedia.classList.add(this.className + '-media'); |
|
|
|
|
|
|
|
|
|
|
|
let photo = media.photo || media.document; |
|
|
|
const photo = media.photo || media.document; |
|
|
|
|
|
|
|
|
|
|
|
let sizes = photo.sizes || photo.thumbs; |
|
|
|
if(photo._ == 'document' || !photo.downloaded) { |
|
|
|
if(sizes && sizes[0].bytes) { |
|
|
|
const sizes = photo.sizes || photo.thumbs; |
|
|
|
appPhotosManager.setAttachmentPreview(sizes[0].bytes, replyMedia, false, true); |
|
|
|
if(sizes && sizes[0].bytes) { |
|
|
|
|
|
|
|
appPhotosManager.setAttachmentPreview(sizes[0].bytes, replyMedia, false, true); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
appPhotosManager.preloadPhoto(photo, appPhotosManager.choosePhotoSize(photo, 32, 32)) |
|
|
|
const size = appPhotosManager.choosePhotoSize(photo, 32, 32/* mediaSizes.active.regular.width, mediaSizes.active.regular.height */); |
|
|
|
|
|
|
|
appPhotosManager.preloadPhoto(photo, size) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
renderImageFromUrl(replyMedia, photo._ == 'photo' ? photo.url : appPhotosManager.getDocumentCachedThumb(photo.id).url); |
|
|
|
renderImageFromUrl(replyMedia, photo._ == 'photo' ? photo.url : appPhotosManager.getDocumentCachedThumb(photo.id).url); |
|
|
|
}); |
|
|
|
}); |
|
|
|