2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Check loaded status through DocumentMedia if possible.

This commit is contained in:
John Preston
2020-04-09 18:02:09 +04:00
parent 669b79588e
commit bf616036b3
25 changed files with 112 additions and 110 deletions

View File

@@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h"
#include "data/data_user.h"
#include "data/data_document.h"
#include "data/data_document_media.h"
#include "base/unixtime.h"
#include "boxes/confirm_box.h"
#include "boxes/background_preview_box.h"
@@ -410,6 +411,7 @@ BackgroundPreviewBox::BackgroundPreviewBox(
tr::lng_background_text2(tr::now),
true))
, _paper(paper)
, _media(_paper.document() ? _paper.document()->createMediaView() : nullptr)
, _radial([=](crl::time now) { radialAnimationCallback(now); }) {
subscribe(_session->downloaderTaskFinished(), [=] { update(); });
}
@@ -710,7 +712,7 @@ void BackgroundPreviewBox::checkLoadedDocument() {
const auto document = _paper.document();
if (!_full.isNull()
|| !document
|| !document->loaded(DocumentData::FilePathResolve::Checked)
|| !_media->loaded(true)
|| _generating) {
return;
}