mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-07 04:24:09 +02:00
Fixed order of saving grouped media from bulk download menu item.
This commit is contained in:
parent
a0a8d76441
commit
b97c8b9a17
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue