diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp index f9463c8c0a..76b3af0db6 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp @@ -2214,15 +2214,15 @@ void EditPeerProfileColorSection( const auto setIndex = [=](uint8 index) { state->index = index; + if (index != kUnsetColorIndex) { + resetUnique(); + } preview->setColorProfileIndex(index == kUnsetColorIndex ? std::nullopt : std::make_optional(index)); preview->setPatternEmojiId(index == kUnsetColorIndex ? std::nullopt : std::make_optional(state->patternEmojiId.current())); - if (index != kUnsetColorIndex) { - resetUnique(); - } }; setIndex(peer->colorProfileIndex().value_or(kUnsetColorIndex)); diff --git a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp index bf211ea362..86d907fb96 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_top_bar.cpp @@ -1250,7 +1250,7 @@ void TopBar::setPatternEmojiId(std::optional patternEmojiId) { void TopBar::setLocalEmojiStatusId(EmojiStatusId emojiStatusId) { _localCollectible = emojiStatusId.collectible; - if (emojiStatusId) { + if (!emojiStatusId.collectible) { _badgeContent = Badge::Content{ BadgeType::Premium, emojiStatusId }; } else { _badgeContent = BadgeContentForPeer(_peer); @@ -1271,6 +1271,8 @@ auto TopBar::effectiveCollectible() const -> std::shared_ptr { return _localCollectible ? _localCollectible + : _localColorProfileIndex + ? nullptr : _peer->emojiStatusId().collectible; }