Fixed order of saving grouped media from bulk download menu item.

This commit is contained in:
23rd 2025-06-30 10:25:53 +03:00
parent a0a8d76441
commit b97c8b9a17

View file

@ -242,10 +242,14 @@ void AddDownloadFilesAction(
if (items.empty()) {
return;
}
auto sortedItems = ranges::views::all(items)
| ranges::views::keys
| ranges::to<std::vector>();
ranges::sort(sortedItems, {}, &HistoryItem::fullId);
auto docs = Documents();
auto photos = Photos();
for (const auto &pair : items) {
if (!Added(pair.first, docs, photos)) {
for (const auto &item : sortedItems) {
if (!Added(item, docs, photos)) {
return;
}
}