mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Don't forget current item in MediaView.
This commit is contained in:
parent
a08dd1f6e1
commit
aa260d263b
1 changed files with 8 additions and 6 deletions
|
@ -2324,12 +2324,14 @@ void MediaView::preloadData(int32 delta) {
|
||||||
auto till = *_index + (delta ? delta * kPreloadCount : 1);
|
auto till = *_index + (delta ? delta * kPreloadCount : 1);
|
||||||
if (from > till) std::swap(from, till);
|
if (from > till) std::swap(from, till);
|
||||||
|
|
||||||
auto forgetIndex = *_index - delta * 2;
|
if (delta != 0) {
|
||||||
auto entity = entityByIndex(forgetIndex);
|
auto forgetIndex = *_index - delta * 2;
|
||||||
if (auto photo = base::get_if<not_null<PhotoData*>>(&entity.data)) {
|
auto entity = entityByIndex(forgetIndex);
|
||||||
(*photo)->forget();
|
if (auto photo = base::get_if<not_null<PhotoData*>>(&entity.data)) {
|
||||||
} else if (auto document = base::get_if<not_null<DocumentData*>>(&entity.data)) {
|
(*photo)->forget();
|
||||||
(*document)->forget();
|
} else if (auto document = base::get_if<not_null<DocumentData*>>(&entity.data)) {
|
||||||
|
(*document)->forget();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto index = from; index != till; ++index) {
|
for (auto index = from; index != till; ++index) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue