From 8615a25cd13ce972721078814a992abd4f30c4f9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 30 Oct 2023 18:30:26 +0400 Subject: [PATCH] Fix empty preview if sent while failing generating. Fixes #27004. --- .../SourceFiles/history/view/media/history_view_web_page.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp index 38b6dc258..844963a5e 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp @@ -155,7 +155,7 @@ bool WebPage::HasButton(not_null webpage) { } QSize WebPage::countOptimalSize() { - if (_data->pendingTill) { + if (_data->pendingTill || _data->failed) { return { 0, 0 }; } @@ -366,7 +366,7 @@ QSize WebPage::countOptimalSize() { } QSize WebPage::countCurrentSize(int newWidth) { - if (_data->pendingTill) { + if (_data->pendingTill || _data->failed) { return { newWidth, minHeight() }; } @@ -891,6 +891,7 @@ void WebPage::playAnimation(bool autoplay) { bool WebPage::isDisplayed() const { const auto item = _parent->data(); return !_data->pendingTill + && !_data->failed && !item->Has(); }