mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 15:05:56 +00:00
Fixed order of saving grouped media from bulk download menu item.
This commit is contained in:
@@ -242,10 +242,14 @@ void AddDownloadFilesAction(
|
|||||||
if (items.empty()) {
|
if (items.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
auto sortedItems = ranges::views::all(items)
|
||||||
|
| ranges::views::keys
|
||||||
|
| ranges::to<std::vector>();
|
||||||
|
ranges::sort(sortedItems, {}, &HistoryItem::fullId);
|
||||||
auto docs = Documents();
|
auto docs = Documents();
|
||||||
auto photos = Photos();
|
auto photos = Photos();
|
||||||
for (const auto &pair : items) {
|
for (const auto &item : sortedItems) {
|
||||||
if (!Added(pair.first, docs, photos)) {
|
if (!Added(item, docs, photos)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user