mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Don't unload all media on switching between chats.
This commit is contained in:
@@ -405,24 +405,24 @@ void GifsListWidget::processHideFinished() {
|
||||
}
|
||||
|
||||
void GifsListWidget::processPanelHideFinished() {
|
||||
auto itemForget = [](auto &item) {
|
||||
if (auto document = item->getDocument()) {
|
||||
document->forget();
|
||||
const auto itemForget = [](const auto &item) {
|
||||
if (const auto document = item->getDocument()) {
|
||||
document->unload();
|
||||
}
|
||||
if (auto photo = item->getPhoto()) {
|
||||
photo->forget();
|
||||
if (const auto photo = item->getPhoto()) {
|
||||
photo->unload();
|
||||
}
|
||||
if (auto result = item->getResult()) {
|
||||
result->forget();
|
||||
if (const auto result = item->getResult()) {
|
||||
result->unload();
|
||||
}
|
||||
};
|
||||
// Preserve panel state through visibility toggles.
|
||||
//clearInlineRows(false);
|
||||
for_const (auto &item, _gifLayouts) {
|
||||
itemForget(item.second);
|
||||
for (const auto &[document, layout] : _gifLayouts) {
|
||||
itemForget(layout);
|
||||
}
|
||||
for_const (auto &item, _inlineLayouts) {
|
||||
itemForget(item.second);
|
||||
for (const auto &[document, layout] : _inlineLayouts) {
|
||||
itemForget(layout);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user