Removed animation when removing reaction with double click.

This commit is contained in:
23rd 2022-04-15 12:22:21 +03:00
parent acb6e5dbc3
commit 148a173474
2 changed files with 12 additions and 6 deletions

View file

@ -1874,10 +1874,13 @@ void HistoryInner::toggleFavoriteReaction(not_null<Element*> view) const {
if (allowed && !allowed->contains(favorite)) {
return;
}
view->data()->toggleReaction(favorite);
if (const auto top = itemTop(view); top >= 0) {
view->animateReaction({ .emoji = favorite });
const auto item = view->data();
if (item->chosenReaction() != favorite) {
if (const auto top = itemTop(view); top >= 0) {
view->animateReaction({ .emoji = favorite });
}
}
item->toggleReaction(favorite);
}
void HistoryInner::contextMenuEvent(QContextMenuEvent *e) {

View file

@ -2108,10 +2108,13 @@ void ListWidget::toggleFavoriteReaction(not_null<Element*> view) const {
if (allowed && !allowed->contains(favorite)) {
return;
}
view->data()->toggleReaction(favorite);
if (const auto top = itemTop(view); top >= 0) {
view->animateReaction({ .emoji = favorite });
const auto item = view->data();
if (item->chosenReaction() != favorite) {
if (const auto top = itemTop(view); top >= 0) {
view->animateReaction({ .emoji = favorite });
}
}
item->toggleReaction(favorite);
}
void ListWidget::trySwitchToWordSelection() {