Changed Up arrow shortcut for albums to edit item with caption.

Fixed #10134.
This commit is contained in:
23rd
2021-01-18 18:04:03 +03:00
committed by John Preston
parent ad761011d6
commit eb42a77eb7
5 changed files with 26 additions and 3 deletions
+16
View File
@@ -145,4 +145,20 @@ void Groups::refreshViews(const HistoryItemsList &items) {
}
}
not_null<HistoryItem*> Groups::findItemToEdit(
not_null<HistoryItem*> item) const {
const auto group = find(item);
if (!group) {
return item;
}
const auto &list = group->items;
const auto it = ranges::find_if(
list,
ranges::not_fn(&HistoryItem::emptyText));
if (it == end(list)) {
return list.front();
}
return (*it);
}
} // namespace Data