Fix empty preview if sent while failing generating.

Fixes #27004.
This commit is contained in:
John Preston 2023-10-30 18:30:26 +04:00
parent de4eb1e59b
commit 8615a25cd1
1 changed files with 3 additions and 2 deletions

View File

@ -155,7 +155,7 @@ bool WebPage::HasButton(not_null<WebPageData*> 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<HistoryMessageLogEntryOriginal>();
}