@@ -1921,20 +1921,28 @@ void StickersBox::Inner::readVisibleSets() {
1921
1921
int rowFrom = floorclamp (itemsVisibleTop, _rowHeight, 0 , _rows.size ());
1922
1922
int rowTo = ceilclamp (itemsVisibleBottom, _rowHeight, 0 , _rows.size ());
1923
1923
for (int i = rowFrom; i < rowTo; ++i) {
1924
- if (!_rows[i]->unread ) {
1924
+ const auto row = _rows[i].get ();
1925
+ if (!row->unread ) {
1925
1926
continue ;
1926
1927
}
1927
- if (i * _rowHeight < itemsVisibleTop || (i + 1 ) * _rowHeight > itemsVisibleBottom) {
1928
+ if ((i * _rowHeight < itemsVisibleTop)
1929
+ || ((i + 1 ) * _rowHeight > itemsVisibleBottom)) {
1928
1930
continue ;
1929
1931
}
1930
- const auto thumbnailLoading = _rows[i]->set ->hasThumbnail ()
1931
- ? _rows[i]->set ->thumbnailLoading ()
1932
- : _rows[i]->sticker
1933
- ? ((_rows[i]->stickerMedia && _rows[i]->stickerMedia ->loaded ())
1934
- || _rows[i]->sticker ->thumbnailLoading ())
1932
+ const auto thumbnailLoading = row->set ->hasThumbnail ()
1933
+ ? row->set ->thumbnailLoading ()
1934
+ : row->sticker
1935
+ ? row->sticker ->thumbnailLoading ()
1935
1936
: false ;
1936
- if (!thumbnailLoading || _rows[i]->stickerMedia ->loaded ()) {
1937
- _session->api ().readFeaturedSetDelayed (_rows[i]->set ->id );
1937
+ const auto thumbnailLoaded = row->set ->hasThumbnail ()
1938
+ ? (row->thumbnailMedia
1939
+ && (row->thumbnailMedia ->image ()
1940
+ || !row->thumbnailMedia ->content ().isEmpty ()))
1941
+ : row->sticker
1942
+ ? (row->stickerMedia && row->stickerMedia ->loaded ())
1943
+ : true ;
1944
+ if (!thumbnailLoading || thumbnailLoaded) {
1945
+ _session->api ().readFeaturedSetDelayed (row->set ->id );
1938
1946
}
1939
1947
}
1940
1948
}
0 commit comments