From 61185c7e92f7262dc1e6bce8b061dfd685d2ade3 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Thu, 19 Aug 2021 14:09:08 +0300 Subject: [PATCH] Fix inline bots combined results --- src/components/chat/inlineHelper.ts | 19 +++++++++++++------ src/scss/components/_global.scss | 4 ++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/components/chat/inlineHelper.ts b/src/components/chat/inlineHelper.ts index 9fc5b8d2..016f7f54 100644 --- a/src/components/chat/inlineHelper.ts +++ b/src/components/chat/inlineHelper.ts @@ -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'); - mediaContainer.classList.add('media-container'); - + 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, diff --git a/src/scss/components/_global.scss b/src/scss/components/_global.scss index fe5519ff..2a9ea8cb 100644 --- a/src/scss/components/_global.scss +++ b/src/scss/components/_global.scss @@ -151,6 +151,10 @@ Utility Classes white-space: pre-wrap !important; } +.no-border-radius { + border-radius: 0 !important; +} + /* .flex-grow { flex-grow: 1; }