Fix inline bots combined results

This commit is contained in:
Eduard Kuzmenko 2021-08-19 14:09:08 +03:00
parent 424c44e5eb
commit 61185c7e92
2 changed files with 17 additions and 6 deletions

View File

@ -156,11 +156,19 @@ export default class InlineHelper extends AutocompleteHelper {
if(item._ === 'botInlineResult') {
if(item.thumb && item.thumb.mime_type.indexOf('image/') === 0) {
const mediaContainer = document.createElement('div');
let mediaContainer: HTMLElement;
if(preview) {
mediaContainer = document.createElement('div');
preview.append(mediaContainer);
} else {
mediaContainer = container;
}
mediaContainer.classList.add('media-container');
isGallery && mediaContainer.classList.add('no-border-radius');
this.lazyLoadQueue.push({
div: preview,
div: container,
load: () => {
return appDownloadManager.download({
dcId: 4,
@ -180,8 +188,6 @@ export default class InlineHelper extends AutocompleteHelper {
});
}
});
preview.append(mediaContainer);
}
} else {
const media = item.document as MyDocument || item.photo as MyPhoto;
@ -199,6 +205,7 @@ export default class InlineHelper extends AutocompleteHelper {
}
} else if(media) {
const size = isGallery ? 48 : undefined;
isGallery && container.classList.add('no-border-radius');
wrapPhoto({
photo: media,
container: isGallery ? container : preview,

View File

@ -151,6 +151,10 @@ Utility Classes
white-space: pre-wrap !important;
}
.no-border-radius {
border-radius: 0 !important;
}
/* .flex-grow {
flex-grow: 1;
}