Inline Bot Tooltip: Fix missing results for files (#1634)

This commit is contained in:
Alexander Zinchuk 2022-01-13 01:11:37 +01:00
parent 85306fe67e
commit 34933fd064
2 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import {
export type ApiInlineResultType = ( export type ApiInlineResultType = (
'article' | 'audio' | 'contact' | 'document' | 'game' | 'gif' | 'location' | 'mpeg4_gif' | 'article' | 'audio' | 'contact' | 'document' | 'game' | 'gif' | 'location' | 'mpeg4_gif' |
'photo' | 'sticker' | 'venue' | 'video' | 'voice' 'photo' | 'sticker' | 'venue' | 'video' | 'voice' | 'file'
); );
export interface ApiWebDocument { export interface ApiWebDocument {

View File

@ -100,7 +100,7 @@ const InlineBotTooltip: FC<OwnProps> = ({
? prevInlineBotResults ? prevInlineBotResults
: inlineBotResults; : inlineBotResults;
if (!shouldRender || !renderedInlineBotResults || (!renderedInlineBotResults.length && !switchPm)) { if (!shouldRender || !(renderedInlineBotResults?.length || switchPm)) {
return undefined; return undefined;
} }
@ -153,6 +153,7 @@ const InlineBotTooltip: FC<OwnProps> = ({
); );
case 'video': case 'video':
case 'file':
case 'game': case 'game':
return ( return (
<MediaResult <MediaResult
@ -190,7 +191,7 @@ const InlineBotTooltip: FC<OwnProps> = ({
sensitiveArea={160} sensitiveArea={160}
> >
{switchPm && renderSwitchPm()} {switchPm && renderSwitchPm()}
{renderContent()} {renderedInlineBotResults?.length && renderContent()}
</InfiniteScroll> </InfiniteScroll>
); );
}; };