diff --git a/Telegram/SourceFiles/data/data_document.cpp b/Telegram/SourceFiles/data/data_document.cpp index 1bc4144a8f..ae20db1130 100644 --- a/Telegram/SourceFiles/data/data_document.cpp +++ b/Telegram/SourceFiles/data/data_document.cpp @@ -845,6 +845,7 @@ bool DocumentData::loaded(FilePathResolveType type) const { ActiveCache().decrement(that->_data.size()); that->_data = _loader->bytes(); ActiveCache().increment(that->_data.size()); + if (that->sticker() && !that->sticker()->image && !_loader->imageData().isNull()) { @@ -856,12 +857,13 @@ bool DocumentData::loaded(FilePathResolveType type) const { _loader->imageData())); ActiveCache().increment(ComputeUsage(that->sticker())); } - if (!that->_data.isEmpty() || that->getStickerLarge()) { - ActiveCache().up(that); - } that->refreshGoodThumbnail(); destroyLoader(); + + if (!that->_data.isEmpty() || that->getStickerLarge()) { + ActiveCache().up(that); + } } _owner->notifyDocumentLayoutChanged(this); }