mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +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()) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user