mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-24 17:26:58 +00:00
Fixed ability to cancel edit media in albums.
This commit is contained in:
parent
67572b0d9a
commit
590e6c8e9d
@ -64,7 +64,7 @@ void Groups::unregisterMessage(not_null<const HistoryItem*> item) {
|
||||
}
|
||||
}
|
||||
|
||||
void Groups::refreshMessage(not_null<HistoryItem*> item) {
|
||||
void Groups::refreshMessage(not_null<HistoryItem*> item, bool forceRefresh) {
|
||||
if (!isGrouped(item)) {
|
||||
unregisterMessage(item);
|
||||
return;
|
||||
@ -79,6 +79,12 @@ void Groups::refreshMessage(not_null<HistoryItem*> item) {
|
||||
return;
|
||||
}
|
||||
auto &items = i->second.items;
|
||||
|
||||
if (forceRefresh) {
|
||||
refreshViews(items);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto position = findPositionForItem(items, item);
|
||||
auto current = ranges::find(items, item);
|
||||
if (current == end(items)) {
|
||||
|
@ -25,7 +25,9 @@ public:
|
||||
bool isGrouped(not_null<HistoryItem*> item) const;
|
||||
void registerMessage(not_null<HistoryItem*> item);
|
||||
void unregisterMessage(not_null<const HistoryItem*> item);
|
||||
void refreshMessage(not_null<HistoryItem*> item);
|
||||
void refreshMessage(
|
||||
not_null<HistoryItem*> item,
|
||||
bool forceRefresh = false);
|
||||
|
||||
const Group *find(not_null<HistoryItem*> item) const;
|
||||
|
||||
|
@ -765,7 +765,7 @@ void HistoryMessage::returnSavedMedia() {
|
||||
const auto wasGrouped = history()->owner().groups().isGrouped(this);
|
||||
_media = std::move(_savedMedia);
|
||||
if (wasGrouped) {
|
||||
history()->owner().groups().refreshMessage(this);
|
||||
history()->owner().groups().refreshMessage(this, true);
|
||||
} else {
|
||||
history()->owner().requestItemViewRefresh(this);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user