Improve clearing of reaction animations.

This commit is contained in:
John Preston 2022-01-11 19:19:30 +03:00
parent 490e688a91
commit 928d8feb21
2 changed files with 10 additions and 3 deletions

View file

@ -239,10 +239,12 @@ void BottomInfo::paintReactions(
auto x = left;
auto y = top;
auto widthLeft = availableWidth;
const auto animated = (_reactionAnimation && context.reactionEffects)
const auto animated = _reactionAnimation
? _reactionAnimation->playingAroundEmoji()
: QString();
if (_reactionAnimation && animated.isEmpty()) {
if (_reactionAnimation
&& context.reactionEffects
&& animated.isEmpty()) {
_reactionAnimation = nullptr;
}
for (const auto &reaction : _reactions) {
@ -361,6 +363,11 @@ void BottomInfo::layoutRepliesText() {
}
void BottomInfo::layoutReactionsText() {
if (_reactionAnimation
&& !_data.reactions.contains(
_reactionAnimation->playingAroundEmoji())) {
_reactionAnimation = nullptr;
}
if (_data.reactions.empty()) {
_reactions.clear();
return;

View file

@ -193,7 +193,7 @@ void InlineList::paint(
const auto animated = (_animation && context.reactionEffects)
? _animation->playingAroundEmoji()
: QString();
if (_animation && animated.isEmpty()) {
if (_animation && context.reactionEffects && animated.isEmpty()) {
_animation = nullptr;
}
p.setFont(st::semiboldFont);